[Devel] [PATCH RH8 0/4] Port open_tree and move_mount syscalls

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Wed Sep 2 15:51:17 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.

Version for VZ8 is slightly different from VZ7 version.

https://jira.sw.ru/browse/PSBM-107263
    
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>

Al Viro (1):
  ms/saner handling of temporary namespaces

David Howells (1):
  ms/vfs: syscall: Add move_mount(2) to move mounts around

Pavel Tikhomirov (2):
  ms/vfs: syscall: Add open_tree(2) to reference or clone a mount
  ms/teach move_mount(2) to work with OPEN_TREE_CLONE

 arch/x86/entry/syscalls/syscall_32.tbl |   3 +
 arch/x86/entry/syscalls/syscall_64.tbl |   3 +
 fs/file_table.c                        |   9 +-
 fs/internal.h                          |   1 +
 fs/mount.h                             |   5 +
 fs/namespace.c                         | 412 +++++++++++++++++++------
 include/linux/fs.h                     |   3 +
 include/linux/lsm_hooks.h              |   6 +
 include/linux/security.h               |   7 +
 include/linux/syscalls.h               |   4 +
 include/uapi/linux/fcntl.h             |   1 +
 include/uapi/linux/fs.h                |  17 +
 security/security.c                    |   5 +
 security/selinux/hooks.c               |  10 +
 14 files changed, 388 insertions(+), 98 deletions(-)

-- 
2.24.1



More information about the Devel mailing list