mbox series

[0/4] ext4: clean up ea_inode handling

Message ID 20230524034951.779531-1-tytso@mit.edu
Headers show
Series ext4: clean up ea_inode handling | expand

Message

Theodore Ts'o May 24, 2023, 3:49 a.m. UTC
This fixes a number of problems with ea_inode handling which were
pointed out by syzbot.  The first and third add some additional
checking for invalid / maliciously fuzzed file systems.  The second
and fourth patch adds some lockdep annotations to avoid some false
positive reports from lockdep.

There is still one remaining syzbot report[1] relating to ea_inodes
not handled by this patch series, and that is an apparently deadlock
which happens when a kernel thread is freeing an ea_inode racing with
another thread which is trying to find the mbcache entry (presumably
with the intent of reusing it).  The problem is apparently hard to
reproduce; it's only been hit 4 times, and there is no C reproducer;
just a syzkaller reproducer.  So we'll leave that for another day/

[1] https://syzkaller.appspot.com/bug?extid=38e6635a03c83c76297a
    INFO: task hung in ext4_evict_ea_inode


Theodore Ts'o (4):
  ext4: add EA_INODE checking to ext4_iget()
  ext4: set lockdep subclass for the ea_inode in
    ext4_xattr_inode_cache_find()
  ext4: disallow ea_inodes with extended attributes
  ext4: add lockdep annotations for i_data_sem for ea_inode's

 fs/ext4/ext4.h  |  5 ++++-
 fs/ext4/inode.c | 34 +++++++++++++++++++++++++++++-----
 fs/ext4/xattr.c | 41 ++++++++++++-----------------------------
 3 files changed, 45 insertions(+), 35 deletions(-)

Comments

Theodore Ts'o May 30, 2023, 7:26 p.m. UTC | #1
On Tue, 23 May 2023 23:49:47 -0400, Theodore Ts'o wrote:
> This fixes a number of problems with ea_inode handling which were
> pointed out by syzbot.  The first and third add some additional
> checking for invalid / maliciously fuzzed file systems.  The second
> and fourth patch adds some lockdep annotations to avoid some false
> positive reports from lockdep.
> 
> There is still one remaining syzbot report[1] relating to ea_inodes
> not handled by this patch series, and that is an apparently deadlock
> which happens when a kernel thread is freeing an ea_inode racing with
> another thread which is trying to find the mbcache entry (presumably
> with the intent of reusing it).  The problem is apparently hard to
> reproduce; it's only been hit 4 times, and there is no C reproducer;
> just a syzkaller reproducer.  So we'll leave that for another day/
> 
> [...]

Applied, thanks!

[1/4] ext4: add EA_INODE checking to ext4_iget()
      commit: b3e6bcb94590dea45396b9481e47b809b1be4afa
[2/4] ext4: set lockdep subclass for the ea_inode in ext4_xattr_inode_cache_find()
      commit: d08927b3e89fde1b224d22d2bddcb8dc4fe616db
[3/4] ext4: disallow ea_inodes with extended attributes
      commit: 1e0e51238f151e26ccd0a8bd5f5cf32e85c19ac3
[4/4] ext4: add lockdep annotations for i_data_sem for ea_inode's
      commit: f901459a1f277ed921e255d4c3d54485769f7dbd

Best regards,