diff options
| author | Christian Brauner <brauner@kernel.org> | 2026-07-24 15:41:19 +0200 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-07-27 17:18:00 +0200 |
| commit | 20370a5f5d9b1549ab3bf10a898b4e024b8841fa (patch) | |
| tree | 8acb39a3ea57d6760679ce7504dc5f408995c391 /tools/tracing/rtla/tests/scripts/lib/git@git.tavy.me:linux.git | |
| parent | cdf930a00949af72fbe9a22da2a8efa77981baa7 (diff) | |
fs: add fchroot()
Add a file descriptor based counterpart to chroot(2). This has been
overdue for a long time. It is the natural companion to fchdir() and
avoids re-resolving a path that the caller already holds a file
descriptor to. No TOCTOU between resolving the target and changing the
root. It composes with modern fd-based APIs meaning it works with O_PATH
file descriptors and file descriptors to detached mount trees created
via open_tree(OPEN_TREE_CLONE).
The permission model is identical to chroot(2). The caller must have
CAP_SYS_CHROOT in its user namespace, must pass MAY_EXEC | MAY_CHDIR
permission checks on the target directory, and LSMs are consulted via
the same security_path_chroot() hook.
The system call takes a flags argument for future extensibility which
must currently be zero.
Link: https://patch.msgid.link/20260724-work-failfs-v2-3-485dabbae185@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'tools/tracing/rtla/tests/scripts/lib/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
