Skip to contentSkip to conversation

linux-next: manual merge of the pidfd tree with the overlayfs tree

DISCUSSION Stephen Rothwell 1 participant 2 messages Jan 25, 2021 – Feb 4, 2021 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi all,

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

fs/overlayfs/copy_up.c

between commit:

06896fa3193d ("ovl: skip getxattr of security labels")

from the overlayfs tree and commit:

c7c7a1a18af4 ("xattr: handle idmapped mounts")

from the pidfd 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.

Signature · 44 lines
Cheers,
Stephen Rothwell

diff --cc fs/overlayfs/copy_up.c
index 0fed532efa68,f81b836c2256..000000000000
--- a/fs/overlayfs/copy_up.c
+++ b/fs/overlayfs/copy_up.c
@@@ -84,18 -84,10 +84,18 @@@ int ovl_copy_xattr(struct super_block *
  
  		if (ovl_is_private_xattr(sb, name))
  			continue;
 +
 +		error = security_inode_copy_up_xattr(name);
 +		if (error < 0 && error != -EOPNOTSUPP)
 +			break;
 +		if (error == 1) {
 +			error = 0;
 +			continue; /* Discard */
 +		}
  retry:
- 		size = vfs_getxattr(old, name, value, value_size);
+ 		size = vfs_getxattr(&init_user_ns, old, name, value, value_size);
  		if (size == -ERANGE)
- 			size = vfs_getxattr(old, name, NULL, 0);
+ 			size = vfs_getxattr(&init_user_ns, old, name, NULL, 0);
  
  		if (size < 0) {
  			error = size;
@@@ -115,7 -107,14 +115,7 @@@
  			goto retry;
  		}
  
- 		error = vfs_setxattr(new, name, value, size, 0);
 -		error = security_inode_copy_up_xattr(name);
 -		if (error < 0 && error != -EOPNOTSUPP)
 -			break;
 -		if (error == 1) {
 -			error = 0;
 -			continue; /* Discard */
 -		}
+ 		error = vfs_setxattr(&init_user_ns, new, name, value, size, 0);
  		if (error) {
  			if (error != -EOPNOTSUPP || ovl_must_copy_xattr(name))
  				break;
#1 lore raw

Hi all,

Quoted 53 lines · On Mon, 25 Jan 2021 17:04:26 +1100 Stephen Rothwell <[email protected]>…

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

fs/overlayfs/copy_up.c

between commit:

06896fa3193d ("ovl: skip getxattr of security labels")

from the overlayfs tree and commit:

c7c7a1a18af4 ("xattr: handle idmapped mounts")

from the pidfd 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.

fs/overlayfs/copy_up.c +2 -3
diff --cc fs/overlayfs/copy_up.c
index 0fed532efa68,f81b836c2256..000000000000
@@@ -84,18 -84,10 +84,18 @@@ int ovl_copy_xattr(struct super_block *
 
  		if (ovl_is_private_xattr(sb, name))
  			continue;
 +
 +		error = security_inode_copy_up_xattr(name);
 +		if (error < 0 && error != -EOPNOTSUPP)
 +			break;
 +		if (error == 1) {
 +			error = 0;
 +			continue; /* Discard */
 +		}
  retry:
- 		size = vfs_getxattr(old, name, value, value_size);
+ 		size = vfs_getxattr(&init_user_ns, old, name, value, value_size);
  		if (size == -ERANGE)
- 			size = vfs_getxattr(old, name, NULL, 0);
+ 			size = vfs_getxattr(&init_user_ns, old, name, NULL, 0);
 
  		if (size < 0) {
  			error = size;
@@@ -115,7 -107,14 +115,7 @@@
  			goto retry;
  		}
 
- 		error = vfs_setxattr(new, name, value, size, 0);
 -		error = security_inode_copy_up_xattr(name);

fs/overlayfs/copy_up.c

Quoted 10 lines
fs/overlayfs/copy_up.c +1 -0
 -		if (error < 0 && error != -EOPNOTSUPP)
 -			break;
 -		if (error == 1) {
 -			error = 0;
 -			continue; /* Discard */
 -		}
+ 		error = vfs_setxattr(&init_user_ns, new, name, value, size, 0);
  		if (error) {
  			if (error != -EOPNOTSUPP || ovl_must_copy_xattr(name))
  				break;

This is now a conflict between the pidfd tree and Linus' tree.

Signature · 2 lines
Cheers,
Stephen Rothwell