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] [day] [month] [year] [list]
Message-ID: <Y1Jct+8SnhawtIqJ@B-P7TQMD6M-0146.local>
Date:   Fri, 21 Oct 2022 16:47:51 +0800
From:   Gao Xiang <hsiangkao@...ux.alibaba.com>
To:     Yue Hu <zbestahu@...il.com>
Cc:     xiang@...nel.org, chao@...nel.org, linux-erofs@...ts.ozlabs.org,
        linux-kernel@...r.kernel.org,
        syzbot+3faecbfd845a895c04cb@...kaller.appspotmail.com,
        syzkaller-bugs@...glegroups.com, zhangwen@...lpad.com,
        Yue Hu <huyue2@...lpad.com>
Subject: Re: [PATCH] erofs: fix general protection fault when reading fragment

On Fri, Oct 21, 2022 at 04:31:16PM +0800, Yue Hu wrote:
> From: Yue Hu <huyue2@...lpad.com>
> 
> As syzbot reported [1], the fragment feature sb flag is not set, so
> packed_inode != NULL needs to be checked in z_erofs_read_fragment().
> 
> [1] https://lore.kernel.org/all/0000000000002e7a8905eb841ddd@google.com/
> 
> Reported-by: syzbot+3faecbfd845a895c04cb@...kaller.appspotmail.com
> Fixes: 08a0c9ef3e7e ("erofs: support on-disk compressed fragments data")
> Signed-off-by: Yue Hu <huyue2@...lpad.com>
> ---
>  fs/erofs/zdata.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
> index cce56dde135c..310f6916787a 100644
> --- a/fs/erofs/zdata.c
> +++ b/fs/erofs/zdata.c
> @@ -659,6 +659,9 @@ static int z_erofs_read_fragment(struct inode *inode, erofs_off_t pos,
>  	u8 *src, *dst;
>  	unsigned int i, cnt;
>  
> +	if (!packed_inode)
> +		return -EFAULT;

You should use -EFSCURRUPTED; here.

Thanks,
Gao Xiang

> +
>  	pos += EROFS_I(inode)->z_fragmentoff;
>  	for (i = 0; i < len; i += cnt) {
>  		cnt = min_t(unsigned int, len - i,
> -- 
> 2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ