From: Yangtao Li <frank.li@vivo.com>
To: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>,
"glaubitz@physik.fu-berlin.de" <glaubitz@physik.fu-berlin.de>,
"penguin-kernel@I-love.SAKURA.ne.jp"
<penguin-kernel@I-love.SAKURA.ne.jp>,
"slava@dubeyko.com" <slava@dubeyko.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] hfsplus: don't use BUG_ON() in hfsplus_create_attributes_file()
Date: Mon, 7 Jul 2025 22:22:44 +0800 [thread overview]
Message-ID: <72c9d0c2-773c-4508-9d2d-e24703ff26e1@vivo.com> (raw)
In-Reply-To: <4ce5a57c7b00bbd77d7ad6c23f0dcc55f99c3d1a.camel@ibm.com>
在 2025/7/1 01:18, Viacheslav Dubeyko 写道:
> On Wed, 2025-06-25 at 19:10 +0900, Tetsuo Handa wrote:
>> syzkaller can mount crafted filesystem images.
>> Don't crash the kernel when we can continue.
>>
>> Reported-by: syzbot <syzbot+1107451c16b9eb9d29e6@syzkaller.appspotmail.com>
>> Closes: https://syzkaller.appspot.com/bug?extid=1107451c16b9eb9d29e6
>> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
>> ---
>> fs/hfsplus/xattr.c | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/hfsplus/xattr.c b/fs/hfsplus/xattr.c
>> index 9a1a93e3888b..191767d4cf78 100644
>> --- a/fs/hfsplus/xattr.c
>> +++ b/fs/hfsplus/xattr.c
>> @@ -172,7 +172,11 @@ static int hfsplus_create_attributes_file(struct super_block *sb)
>> return PTR_ERR(attr_file);
>> }
>>
>> - BUG_ON(i_size_read(attr_file) != 0);
>
> So, it's something like unexpected situation here. Why do we have
> i_size_read(attr_file) != 0 here? It looks like hfsplus_create_attributes_file()
> was called in incorrect context. Probably, it's not the whole fix. Any ideas?
161 case HFSPLUS_VALID_ATTR_TREE:
162 return 0;
163 case HFSPLUS_FAILED_ATTR_TREE:
164 return -EOPNOTSUPP;
165 default:
166 BUG();
167 }
I haven't delved into the implementation details of xattr yet, but there
is a bug in this function. It seems that we should convert the bug to
return EIO in another patch?
Otherwise LGTM.
Reviewed-by: Yangtao Li <frank.li@vivo.com>
Thx,
Yangtao
next prev parent reply other threads:[~2025-07-07 14:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-25 10:10 Tetsuo Handa
2025-06-30 17:18 ` Viacheslav Dubeyko
2025-07-07 14:22 ` Yangtao Li [this message]
2025-07-07 14:45 ` Tetsuo Handa
2025-07-07 19:03 ` Viacheslav Dubeyko
2025-07-09 14:02 ` Tetsuo Handa
2025-07-09 18:33 ` Viacheslav Dubeyko
2025-07-09 22:03 ` Tetsuo Handa
2025-07-11 11:35 ` Tetsuo Handa
2025-07-11 17:21 ` Viacheslav Dubeyko
2025-07-12 11:22 ` Tetsuo Handa
2025-07-14 23:30 ` Viacheslav Dubeyko
2025-07-15 5:17 ` [PATCH v2] " Tetsuo Handa
2025-07-15 18:49 ` Viacheslav Dubeyko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=72c9d0c2-773c-4508-9d2d-e24703ff26e1@vivo.com \
--to=frank.li@vivo.com \
--cc=Slava.Dubeyko@ibm.com \
--cc=akpm@linux-foundation.org \
--cc=glaubitz@physik.fu-berlin.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=slava@dubeyko.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®