From: Pavel Skripkin <paskripkin@gmail.com>
To: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>,
gregkh@linuxfoundation.org, realwakka@gmail.com
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: pi433: prevent uninitialized data from being printed out
Date: Sat, 26 Feb 2022 16:08:48 +0300 [thread overview]
Message-ID: <593b1840-aba1-3fcb-daef-9cc0011d0805@gmail.com> (raw)
In-Reply-To: <Yhmruyr2BUn0+3O3@mail.google.com>
Hi Paulo Miguel,
On 2/26/22 07:25, Paulo Miguel Almeida wrote:
> local_buffer is not initialised before data is passed to
> spi_sync_transfer. In case spi* function fails then the dev_dbg
> statement after that can potentially print out uninitialised data
>
> this patch initialises local_buffer array.
>
> Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
I think, it should have a Fixes: tag.
> ---
> Meta-comments:
>
> - this change was requested by Dan Carpenter in a different thread:
> https://lore.kernel.org/lkml/20220207100601.GF1951@kadam/
>
Worth mentioning Dan with Reported-by/Suggested-by: :)
> Patch dependency:
>
> - this patch depends on the following patch to be applied first as
> both of them change the same file:
> https://lore.kernel.org/lkml/Yhla4a1Clpguoo2h@mail.google.com/
> ---
You can send all these patches as a patch series with proper order. It
will help maintainers to not break the order while applying.
> drivers/staging/pi433/rf69.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
> index e5b23ab39c69..3028018f0b45 100644
> --- a/drivers/staging/pi433/rf69.c
> +++ b/drivers/staging/pi433/rf69.c
> @@ -782,7 +782,7 @@ int rf69_read_fifo(struct spi_device *spi, u8 *buffer, unsigned int size)
> {
> int i;
> struct spi_transfer transfer;
> - u8 local_buffer[FIFO_SIZE + 1];
> + u8 local_buffer[FIFO_SIZE + 1] = {};
> int retval;
>
> if (size > FIFO_SIZE) {
With regards,
Pavel Skripkin
next prev parent reply other threads:[~2022-02-26 13:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-26 4:25 [PATCH] staging: pi433: prevent uninitialized data from being printed out Paulo Miguel Almeida
2022-02-26 13:08 ` Pavel Skripkin [this message]
2022-02-28 6:44 ` Dan Carpenter
2022-03-02 9:02 ` Paulo Miguel Almeida
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=593b1840-aba1-3fcb-daef-9cc0011d0805@gmail.com \
--to=paskripkin@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=paulo.miguel.almeida.rodenas@gmail.com \
--cc=realwakka@gmail.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