Skip to content

mount ownership and unprivileged mount syscall (v7)

Miklos Szeredi containers linux-fsdevel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 7 repliesIn review

v6 -> v7 from the cover letter

- add '/proc/sys/fs/types/<type>/usermount_safe' tunable (new patch)
- do not make FUSE safe by default, describe possible problems associated with unprivileged FUSE mounts in patch header
- return EMFILE instead of EPERM, if maximum user mount count is exceeded
- rename option 'nomnt' -> 'nosubmnt'
- clean up error propagation in dup_mnt_ns
- update util-linux-ng patch

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10unprivileged mounts: add user mounts to the kernelfs/namespace.c fs/pnode.h include/linux/fs.h +1 more+36 -80 replies
2/10unprivileged mounts: allow unprivileged umountfs/namespace.c+22 -10 replies
3/10unprivileged mounts: propagate error values from clone_mntfs/namespace.c fs/pnode.c+49 -470 replies
4/10unprivileged mounts: account user mountsDocumentation/filesystems/proc.txt fs/namespace.c include/linux/fs.h +1 more+91 -40 replies
5/10unprivileged mounts: allow unprivileged bind mountsfs/namespace.c+27 -170 replies
6/10unprivileged mounts: allow unprivileged mountsfs/namespace.c fs/super.c include/linux/fs.h+67 -400 replies
7/10unprivileged mounts: add sysctl tunable for "safe" propertyDocumentation/filesystems/proc.txt fs/filesystems.c include/linux/fs.h+79 -05 replies
8/10unprivileged mounts: make fuse safefs/fuse/inode.c+21 -01 reply
9/10unprivileged mounts: propagation: inherit owner from parentfs/namespace.c fs/pnode.c fs/pnode.h +1 more+44 -191 reply
10/10unprivileged mounts: add "no submounts" flagfs/namespace.c include/linux/fs.h include/linux/mount.h+10 -20 replies

Reviews trailers per patch

9 of 10 patches have a Reviewed-by or Acked-by.

PatchSerge Hallyn
1/10A-b
2/10A-b
3/10A-b
4/10A-b
5/10A-b
6/10A-b
7/10
8/10A-b
9/10A-b
10/10A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [patch 00/10] mount ownership and unprivileged mount syscall (v7)

Thanks to everyone for the comments on the previous submission.

Christoph, could you please look through the patches if they are acceptable from the VFS point of view?

Thanks,
Miklos

v6 -> v7:

- add '/proc/sys/fs/types/<type>/usermount_safe' tunable (new patch)
- do not make FUSE safe by default, describe possible problems associated with unprivileged FUSE mounts in patch header
- return EMFILE instead of EPERM, if maximum user mount count is exceeded
- rename option 'nomnt' -> 'nosubmnt'
- clean up error propagation in dup_mnt_ns
- update util-linux-ng patch

v5 -> v6:

- update to latest -mm
- preliminary util-linux-ng support (will post right after this series)

v4 -> v5:

- fold back Andrew's changes
- fold back my update patch:
o use fsuid instead of ruid
o allow forced unpriv. unmounts for "safe" filesystems
o allow mounting over special files, but not over symlinks
o set nosuid and nodev based on lack of specific capability
- patch header updates
- new patch: on propagation inherit owner from parent
- new patch: add "no submounts" mount flag

v3 -> v4:

- simplify interface as much as possible, now only a single option ("user=UID") is used to control everything
- no longer allow/deny mounting based on file/directory permissions, that approach does not always make sense

v1 -> v3:

- add mount flags to set/clear mnt_flags individually
- add "usermnt" mount flag. If it is set, then allow unprivileged submounts under this mount
- make max number of user mounts default to 1024, since now the usermnt flag will prevent user mounts by default

--