From: "Guilherme G. Piccoli" <gpiccoli@igalia.com>
To: Yunlong Xing <yunlong.xing@unisoc.com>,
keescook@chromium.org, tony.luck@intel.com,
joel@joelfernandes.org, enlin.mu@unisoc.com
Cc: linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org,
enlinmu@gmail.com, yunlong.xing23@gmail.com
Subject: Re: [PATCH 1/1] pstore/ram: Check member of buffers during the initialization phase of the pstore
Date: Wed, 2 Aug 2023 12:46:49 -0300 [thread overview]
Message-ID: <f0cc1d69-71a2-e50d-07ea-b17ab26d6cf4@igalia.com> (raw)
In-Reply-To: <20230801060432.1307717-1-yunlong.xing@unisoc.com>
On 01/08/2023 03:04, Yunlong Xing wrote:
> [...]
> diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c
> index 85aaf0fc6d7d..eb6df190d752 100644
> --- a/fs/pstore/ram_core.c
> +++ b/fs/pstore/ram_core.c
> @@ -519,7 +519,7 @@ static int persistent_ram_post_init(struct persistent_ram_zone *prz, u32 sig,
> sig ^= PERSISTENT_RAM_SIG;
>
> if (prz->buffer->sig == sig) {
> - if (buffer_size(prz) == 0) {
> + if (buffer_size(prz) == 0 && buffer_start(prz) == 0) {
> pr_debug("found existing empty buffer\n");
Thanks for the patch! I'd also adjust the above print statement to
reflect the different paths (empty buffers vs illegal one) and maybe
bump it to pr_info, or even pr_warn(_once?).
What do you all think, makes sense or could we pollute dmesg too much?
Cheers!
next prev parent reply other threads:[~2023-08-02 15:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 6:04 Yunlong Xing
2023-08-02 15:46 ` Guilherme G. Piccoli [this message]
2023-08-03 10:43 ` yunlong xing
2023-08-04 8:10 ` Kees Cook
2023-08-04 8:59 ` yunlong xing
2023-08-04 16:53 ` Kees Cook
2023-08-07 1:33 ` yunlong xing
2023-08-04 17:04 ` Kees Cook
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=f0cc1d69-71a2-e50d-07ea-b17ab26d6cf4@igalia.com \
--to=gpiccoli@igalia.com \
--cc=enlin.mu@unisoc.com \
--cc=enlinmu@gmail.com \
--cc=joel@joelfernandes.org \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.com \
--cc=yunlong.xing23@gmail.com \
--cc=yunlong.xing@unisoc.com \
/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®