lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ce5a57c7b00bbd77d7ad6c23f0dcc55f99c3d1a.camel@ibm.com>
Date: Mon, 30 Jun 2025 17:18:19 +0000
From: Viacheslav Dubeyko <Slava.Dubeyko@....com>
To: "glaubitz@...sik.fu-berlin.de" <glaubitz@...sik.fu-berlin.de>,
        "frank.li@...o.com" <frank.li@...o.com>,
        "penguin-kernel@...ove.SAKURA.ne.jp"
	<penguin-kernel@...ove.SAKURA.ne.jp>,
        "slava@...eyko.com"
	<slava@...eyko.com>,
        "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] hfsplus: don't use BUG_ON() in
 hfsplus_create_attributes_file()

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@...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..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?

> +	if (i_size_read(attr_file) != 0) {
> +		err = -EIO;
> +		pr_err("failed to load attributes file\n");
> +		goto end_attr_file_creation;
> +	}
>  
>  	hip = HFSPLUS_I(attr_file);
>  

Makes sense to me. Looks good.

Reviewed-by: Viacheslav Dubeyko <slava@...eyko.com>

Thanks,
Slava.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ