linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Christian Brauner <christian@brauner.io>,
	Seth Forshee <sforshee@kernel.org>
Cc: Christian Brauner <brauner@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: linux-next: manual merge of the vfs-idmapping tree with Linus' tree
Date: Mon, 30 Jan 2023 10:31:49 +1100	[thread overview]
Message-ID: <20230130103149.7d09e239@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 5110 bytes --]

Hi all,

Today's linux-next merge of the vfs-idmapping tree got conflicts in:

  fs/fuse/acl.c
  fs/fuse/fuse_i.h
  fs/fuse/xattr.c

between commit:

  facd61053cff ("fuse: fixes after adapting to new posix acl api")

from Linus' tree and various commits from the vfs-idmapping tree.

Christian: thanks for supplying the resolution.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/fuse/acl.c
index ad670369955f,23d1c263891f..000000000000
--- a/fs/fuse/acl.c
+++ b/fs/fuse/acl.c
@@@ -11,10 -11,9 +11,10 @@@
  #include <linux/posix_acl.h>
  #include <linux/posix_acl_xattr.h>
  
 -struct posix_acl *fuse_get_acl(struct inode *inode, int type, bool rcu)
 +static struct posix_acl *__fuse_get_acl(struct fuse_conn *fc,
- 					struct user_namespace *mnt_userns,
++					struct mnt_idmap *idmap,
 +					struct inode *inode, int type, bool rcu)
  {
 -	struct fuse_conn *fc = get_fuse_conn(inode);
  	int size;
  	const char *name;
  	void *value = NULL;
@@@ -54,47 -53,7 +54,47 @@@
  	return acl;
  }
  
 +static inline bool fuse_no_acl(const struct fuse_conn *fc,
 +			       const struct inode *inode)
 +{
 +	/*
 +	 * Refuse interacting with POSIX ACLs for daemons that
 +	 * don't support FUSE_POSIX_ACL and are not mounted on
 +	 * the host to retain backwards compatibility.
 +	 */
 +	return !fc->posix_acl && (i_user_ns(inode) != &init_user_ns);
 +}
 +
- struct posix_acl *fuse_get_acl(struct user_namespace *mnt_userns,
++struct posix_acl *fuse_get_acl(struct mnt_idmap *idmap,
 +			       struct dentry *dentry, int type)
 +{
 +	struct inode *inode = d_inode(dentry);
 +	struct fuse_conn *fc = get_fuse_conn(inode);
 +
 +	if (fuse_no_acl(fc, inode))
 +		return ERR_PTR(-EOPNOTSUPP);
 +
- 	return __fuse_get_acl(fc, mnt_userns, inode, type, false);
++	return __fuse_get_acl(fc, idmap, inode, type, false);
 +}
 +
 +struct posix_acl *fuse_get_inode_acl(struct inode *inode, int type, bool rcu)
 +{
 +	struct fuse_conn *fc = get_fuse_conn(inode);
 +
 +	/*
 +	 * FUSE daemons before FUSE_POSIX_ACL was introduced could get and set
 +	 * POSIX ACLs without them being used for permission checking by the
 +	 * vfs. Retain that behavior for backwards compatibility as there are
 +	 * filesystems that do all permission checking for acls in the daemon
 +	 * and not in the kernel.
 +	 */
 +	if (!fc->posix_acl)
 +		return NULL;
 +
- 	return __fuse_get_acl(fc, &init_user_ns, inode, type, rcu);
++	return __fuse_get_acl(fc, &nop_mnt_idmap, inode, type, rcu);
 +}
 +
- int fuse_set_acl(struct user_namespace *mnt_userns, struct dentry *dentry,
+ int fuse_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
  		 struct posix_acl *acl, int type)
  {
  	struct inode *inode = d_inode(dentry);
@@@ -140,14 -99,8 +140,14 @@@
  			return ret;
  		}
  
 -		if (!vfsgid_in_group_p(i_gid_into_vfsgid(&nop_mnt_idmap, inode)) &&
 +		/*
 +		 * Fuse daemons without FUSE_POSIX_ACL never changed the passed
 +		 * through POSIX ACLs. Such daemons don't expect setgid bits to
 +		 * be stripped.
 +		 */
 +		if (fc->posix_acl &&
- 		    !vfsgid_in_group_p(i_gid_into_vfsgid(&init_user_ns, inode)) &&
- 		    !capable_wrt_inode_uidgid(&init_user_ns, inode, CAP_FSETID))
++		    !vfsgid_in_group_p(i_gid_into_vfsgid(&nop_mnt_idmap, inode)) &&
+ 		    !capable_wrt_inode_uidgid(&nop_mnt_idmap, inode, CAP_FSETID))
  			extra_flags |= FUSE_SETXATTR_ACL_KILL_SGID;
  
  		ret = fuse_setxattr(inode, name, value, size, 0, extra_flags);
diff --cc fs/fuse/fuse_i.h
index 46797a171a84,ee084cead402..000000000000
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@@ -1264,12 -1264,12 +1264,12 @@@ ssize_t fuse_getxattr(struct inode *ino
  ssize_t fuse_listxattr(struct dentry *entry, char *list, size_t size);
  int fuse_removexattr(struct inode *inode, const char *name);
  extern const struct xattr_handler *fuse_xattr_handlers[];
 -extern const struct xattr_handler *fuse_acl_xattr_handlers[];
 -extern const struct xattr_handler *fuse_no_acl_xattr_handlers[];
  
  struct posix_acl;
 -struct posix_acl *fuse_get_acl(struct inode *inode, int type, bool rcu);
 +struct posix_acl *fuse_get_inode_acl(struct inode *inode, int type, bool rcu);
- struct posix_acl *fuse_get_acl(struct user_namespace *mnt_userns,
++struct posix_acl *fuse_get_acl(struct mnt_idmap *idmap,
 +			       struct dentry *dentry, int type);
- int fuse_set_acl(struct user_namespace *mnt_userns, struct dentry *dentry,
+ int fuse_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
  		 struct posix_acl *acl, int type);
  
  /* readdir.c */
diff --cc fs/fuse/xattr.c
index 9fe571ab569e,30aaaa4b3bfb..000000000000
--- a/fs/fuse/xattr.c
+++ b/fs/fuse/xattr.c

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2023-01-29 23:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-29 23:31 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-01-18 23:07 linux-next: manual merge of the vfs-idmapping tree with Linus' tree Stephen Rothwell

Reply instructions:

You may reply publicly 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=20230130103149.7d09e239@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=brauner@kernel.org \
    --cc=christian@brauner.io \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sforshee@kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).