Pull failfs filesystem from Christian Brauner: "Add failfs and expose a FD_FAILFS_ROOT sentinel. This allows userspace to shed their filesystem state completely. A process with its root or working directory in failfs must anchor every path lookup at an explicit file descriptor. Absolute paths, absolute symlinks and AT_FDCWD-relative lookups simply fail. Failfs is the counterpart to nullfs. nullfs says adds a permanently empty, immutable directory whose lookups fail with ENOENT but which can be opened, read, stat'd and mounted upon. Failfs on the other hand fails every operation. The root cannot be opened at all. A single instance is mounted during early boot via kern_mount(), which makes it logically distinct from every mount namespace. This is accompanied by a new fchroot() system call which makes chrooting via a file descriptor a first class concept. It's possible to chroot into failfs as an unprivileged user provided the task has no new privileges set" * tag 'vfs-7.3-rc1.failfs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: Documentation: add failfs documentation selftests/filesystems: add failfs selftests arch: hookup fchroot() system call fs: support FD_FAILFS_ROOT in fchroot() fs: add fchroot() fs: support FD_FAILFS_ROOT in fchdir() fs: add failfs
Showing the changes to include/uapi (3 of 44 files). Show all
Unified · Split
| @@ -863,8 +863,12 @@ __SYSCALL(__NR_listns, sys_listns) · 862 unmodified lines | |||
| 863 | #define __NR_rseq_slice_yield 471 | 863 | #define __NR_rseq_slice_yield 471 |
| 864 | __SYSCALL(__NR_rseq_slice_yield, sys_rseq_slice_yield) | 864 | __SYSCALL(__NR_rseq_slice_yield, sys_rseq_slice_yield) |
| 865 | 865 | ||
| 866 | /* fs/open.c */ | ||
| 867 | #define __NR_fchroot 472 | ||
| 868 | __SYSCALL(__NR_fchroot, sys_fchroot) | ||
| 869 | |||
| 866 | #undef __NR_syscalls | 870 | #undef __NR_syscalls |
| 867 | #define __NR_syscalls 472 | 871 | #define __NR_syscalls 473 |
| 868 | 872 | ||
| 869 | /* | 873 | /* |
| 870 | * 32 bit systems traditionally used different | 874 | * 32 bit systems traditionally used different |
| @@ -124,6 +124,7 @@ struct delegation { · 123 unmodified lines | |||
| 124 | 124 | ||
| 125 | #define FD_PIDFS_ROOT -10002 /* Root of the pidfs filesystem */ | 125 | #define FD_PIDFS_ROOT -10002 /* Root of the pidfs filesystem */ |
| 126 | #define FD_NSFS_ROOT -10003 /* Root of the nsfs filesystem */ | 126 | #define FD_NSFS_ROOT -10003 /* Root of the nsfs filesystem */ |
| 127 | #define FD_FAILFS_ROOT -10004 /* Root of the failfs filesystem */ | ||
| 127 | #define FD_INVALID -10009 /* Invalid file descriptor: -10000 - EBADF = -10009 */ | 128 | #define FD_INVALID -10009 /* Invalid file descriptor: -10000 - EBADF = -10009 */ |
| 128 | 129 | ||
| 129 | /* Generic flags for the *at(2) family of syscalls. */ | 130 | /* Generic flags for the *at(2) family of syscalls. */ |
| @@ -105,5 +105,6 @@ · 104 unmodified lines | |||
| 105 | #define PID_FS_MAGIC 0x50494446 /* "PIDF" */ | 105 | #define PID_FS_MAGIC 0x50494446 /* "PIDF" */ |
| 106 | #define GUEST_MEMFD_MAGIC 0x474d454d /* "GMEM" */ | 106 | #define GUEST_MEMFD_MAGIC 0x474d454d /* "GMEM" */ |
| 107 | #define NULL_FS_MAGIC 0x4E554C4C /* "NULL" */ | 107 | #define NULL_FS_MAGIC 0x4E554C4C /* "NULL" */ |
| 108 | #define FAIL_FS_MAGIC 0x4641494C /* "FAIL" */ | ||
| 108 | 109 | ||
| 109 | #endif /* __LINUX_MAGIC_H__ */ | 110 | #endif /* __LINUX_MAGIC_H__ */ |