Linux-mtd Archive on lore.kernel.org
 help / color / Atom feed
From: Mark Salyzyn <salyzyn@android.com>
To: linux-kernel@vger.kernel.org
Cc: "Latchesar Ionkov" <lucho@ionkov.net>,
	"Dave Kleikamp" <shaggy@kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	"Randy Dunlap" <rdunlap@infradead.org>,
	linux-doc@vger.kernel.org,
	"Martin Brandenburg" <martin@omnibond.com>,
	samba-technical@lists.samba.org,
	"Dominique Martinet" <asmadeus@codewreck.org>,
	"Amir Goldstein" <amir73il@gmail.com>,
	"David Howells" <dhowells@redhat.com>, "Chris Mason" <clm@fb.com>,
	"David S . Miller" <davem@davemloft.net>,
	"Andreas Dilger" <adilger.kernel@dilger.ca>,
	ocfs2-devel@oss.oracle.com, netdev@vger.kernel.org,
	"Tyler Hicks" <tyhicks@canonical.com>,
	linux-afs@lists.infradead.org,
	"Mike Marshall" <hubcap@omnibond.com>,
	linux-xfs@vger.kernel.org,
	"Andreas Gruenbacher" <agruenba@redhat.com>,
	"Sage Weil" <sage@redhat.com>, "Jonathan Corbet" <corbet@lwn.net>,
	"Richard Weinberger" <richard@nod.at>,
	"Mark Fasheh" <mark@fasheh.com>,
	devel@lists.orangefs.org, "Hugh Dickins" <hughd@google.com>,
	linux-security-module@vger.kernel.org, cluster-devel@redhat.com,
	"Vyacheslav Dubeyko" <slava@dubeyko.com>,
	v9fs-developer@lists.sourceforge.net,
	"Ilya Dryomov" <idryomov@gmail.com>,
	linux-ext4@vger.kernel.org, "Stephen Smalley" <sds@tycho.nsa.gov>,
	linux-mm@kvack.org, "Vivek Goyal" <vgoyal@redhat.com>,
	"Chao Yu" <yuchao0@huawei.com>,
	linux-cifs@vger.kernel.org,
	"Eric Van Hensbergen" <ericvh@gmail.com>,
	ecryptfs@vger.kernel.org, "Josef Bacik" <josef@toxicpanda.com>,
	"Darrick J . Wong" <darrick.wong@oracle.com>,
	reiserfs-devel@vger.kernel.org, "Tejun Heo" <tj@kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Joel Becker" <jlbec@evilplan.org>,
	linux-mtd@lists.infradead.org, "David Sterba" <dsterba@suse.com>,
	"Jaegeuk Kim" <jaegeuk@kernel.org>,
	ceph-devel@vger.kernel.org,
	"Trond Myklebust" <trond.myklebust@hammerspace.com>,
	linux-nfs@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	"Theodore Ts\'o" <tytso@mit.edu>,
	linux-fsdevel@vger.kernel.org,
	"Joseph Qi" <joseph.qi@linux.alibaba.com>,
	"Mathieu Malaterre" <malat@debian.org>,
	kernel-team@android.com, "Miklos Szeredi" <miklos@szeredi.hu>,
	"Jeff Layton" <jlayton@kernel.org>,
	linux-unionfs@vger.kernel.org, stable@vger.kernel.org,
	"Mark Salyzyn" <salyzyn@android.com>,
	"Steve French" <sfrench@samba.org>,
	"Ernesto A . Fernández" <ernesto.mnd.fernandez@gmail.com>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	"Jan Kara" <jack@suse.com>, "Bob Peterson" <rpeterso@redhat.com>,
	"Phillip Lougher" <phillip@squashfs.org.uk>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"David Woodhouse" <dwmw2@infradead.org>,
	"Anna Schumaker" <anna.schumaker@netapp.com>,
	linux-btrfs@vger.kernel.org,
	"Alexander Viro" <viro@zeniv.linux.org.uk>
Subject: [PATCH v13 1/5] overlayfs: check CAP_DAC_READ_SEARCH before issuing exportfs_decode_fh
Date: Wed, 31 Jul 2019 09:57:56 -0700
Message-ID: <20190731165803.4755-2-salyzyn@android.com> (raw)
In-Reply-To: <20190731165803.4755-1-salyzyn@android.com>

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
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Latchesar Ionkov <lucho@ionkov.net>
Cc: Dominique Martinet <asmadeus@codewreck.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Chris Mason <clm@fb.com>
Cc: Josef Bacik <josef@toxicpanda.com>
Cc: David Sterba <dsterba@suse.com>
Cc: Jeff Layton <jlayton@kernel.org>
Cc: Sage Weil <sage@redhat.com>
Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: Steve French <sfrench@samba.org>
Cc: Tyler Hicks <tyhicks@canonical.com>
Cc: Jan Kara <jack@suse.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Chao Yu <yuchao0@huawei.com>
Cc: Bob Peterson <rpeterso@redhat.com>
Cc: Andreas Gruenbacher <agruenba@redhat.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Richard Weinberger <richard@nod.at>
Cc: Dave Kleikamp <shaggy@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
Cc: Anna Schumaker <anna.schumaker@netapp.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mike Marshall <hubcap@omnibond.com>
Cc: Martin Brandenburg <martin@omnibond.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Phillip Lougher <phillip@squashfs.org.uk>
Cc: Darrick J. Wong <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Cc: Hugh Dickins <hughd@google.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Mathieu Malaterre <malat@debian.org>
Cc: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
Cc: v9fs-developer@lists.sourceforge.net
Cc: linux-afs@lists.infradead.org
Cc: linux-btrfs@vger.kernel.org
Cc: ceph-devel@vger.kernel.org
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Cc: ecryptfs@vger.kernel.org
Cc: linux-ext4@vger.kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net
Cc: linux-fsdevel@vger.kernel.org
Cc: cluster-devel@redhat.com
Cc: linux-mtd@lists.infradead.org
Cc: jfs-discussion@lists.sourceforge.net
Cc: linux-nfs@vger.kernel.org
Cc: ocfs2-devel@oss.oracle.com
Cc: devel@lists.orangefs.org
Cc: reiserfs-devel@vger.kernel.org
Cc: linux-mm@kvack.org
Cc: netdev@vger.kernel.org
Cc: linux-security-module@vger.kernel.org
Cc: stable@vger.kernel.org # 4.4, 4.9, 4.14 & 4.19
---
v11 + v12 + v13 - rebase

v10:
- return NULL rather than ERR_PTR(-EPERM)
- did _not_ add it ovl_can_decode_fh() because of changes since last
  review, suspect needs to be added to ovl_lower_uuid_ok()?

v8 + v9:
- 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 e9717c2f7d45..9702f0d5309d 100644
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -161,6 +161,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 NULL;
+
 	bytes = (fh->len - offsetof(struct ovl_fh, fid));
 	real = exportfs_decode_fh(mnt, (struct fid *)fh->fid,
 				  bytes >> 2, (int)fh->type,
-- 
2.22.0.770.g0f2c4a37fd-goog


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-31 16:57 [PATCH v13 0/5] overlayfs override_creds=off Mark Salyzyn
2019-07-31 16:57 ` Mark Salyzyn [this message]
2019-07-31 16:57 ` [PATCH v13 2/5] Add flags option to get xattr method paired to __vfs_getxattr Mark Salyzyn
2019-07-31 16:57 ` [PATCH v13 3/5] overlayfs: handle XATTR_NOSECURITY flag for get xattr method Mark Salyzyn
2019-07-31 16:57 ` [PATCH v13 4/5] overlayfs: internal getxattr operations without sepolicy checking Mark Salyzyn
2019-07-31 16:58 ` [PATCH v13 5/5] overlayfs: override_creds=off option bypass creator_cred Mark Salyzyn
2019-07-31 16:58 ` [PATCH v13 0/5] overlayfs override_creds=off Mark Salyzyn

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190731165803.4755-2-salyzyn@android.com \
    --to=salyzyn@android.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=agruenba@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=amir73il@gmail.com \
    --cc=anna.schumaker@netapp.com \
    --cc=asmadeus@codewreck.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=clm@fb.com \
    --cc=cluster-devel@redhat.com \
    --cc=corbet@lwn.net \
    --cc=darrick.wong@oracle.com \
    --cc=davem@davemloft.net \
    --cc=devel@lists.orangefs.org \
    --cc=dhowells@redhat.com \
    --cc=dsterba@suse.com \
    --cc=dwmw2@infradead.org \
    --cc=ebiederm@xmission.com \
    --cc=ecryptfs@vger.kernel.org \
    --cc=ericvh@gmail.com \
    --cc=ernesto.mnd.fernandez@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hubcap@omnibond.com \
    --cc=hughd@google.com \
    --cc=idryomov@gmail.com \
    --cc=jack@suse.com \
    --cc=jaegeuk@kernel.org \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=jlayton@kernel.org \
    --cc=jlbec@evilplan.org \
    --cc=josef@toxicpanda.com \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=kernel-team@android.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=lucho@ionkov.net \
    --cc=malat@debian.org \
    --cc=mark@fasheh.com \
    --cc=martin@omnibond.com \
    --cc=miklos@szeredi.hu \
    --cc=netdev@vger.kernel.org \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=phillip@squashfs.org.uk \
    --cc=rdunlap@infradead.org \
    --cc=reiserfs-devel@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=rpeterso@redhat.com \
    --cc=sage@redhat.com \
    --cc=samba-technical@lists.samba.org \
    --cc=sds@tycho.nsa.gov \
    --cc=sfrench@samba.org \
    --cc=shaggy@kernel.org \
    --cc=slava@dubeyko.com \
    --cc=stable@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=trond.myklebust@hammerspace.com \
    --cc=tyhicks@canonical.com \
    --cc=tytso@mit.edu \
    --cc=v9fs-developer@lists.sourceforge.net \
    --cc=vgoyal@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yuchao0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-mtd Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mtd/0 linux-mtd/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mtd linux-mtd/ https://lore.kernel.org/linux-mtd \
		linux-mtd@lists.infradead.org linux-mtd@archiver.kernel.org
	public-inbox-index linux-mtd

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-mtd


AGPL code for this site: git clone https://public-inbox.org/ public-inbox