[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <261429818.1734406.1700149679974@eu1.myprofessionalmail.com>
Date: Thu, 16 Nov 2023 15:47:59 +0000 (GMT)
From: Phillip Lougher <phillip@...ashfs.org.uk>
To: Lizhi Xu <lizhi.xu@...driver.com>,
syzbot+32d3767580a1ea339a81@...kaller.appspotmail.com,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
squashfs-devel@...ts.sourceforge.net,
syzkaller-bugs@...glegroups.com
Subject: Re: [PATCH] squashfs: squashfs_read_data need to check if the
length is 0
> On 16/11/2023 03:13 GMT Lizhi Xu <lizhi.xu@...driver.com> wrote:
>
>
> when the length passed in is 0, the subsequent process should be exited.
>
Reproduced and tested.
Reviewed-by: Phillip Lougher (phillip@...ashfs.org.uk)
> Reported-by: syzbot+32d3767580a1ea339a81@...kaller.appspotmail.com
> Signed-off-by: Lizhi Xu <lizhi.xu@...driver.com>
> ---
> fs/squashfs/block.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/squashfs/block.c b/fs/squashfs/block.c
> index 581ce9519339..2dc730800f44 100644
> --- a/fs/squashfs/block.c
> +++ b/fs/squashfs/block.c
> @@ -321,7 +321,7 @@ int squashfs_read_data(struct super_block *sb, u64 index, int length,
> TRACE("Block @ 0x%llx, %scompressed size %d\n", index - 2,
> compressed ? "" : "un", length);
> }
> - if (length < 0 || length > output->length ||
> + if (length <= 0 || length > output->length ||
> (index + length) > msblk->bytes_used) {
> res = -EIO;
> goto out;
> --
> 2.25.1
Powered by blists - more mailing lists