linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v8 1/2] overlayfs: check CAP_DAC_READ_SEARCH before issuing exportfs_decode_fh
@ 2018-11-06 23:01 Mark Salyzyn
  2018-11-06 23:01 ` [PATCH v8 2/2] overlayfs: override_creds=off option bypass creator_cred Mark Salyzyn
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Salyzyn @ 2018-11-06 23:01 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mark Salyzyn, Miklos Szeredi, Jonathan Corbet, Vivek Goyal,
	Eric W . Biederman, Amir Goldstein, Randy Dunlap, Stephen Smalley,
	linux-unionfs, linux-doc, kernel-team

Assumption never checked, should fail if the mounter creds are not
sufficient.

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
Cc: kernel-team@android.com
---
v8:
- rebase

v7:
- This time for realz

v6:
- rebase

v5:
- dependency of "overlayfs: override_creds=off option bypass creator_cred"

 fs/overlayfs/namei.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
index efd372312ef1..3ac9dc8f6cc0 100644
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -163,6 +163,9 @@ struct dentry *ovl_decode_real_fh(struct ovl_fh *fh, struct vfsmount *mnt,
 	if (!uuid_equal(&fh->uuid, &mnt->mnt_sb->s_uuid))
 		return NULL;
 
+	if (!capable(CAP_DAC_READ_SEARCH))
+		return ERR_PTR(-EPERM);
+
 	bytes = (fh->len - offsetof(struct ovl_fh, fid));
 	real = exportfs_decode_fh(mnt, (struct fid *)fh->fid,
 				  bytes >> 2, (int)fh->type,
-- 
2.19.1.930.g4563a0d9d0-goog


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

end of thread, other threads:[~2018-11-14 22:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-06 23:01 [PATCH v8 1/2] overlayfs: check CAP_DAC_READ_SEARCH before issuing exportfs_decode_fh Mark Salyzyn
2018-11-06 23:01 ` [PATCH v8 2/2] overlayfs: override_creds=off option bypass creator_cred Mark Salyzyn
2018-11-08 15:56   ` Vivek Goyal
2018-11-08 20:01   ` Vivek Goyal
     [not found]     ` <b057da99-adc6-b355-fb57-b314a29f298f@android.com>
2018-11-09  3:05       ` Amir Goldstein
2018-11-09 17:32         ` Mark Salyzyn
2018-11-10  7:51           ` Amir Goldstein
2018-11-12 18:15             ` Mark Salyzyn
2018-11-09 15:20       ` Vivek Goyal
2018-11-14 22:00   ` Vivek Goyal

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).