linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v10 0/2] overlayfs override_creds=off
@ 2019-07-24 19:57 Mark Salyzyn
  2019-07-24 19:57 ` [PATCH v10 1/5] overlayfs: check CAP_DAC_READ_SEARCH before issuing exportfs_decode_fh Mark Salyzyn
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Mark Salyzyn @ 2019-07-24 19:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel-team, Mark Salyzyn, Miklos Szeredi, Jonathan Corbet,
	Vivek Goyal, Eric W . Biederman, Amir Goldstein, Randy Dunlap,
	Stephen Smalley, linux-unionfs, linux-doc

Patch series:

overlayfs: check CAP_DAC_READ_SEARCH before issuing exportfs_decode_fh
Add optional __get xattr method paired to __vfs_getxattr
overlayfs: add __get xattr method
overlayfs: internal getxattr operations without sepolicy checking
overlayfs: override_creds=off option bypass creator_cred

The first four patches address fundamental security issues that should
be solved regardless of the override_creds=off feature.

The fifth that adds the feature depends on these other fixes.

By default, all access to the upper, lower and work directories is the
recorded mounter's MAC and DAC credentials.  The incoming accesses are
checked against the caller's credentials.

If the principles of least privilege are applied for sepolicy, the
mounter's credentials might not overlap the credentials of the caller's
when accessing the overlayfs filesystem.  For example, a file that a
lower DAC privileged caller can execute, is MAC denied to the
generally higher DAC privileged mounter, to prevent an attack vector.

We add the option to turn off override_creds in the mount options; all
subsequent operations after mount on the filesystem will be only the
caller's credentials.  The module boolean parameter and mount option
override_creds is also added as a presence check for this "feature",
existence of /sys/module/overlay/parameters/overlay_creds

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Cc: linux-unionfs@vger.kernel.org
Cc: linux-doc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

---
v10:
- Rebase
- Return NULL on CAP_DAC_READ_SEARCH
- Add __get xattr method to solve sepolicy logging issue
- Drop unnecassary sys_admin sepolicy checking for administrative
  driver internal xattr functions.

v6:
- Drop CONFIG_OVERLAY_FS_OVERRIDE_CREDS.
- Do better with the documentation, drop rationalizations.
- pr_warn message adjusted to report consequences.

v5:
- beefed up the caveats in the Documentation
- Is dependent on
  "overlayfs: check CAP_DAC_READ_SEARCH before issuing exportfs_decode_fh"
  "overlayfs: check CAP_MKNOD before issuing vfs_whiteout"
- Added prwarn when override_creds=off

v4:
- spelling and grammar errors in text

v3:
- Change name from caller_credentials / creator_credentials to the
  boolean override_creds.
- Changed from creator to mounter credentials.
- Updated and fortified the documentation.
- Added CONFIG_OVERLAY_FS_OVERRIDE_CREDS

v2:
- Forward port changed attr to stat, resulting in a build error.
- altered commit message.

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2019-07-30 16:54 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-24 19:57 [PATCH v10 0/2] overlayfs override_creds=off Mark Salyzyn
2019-07-24 19:57 ` [PATCH v10 1/5] overlayfs: check CAP_DAC_READ_SEARCH before issuing exportfs_decode_fh Mark Salyzyn
2019-07-24 19:57 ` [PATCH v10 2/5] Add optional __get xattr method paired to __vfs_getxattr Mark Salyzyn
2019-07-24 19:57 ` [PATCH v10 3/5] overlayfs: add __get xattr method Mark Salyzyn
2019-07-25  5:48   ` Amir Goldstein
2019-07-25 15:03     ` Mark Salyzyn
2019-07-25 15:43       ` Amir Goldstein
2019-07-25 16:22         ` Mark Salyzyn
2019-07-26  5:04           ` Amir Goldstein
2019-07-26 18:30             ` Mark Salyzyn
2019-07-30 15:55               ` Stephen Smalley
2019-07-30 16:54                 ` Mark Salyzyn
2019-07-24 19:57 ` [PATCH v10 4/5] overlayfs: internal getxattr operations without sepolicy checking Mark Salyzyn
2019-07-25 11:00   ` Amir Goldstein
2019-07-25 14:37     ` Mark Salyzyn
2019-07-25 15:51       ` Amir Goldstein
2019-07-24 19:57 ` [PATCH v10 5/5] overlayfs: override_creds=off option bypass creator_cred Mark Salyzyn
2019-07-25  6:14   ` Amir Goldstein
2019-07-25 14:38     ` Mark Salyzyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).