[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f0cc1d69-71a2-e50d-07ea-b17ab26d6cf4@igalia.com>
Date: Wed, 2 Aug 2023 12:46:49 -0300
From: "Guilherme G. Piccoli" <gpiccoli@...lia.com>
To: Yunlong Xing <yunlong.xing@...soc.com>, keescook@...omium.org,
tony.luck@...el.com, joel@...lfernandes.org, enlin.mu@...soc.com
Cc: linux-hardening@...r.kernel.org, linux-kernel@...r.kernel.org,
enlinmu@...il.com, yunlong.xing23@...il.com
Subject: Re: [PATCH 1/1] pstore/ram: Check member of buffers during the
initialization phase of the pstore
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!
Powered by blists - more mailing lists