[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF3JpA6RwyzQMdG4y3P_8jkaS8qUFPerE5MJ8Xecs+VkbPEmpg@mail.gmail.com>
Date: Thu, 17 Jul 2025 09:59:13 -0700
From: Moon Hee Lee <moonhee.lee.ca@...il.com>
To: "Theodore Ts'o" <tytso@....edu>
Cc: syzbot+544248a761451c0df72f@...kaller.appspotmail.com,
adilger.kernel@...ger.ca, linux-ext4@...r.kernel.org,
linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com
Subject: Re: [PATCH] ext4: do not BUG when INLINE_DATA_FL lacks system.data xattr
>
> Thanks ofor the patch! However, instead of doing an xattr lookup in
> ext4_prepare_inline_data(), we can more simply and more efficiently
> just not BUG in ext4_update_inline_data, like this:
Thanks for the response and for taking the time to address the issue.
Just to clarify the intent behind the earlier patch [1]: it was meant to
catch the missing system.data xattr early in ext4_prepare_inline_data(),
before branching into paths that assume the xattr is present.
> @@ -354,6 +354,12 @@ static int ext4_update_inline_data(handle_t *handle, struct inode *inode,
> if (error)
> goto out;
>
> + if (is.s.not_found) {
> + EXT4_ERROR_INODE(inode, "missing inline data xattr");
> + error = -EFSCORRUPTED;
> + goto out;
> + }
> +
> BUG_ON(is.s.not_found);
The current patch addresses ext4_update_inline_data() directly, but the
same condition also leads to a BUG_ON in ext4_create_inline_data() [2],
which the earlier approach intended to prevent as well.
Later, a third instance was found in ext4_inline_data_truncate() [3],
which also contains a similar BUG_ON and might need the same kind of
check.
Reducing duplicated checks across these sites would be beneficial, though
fixing each case directly also looks reasonable and straightforward.
[1] https://lore.kernel.org/all/20250710175837.29822-2-moonhee.lee.ca@gmail.com/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/ext4/inline.c?h=v6.16-rc6#n306
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/ext4/inline.c?h=v6.16-rc6#n1906
Powered by blists - more mailing lists