[Devel] [PATCH RH7 0/4] Port open_tree and move_mount syscalls
Pavel Tikhomirov
ptikhomirov at virtuozzo.com
Tue Aug 25 19:14:04 MSK 2020
These syscalls were added as preparation step for new mount api (fsopen,
fsconfig, fsmount and fspick will be ported separately).
We can use them to implement "cross-namespace bind-mounting" like this:
fd = open_tree(AT_FDCWD, "/mnt", OPEN_TREE_CLONE);
setns(nsfd, CLONE_NEWNS);
move_mount(fd, "", AT_FDCWD, "/mnt2", MOVE_MOUNT_F_EMPTY_PATH);
This will allow us implementing feature of adding bindmounts to runing
container instead of having unreliable external propagations.
It is needed to VZ8, but does not apply cleanly so I will send it
separately.
https://jira.sw.ru/browse/PSBM-107263
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Al Viro (2):
saner handling of temporary namespaces
vfs: syscall: Add open_tree(2) to reference or clone a mount
David Howells (2):
vfs: syscall: Add move_mount(2) to move mounts around
teach move_mount(2) to work with OPEN_TREE_CLONE
arch/x86/syscalls/syscall_32.tbl | 3 +
arch/x86/syscalls/syscall_64.tbl | 3 +
fs/file_table.c | 9 +-
fs/internal.h | 1 +
fs/mount.h | 5 +
fs/namespace.c | 421 ++++++++++++++++++++++++-------
include/linux/fs.h | 3 +
include/linux/security.h | 12 +
include/linux/syscalls.h | 5 +
include/uapi/linux/fcntl.h | 1 +
include/uapi/linux/fs.h | 17 ++
security/capability.c | 6 +
security/security.c | 5 +
security/selinux/hooks.c | 9 +
14 files changed, 399 insertions(+), 101 deletions(-)
--
2.24.1
More information about the Devel
mailing list