From: Chunhai Guo <guochunhai@vivo.com>
To: Gao Xiang <hsiangkao@linux.alibaba.com>,
Chunhai Guo <guochunhai@vivo.com>,
"linux-erofs@lists.ozlabs.org" <linux-erofs@lists.ozlabs.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH] erofs: fix out-of-bound access when z_erofs_gbuf_growsize() partially fails
Date: Tue, 20 Aug 2024 09:31:08 +0000 [thread overview]
Message-ID: <b7daa5d2-438b-4c8e-afce-968e3d20f95f@vivo.com> (raw)
In-Reply-To: <c2a0cb7c-3858-4872-9d11-f620df03d476@linux.alibaba.com>
在 2024/8/20 17:27, Gao Xiang 写道:
> Hi Chunhai,
>
> On 2024/8/20 17:25, Chunhai Guo wrote:
>> 在 2024/8/20 16:42, Gao Xiang 写道:
>>> If z_erofs_gbuf_growsize() partially fails on a global buffer due to
>>> memory allocation failure or fault injection (as reported by syzbot
>>> [1]),
>>> new pages need to be freed by comparing to the existing pages to avoid
>>> memory leaks.
>>>
>>> However, the old gbuf->pages[] array may not be large enough, which can
>>> lead to null-ptr-deref or out-of-bound access.
>>>
>>> Fix this by checking against gbuf->nrpages in advance.
>>>
>>> Fixes: d6db47e571dc ("erofs: do not use pagepool in
>>> z_erofs_gbuf_growsize()")
>>> Cc: <stable@vger.kernel.org> # 6.10+
>>> Cc: Chunhai Guo <guochunhai@vivo.com>
>>> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
>>>
>> Reviewed-by: Chunhai Guo <guochunhai@vivo.com>
>
> I've sent a patch to add links and reported-by.
>
> I assume I can add your reviewed-by to that version too?
Yes. That is right.
Thanks,
>
> Thanks,
> Gao Xiang
>
>>
>> Thanks,
>>
>> Chunhai Guo
>>
next prev parent reply other threads:[~2024-08-20 9:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-20 7:57 [syzbot] [erofs?] general protection fault in z_erofs_gbuf_growsize syzbot
2024-08-20 8:42 ` [PATCH] erofs: fix out-of-bound access when z_erofs_gbuf_growsize() partially fails Gao Xiang
2024-08-20 9:25 ` Chunhai Guo
2024-08-20 9:27 ` Gao Xiang
2024-08-20 9:31 ` Chunhai Guo [this message]
2024-08-20 8:56 ` [PATCH RESEND] " Gao Xiang
2024-08-20 18:14 ` Sandeep Dhavale
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=b7daa5d2-438b-4c8e-afce-968e3d20f95f@vivo.com \
--to=guochunhai@vivo.com \
--cc=hsiangkao@linux.alibaba.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/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®