[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d27ab621d904eda6f10fb3fdd280feb0f04e3afb.camel@ibm.com>
Date: Tue, 15 Jul 2025 18:49:35 +0000
From: Viacheslav Dubeyko <Slava.Dubeyko@....com>
To: "frank.li@...o.com" <frank.li@...o.com>,
"glaubitz@...sik.fu-berlin.de"
<glaubitz@...sik.fu-berlin.de>,
"penguin-kernel@...ove.SAKURA.ne.jp"
<penguin-kernel@...ove.SAKURA.ne.jp>,
"slava@...eyko.com"
<slava@...eyko.com>,
"brauner@...nel.org" <brauner@...nel.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
CC: "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] hfsplus: don't use BUG_ON() in
hfsplus_create_attributes_file()
On Tue, 2025-07-15 at 14:17 +0900, Tetsuo Handa wrote:
> When the volume header contains erroneous values that do not reflect
> the actual state of the filesystem, hfsplus_fill_super() assumes that
> the attributes file is not yet created, which later results in hitting
> BUG_ON() when hfsplus_create_attributes_file() is called. Replace this
> BUG_ON() with -EIO error with a message to suggest running fsck tool.
>
> Reported-by: syzbot <syzbot+1107451c16b9eb9d29e6@...kaller.appspotmail.com>
> Closes: https://syzkaller.appspot.com/bug?extid=1107451c16b9eb9d29e6
> Signed-off-by: Tetsuo Handa <penguin-kernel@...ove.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..18dc3d254d21 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);
> + if (i_size_read(attr_file) != 0) {
> + err = -EIO;
> + pr_err("detected inconsistent attributes file, running fsck.hfsplus is recommended.\n");
> + goto end_attr_file_creation;
> + }
>
> hip = HFSPLUS_I(attr_file);
>
Looks good!
Reviewed-by: Viacheslav Dubeyko <slava@...eyko.com>
Thanks,
Slava.
Powered by blists - more mailing lists