Skip to contentSkip to conversation

linux-next: manual merge of the bpf-next tree with the vfs-brauner tree

PATCH Mark Brown 2 participants 2 messages Jun 4

Subsystems (4)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

Hi all,

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

kernel/bpf/inode.c

between commit:

a146500e11445 ("bpf: Add simple xattr support to bpffs")

from the vfs-brauner tree and commit:

b93c55b4932dd ("bpf: fix UAF by restoring RCU-delayed inode freeing in bpffs")

from the bpf-next tree.

This merge resolution definitely needs a double check.

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.

kernel/bpf/inode.c +0 -0
diff --cc kernel/bpf/inode.c
index c3f79b5a2f8c0,188c774a469ca..0000000000000
@@@ -842,9 -768,12 +842,13 @@@ static void bpf_destroy_inode(struct in
  
  	if (!bpf_inode_type(inode, &type))
  		bpf_any_put(inode->i_private, type);
 +	simple_xattrs_free(&opts->xa_cache, &bi->xattrs, NULL);
  }
  
+ /*
+  * Called after RCU grace period - safe to free inode and anything
+  *  that might be accessed by RCU pathwalk (inode fields, i_link).
+  */
  static void bpf_free_inode(struct inode *inode)
  {
  	if (S_ISLNK(inode->i_mode))
maintainer
#1 lore raw
Quoted 33 lines · Mark Brown

Hi all,

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

kernel/bpf/inode.c

between commit:

a146500e11445 ("bpf: Add simple xattr support to bpffs")

from the vfs-brauner tree and commit:

b93c55b4932dd ("bpf: fix UAF by restoring RCU-delayed inode freeing in bpffs")

from the bpf-next tree.

This merge resolution definitely needs a double check.

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.

kernel/bpf/inode.c +0 -0
diff --cc kernel/bpf/inode.c
index c3f79b5a2f8c0,188c774a469ca..0000000000000
@@@ -842,9 -768,12 +842,13 @@@ static void bpf_destroy_inode(struct in
 
   	if (!bpf_inode_type(inode, &type))
   		bpf_any_put(inode->i_private, type);

kernel/bpf/inode.c

Quoted 10 lines
kernel/bpf/inode.c +4 -0
  +	simple_xattrs_free(&opts->xa_cache, &bi->xattrs, NULL);
   }
 
+ /*
+  * Called after RCU grace period - safe to free inode and anything
+  *  that might be accessed by RCU pathwalk (inode fields, i_link).
+  */
   static void bpf_free_inode(struct inode *inode)
   {
   	if (S_ISLNK(inode->i_mode))

Ack, looks good to me! The extra comment could probably be dropped (in other words going with what's in Christian's tree as resolution), but its fine either way.

Thanks,
Daniel