Re: [PATCH RFC v3 02/90] Documentation: add examples for cells

From: Askar Safin

Date: Thu Nov 26 2026 - 01:57:38 EST


Josef Bacik <josef@xxxxxxxxxxxxxx>:
> + pidfd = pidfd_open(cfd, PIDFD_EMPTY);
> + pidfd_configure(pidfd, PIDFD_SET_STRING, "exec", "/bin/convert", 0);
> + pidfd_configure(pidfd, PIDFD_SET_BINARY, "argv", "convert\0-\0png:-", 16);
> + pidfd_configure(pidfd, PIDFD_SET_FD, "0", NULL, in_fd);
> + pidfd_configure(pidfd, PIDFD_SET_FD, "1", NULL, out_fd);
> + pidfd_configure(pidfd, PIDFD_CMD_START, NULL, NULL, 0);
> +
> + read(cfd, &status, sizeof(status));
> +
> +The ``ids`` slot was left empty, so this is a one-id cell. A builder without privilege
> +does the mounting in a user and mount namespace of its own, since ``open_tree()`` with
> +``OPEN_TREE_CLONE`` takes ``CAP_SYS_ADMIN`` over the mount namespace of the caller. The
> +cgroup has to be one that it owns and could move itself into, such as one that
> +``systemd --user`` has delegated to it.
> +
> +The new task has the three files it was given and no others. There is nothing to close
> +and nothing to forget.

You gave the task 2 files, not 3 (in_fd and out_fd). This is obvious mistake.
(Text and code don't match.) Why LLM did not caught it?

Also, as previously, I still suggest to open fd 2 as /dev/null.




> +Binding the node of the host's ``/dev`` does not do it.

So host should actually create device using mknod? This will be problematic
in case of nested cells (i. e. if we ever will support nested cells.)


--
Askar Safin