Skip to content

allow unprivileged overlay mounts

Miklos Szeredi linux-api linux-fsdevel linux-security-module linux-unionfs lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest10 patches 29 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10vfs: move cap_convert_nscap() call into vfs_setxattr()fs/xattr.c include/linux/capability.h security/commoncap.c+13 -98 replies
2/10vfs: verify source area in vfs_dedupe_file_range_one()fs/remap_range.c+9 -10 replies
3/10ovl: check privs before decoding file handlefs/overlayfs/namei.c+3 -04 replies
4/10ovl: make ioctl() safefs/overlayfs/file.c+3 -727 replies
5/10ovl: simplify file splicefs/overlayfs/file.c+2 -440 replies
6/10ovl: user xattrfs/overlayfs/inode.c fs/overlayfs/overlayfs.h fs/overlayfs/ovl_entry.h +2 more+67 -123 replies
7/10ovl: do not fail when setting origin xattrfs/overlayfs/copy_up.c+2 -10 replies
8/10ovl: do not fail because of O_NOATIMEfs/overlayfs/file.c+3 -23 replies
9/10ovl: do not get metacopy for userxattrfs/overlayfs/util.c+7 -00 replies
10/10ovl: unprivieged mountsfs/overlayfs/super.c+1 -00 replies

Reviews trailers per patch

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

PatchAmir GoldsteinJames Morris
1/10A-b
2/10
3/10
4/10R-b
5/10
6/10R-b
7/10
8/10
9/10
10/10

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

Read the v2 thread

Cover letter [PATCH v2 00/10] allow unprivileged overlay mounts

I've done some more work to verify that unprivileged mount of overlayfs is safe.

One thing I did is to basically audit all function calls made by overlayfs to see if it's normally called with any checks and whether overlayfs calls it with the same (permission and other) checks.

Some of this work has already made it into 5.8 and this series contains more fixes.

A general observation is that overlayfs does not call security_path_*() hooks on the underlying fs. I don't see this as a problem, because a simple bind mount done inside a private mount namespace also defeats the path based security checks. Maybe I'm missing something here, so I'm interested in comments from AppArmor and Tomoyo developers.

Eric, do you have thought about what to look for with respect to unprivileged mount safety and whether you think this is ready for upstream?

Git tree:
git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git#ovl-unpriv-v2

Thanks,
Miklos

Miklos Szeredi (10):
vfs: move cap_convert_nscap() call into vfs_setxattr()
vfs: verify source area in vfs_dedupe_file_range_one()
ovl: check privs before decoding file handle
ovl: make ioctl() safe
ovl: simplify file splice
ovl: user xattr
ovl: do not fail when setting origin xattr
ovl: do not fail because of O_NOATIME
ovl: do not get metacopy for userxattr
ovl: unprivieged mounts

 fs/overlayfs/copy_up.c     |   3 +-
 fs/overlayfs/file.c        | 126 +++----------------------------------
 fs/overlayfs/inode.c       |  10 ++-
 fs/overlayfs/namei.c       |   3 +
 fs/overlayfs/overlayfs.h   |   8 ++-
 fs/overlayfs/ovl_entry.h   |   1 +
 fs/overlayfs/super.c       |  56 +++++++++++++++--
 fs/overlayfs/util.c        |  12 +++-
 fs/remap_range.c           |  10 ++-
 fs/xattr.c                 |  17 +++--
 include/linux/capability.h |   2 +-
 security/commoncap.c       |   3 +-
 12 files changed, 110 insertions(+), 141 deletions(-)
Signature · 1 line
2.26.2