Skip to contentSkip to conversation

linux-next: manual merge of the f2fs tree with the fscrypt tree

DISCUSSION Stephen Rothwell 2 participants 3 messages Dec 10, 2018 – Jan 2, 2019 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi all,

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

fs/f2fs/dir.c

between commit:

848a010287e6 ("f2fs: use IS_ENCRYPTED() to check encryption status")

from the fscrypt tree and commit:

4e240d1bab1e ("f2fs: check memory boundary by insane namelen")

from the f2fs 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 · 27 lines
Cheers,
Stephen Rothwell

diff --cc fs/f2fs/dir.c
index cf9e2564388d,c0c845da12fa..000000000000
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@@ -808,7 -808,18 +808,18 @@@ int f2fs_fill_dentries(struct dir_conte
  		de_name.name = d->filename[bit_pos];
  		de_name.len = le16_to_cpu(de->name_len);
  
+ 		/* check memory boundary before moving forward */
+ 		bit_pos += GET_DENTRY_SLOTS(le16_to_cpu(de->name_len));
+ 		if (unlikely(bit_pos > d->max)) {
+ 			f2fs_msg(sbi->sb, KERN_WARNING,
+ 				"%s: corrupted namelen=%d, run fsck to fix.",
+ 				__func__, le16_to_cpu(de->name_len));
+ 			set_sbi_flag(sbi, SBI_NEED_FSCK);
+ 			err = -EINVAL;
+ 			goto out;
+ 		}
+ 
 -		if (f2fs_encrypted_inode(d->inode)) {
 +		if (IS_ENCRYPTED(d->inode)) {
  			int save_len = fstr->len;
  
  			err = fscrypt_fname_disk_to_usr(d->inode,
#1 lore raw

Hi all,

Quoted 40 lines · On Tue, 11 Dec 2018 10:13:22 +1100 Stephen Rothwell <[email protected]>…

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

fs/f2fs/dir.c

between commit:

848a010287e6 ("f2fs: use IS_ENCRYPTED() to check encryption status")

from the fscrypt tree and commit:

4e240d1bab1e ("f2fs: check memory boundary by insane namelen")

from the f2fs 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 · 2 lines
Cheers,
Stephen Rothwell
fs/f2fs/dir.c +6 -0
diff --cc fs/f2fs/dir.c
index cf9e2564388d,c0c845da12fa..000000000000
@@@ -808,7 -808,18 +808,18 @@@ int f2fs_fill_dentries(struct dir_conte
  		de_name.name = d->filename[bit_pos];
  		de_name.len = le16_to_cpu(de->name_len);
 
+ 		/* check memory boundary before moving forward */
+ 		bit_pos += GET_DENTRY_SLOTS(le16_to_cpu(de->name_len));
+ 		if (unlikely(bit_pos > d->max)) {
+ 			f2fs_msg(sbi->sb, KERN_WARNING,
+ 				"%s: corrupted namelen=%d, run fsck to fix.",
+ 				__func__, le16_to_cpu(de->name_len));

fs/f2fs/dir.c

Quoted 10 lines
fs/f2fs/dir.c +5 -0
+ 			set_sbi_flag(sbi, SBI_NEED_FSCK);
+ 			err = -EINVAL;
+ 			goto out;
+ 		}
+ 
 -		if (f2fs_encrypted_inode(d->inode)) {
 +		if (IS_ENCRYPTED(d->inode)) {
  			int save_len = fstr->len;
 
  			err = fscrypt_fname_disk_to_usr(d->inode,

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

Signature · 2 lines
Cheers,
Stephen Rothwell
#2 lore raw
Quoted 26 lines · IST Stephen Rothwell

Hi all,

Quoted 13 lines · On Tue, 11 Dec 2018 10:13:22 +1100 Stephen Rothwell <[email protected]>…

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

fs/f2fs/dir.c

between commit:

848a010287e6 ("f2fs: use IS_ENCRYPTED() to check encryption status")

from the fscrypt tree and commit:

4e240d1bab1e ("f2fs: check memory boundary by insane namelen")

Quoted 9 lines

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

Quoted 3 lines

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

fscrypt's master branch has fsverity patches applied. These are not available on Linus' tree. Hence the conflict.

Just FYI, The discussion on merging fsverity into mainline kernel is still going on.

Signature · 1 line
chandan