From: Lukas Wunner <lukas@wunner.de>
To: Marc Kleine-Budde <mkl@pengutronix.de>, Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de,
Stefan Wahren <stefan.wahren@i2se.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Jens Lindahl <jensctl@gmail.com>
Subject: Re: [PATCH] spi: bcm2835: bcm2835_spi_handle_err(): fix NULL pointer deref for non DMA transfers
Date: Tue, 19 Jul 2022 09:47:01 +0200 [thread overview]
Message-ID: <20220719074701.GA26268@wunner.de> (raw)
In-Reply-To: <20220719072234.2782764-1-mkl@pengutronix.de>
[+cc Jens, Florian, Stefan, Mark]
On Tue, Jul 19, 2022 at 09:22:35AM +0200, Marc Kleine-Budde wrote:
> In case a IRQ based transfer times out the bcm2835_spi_handle_err()
> function is called. Since commit 1513ceee70f2 ("spi: bcm2835: Drop
> dma_pending flag") the TX and RX DMA transfers are unconditionally
> canceled, leading to NULL pointer derefs if ctlr->dma_tx or
> ctlr->dma_rx are not set.
>
> Fix the NULL pointer deref by checking that ctlr->dma_tx and
> ctlr->dma_rx are valid pointers before accessing them.
>
> Fixes: 1513ceee70f2 ("spi: bcm2835: Drop dma_pending flag")
> Cc: Lukas Wunner <lukas@wunner.de>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Link: https://lore.kernel.org/linux-spi/20220603142340.42271-1-jensctl@gmail.com/
next prev parent reply other threads:[~2022-07-19 7:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-19 7:22 [PATCH] spi: bcm2835: bcm2835_spi_handle_err(): fix NULL pointer deref for non DMA transfers Marc Kleine-Budde
2022-07-19 7:47 ` Lukas Wunner [this message]
2022-07-19 7:55 ` Marc Kleine-Budde
2022-07-20 11:48 ` Mark Brown
2022-07-19 10:33 ` Mark Brown
2022-07-20 17:45 ` Mark Brown
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=20220719074701.GA26268@wunner.de \
--to=lukas@wunner.de \
--cc=broonie@kernel.org \
--cc=f.fainelli@gmail.com \
--cc=jensctl@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-spi@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=stefan.wahren@i2se.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