mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: 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 17:27:13 +0800	[thread overview]
Message-ID: <c2a0cb7c-3858-4872-9d11-f620df03d476@linux.alibaba.com> (raw)
In-Reply-To: <8481ec6f-9f8a-4f76-8ab7-b45e38cc8d40@vivo.com>

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?

Thanks,
Gao Xiang

> 
> Thanks,
> 
> Chunhai Guo
> 

  reply	other threads:[~2024-08-20  9:27 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 [this message]
2024-08-20  9:31       ` Chunhai Guo
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=c2a0cb7c-3858-4872-9d11-f620df03d476@linux.alibaba.com \
    --to=hsiangkao@linux.alibaba.com \
    --cc=guochunhai@vivo.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®