linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Miklos Szeredi <mszeredi@redhat.com>,
	Seth Forshee <seth.forshee@canonical.com>,
	Jan Kara <jack@suse.cz>
Subject: linux-next: manual merge of the vfs tree with Linus' tree
Date: Mon, 10 Oct 2016 11:20:24 +1100	[thread overview]
Message-ID: <20161010112024.4690d480@canb.auug.org.au> (raw)

Hi Al,

Today's linux-next merge of the vfs tree got a conflict in:

  fs/fuse/dir.c

between commits:

  5e2b8828ff3d ("fuse: invalidate dir dentry after chmod")
  a09f99eddef4 ("fuse: fix killing s[ug]id in setattr")
  5e940c1dd3c1 ("fuse: handle killpriv in userspace fs")
  60bcc88ad185 ("fuse: Add posix ACL support")

from Linus' tree and commit:

  62490330769c ("fuse: Propagate dentry down to inode_change_ok()")
  fd50ecaddf83 ("vfs: Remove {get,set,remove}xattr inode operations")

from the vfs tree.

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/dir.c
index f7c84ab835ca,009f68e979e2..000000000000
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@@ -1618,10 -1607,10 +1619,10 @@@ int fuse_do_setattr(struct dentry *dent
  	int err;
  	bool trust_local_cmtime = is_wb && S_ISREG(inode->i_mode);
  
 -	if (!(fc->flags & FUSE_DEFAULT_PERMISSIONS))
 +	if (!fc->default_permissions)
  		attr->ia_valid |= ATTR_FORCE;
  
- 	err = inode_change_ok(inode, attr);
+ 	err = setattr_prepare(dentry, attr);
  	if (err)
  		return err;
  
@@@ -1722,56 -1708,10 +1723,56 @@@ static int fuse_setattr(struct dentry *
  	if (!fuse_allow_current_process(get_fuse_conn(inode)))
  		return -EACCES;
  
 -	if (attr->ia_valid & ATTR_FILE)
 -		return fuse_do_setattr(entry, attr, attr->ia_file);
 -	else
 -		return fuse_do_setattr(entry, attr, NULL);
 +	if (attr->ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID)) {
 +		attr->ia_valid &= ~(ATTR_KILL_SUID | ATTR_KILL_SGID |
 +				    ATTR_MODE);
 +
 +		/*
 +		 * The only sane way to reliably kill suid/sgid is to do it in
 +		 * the userspace filesystem
 +		 *
 +		 * This should be done on write(), truncate() and chown().
 +		 */
 +		if (!fc->handle_killpriv) {
 +			int kill;
 +
 +			/*
 +			 * ia_mode calculation may have used stale i_mode.
 +			 * Refresh and recalculate.
 +			 */
 +			ret = fuse_do_getattr(inode, NULL, file);
 +			if (ret)
 +				return ret;
 +
 +			attr->ia_mode = inode->i_mode;
 +			kill = should_remove_suid(entry);
 +			if (kill & ATTR_KILL_SUID) {
 +				attr->ia_valid |= ATTR_MODE;
 +				attr->ia_mode &= ~S_ISUID;
 +			}
 +			if (kill & ATTR_KILL_SGID) {
 +				attr->ia_valid |= ATTR_MODE;
 +				attr->ia_mode &= ~S_ISGID;
 +			}
 +		}
 +	}
 +	if (!attr->ia_valid)
 +		return 0;
 +
- 	ret = fuse_do_setattr(inode, attr, file);
++	ret = fuse_do_setattr(entry, attr, file);
 +	if (!ret) {
 +		/*
 +		 * If filesystem supports acls it may have updated acl xattrs in
 +		 * the filesystem, so forget cached acls for the inode.
 +		 */
 +		if (fc->posix_acl)
 +			forget_all_cached_acls(inode);
 +
 +		/* Directory mode changed, may need to revalidate access */
 +		if (d_is_dir(entry) && (attr->ia_valid & ATTR_MODE))
 +			fuse_invalidate_entry_cache(entry);
 +	}
 +	return ret;
  }
  
  static int fuse_getattr(struct vfsmount *mnt, struct dentry *entry,
@@@ -1800,12 -1740,7 +1801,9 @@@ static const struct inode_operations fu
  	.mknod		= fuse_mknod,
  	.permission	= fuse_permission,
  	.getattr	= fuse_getattr,
- 	.setxattr	= generic_setxattr,
- 	.getxattr	= generic_getxattr,
  	.listxattr	= fuse_listxattr,
- 	.removexattr	= generic_removexattr,
 +	.get_acl	= fuse_get_acl,
 +	.set_acl	= fuse_set_acl,
  };
  
  static const struct file_operations fuse_dir_operations = {
@@@ -1823,12 -1758,7 +1821,9 @@@ static const struct inode_operations fu
  	.setattr	= fuse_setattr,
  	.permission	= fuse_permission,
  	.getattr	= fuse_getattr,
- 	.setxattr	= generic_setxattr,
- 	.getxattr	= generic_getxattr,
  	.listxattr	= fuse_listxattr,
- 	.removexattr	= generic_removexattr,
 +	.get_acl	= fuse_get_acl,
 +	.set_acl	= fuse_set_acl,
  };
  
  static const struct inode_operations fuse_symlink_inode_operations = {

             reply	other threads:[~2016-10-10  0:20 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10  0:20 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-01-05  0:10 linux-next: manual merge of the vfs tree with Linus' tree Stephen Rothwell
2024-01-05  0:20 ` Steven Rostedt
2024-01-01 22:36 Stephen Rothwell
2020-07-28  1:09 Stephen Rothwell
2020-07-27  1:37 Stephen Rothwell
2020-03-31 23:55 Stephen Rothwell
2019-01-02  1:32 Stephen Rothwell
2019-01-02  1:18 Stephen Rothwell
2018-10-30  1:20 Stephen Rothwell
2018-06-01  1:52 Stephen Rothwell
2018-01-01 22:54 Stephen Rothwell
2017-12-03 23:05 Stephen Rothwell
2017-11-28 23:53 Stephen Rothwell
2017-11-30 23:36 ` Stephen Rothwell
2017-11-17  0:42 Stephen Rothwell
2017-03-30  0:07 Stephen Rothwell
2017-02-27  0:10 Stephen Rothwell
2017-02-27  8:28 ` David Howells
2017-01-22 23:36 Stephen Rothwell
2016-05-19  1:17 Stephen Rothwell
2016-05-19  2:02 ` Steve French
2016-05-02  0:49 Stephen Rothwell
2016-05-02  0:43 Stephen Rothwell
2016-05-02  0:38 Stephen Rothwell
2016-03-13 23:24 Stephen Rothwell
2015-12-07  1:46 Stephen Rothwell
2015-02-22  0:57 Stephen Rothwell
2015-02-22  0:55 Stephen Rothwell
2015-02-22  0:51 Stephen Rothwell
2015-02-22  0:46 Stephen Rothwell
2015-01-23  1:10 Stephen Rothwell
2014-05-29  3:19 Stephen Rothwell
2014-04-22  1:17 Stephen Rothwell
2014-04-22  0:50 Stephen Rothwell
2014-04-22  0:44 Stephen Rothwell
2013-11-08  1:01 Stephen Rothwell
2013-09-05  2:59 Stephen Rothwell
2013-05-02  2:00 Stephen Rothwell
2013-05-02  1:55 Stephen Rothwell
2013-05-01  2:11 Stephen Rothwell
2013-04-29  1:38 Stephen Rothwell
2012-09-24  1:45 Stephen Rothwell
2012-07-30  0:41 Stephen Rothwell
2012-07-30  0:37 Stephen Rothwell
2012-02-14  0:54 Stephen Rothwell
2012-02-14  1:43 ` Al Viro
2012-01-09  1:11 Stephen Rothwell
2012-01-09  1:32 ` Linus Torvalds
2012-01-09  2:22   ` Stephen Rothwell
2012-01-09  2:14 ` Al Viro
2010-05-28  1:31 Stephen Rothwell
2010-05-28  1:31 Stephen Rothwell
2009-05-04  3:13 Stephen Rothwell
2009-05-04  3:55 ` Al Viro

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=20161010112024.4690d480@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=seth.forshee@canonical.com \
    --cc=viro@ZenIV.linux.org.uk \
    /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).