[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241126-saffron-angelfish-of-unity-31108e-mkl@pengutronix.de>
Date: Tue, 26 Nov 2024 10:48:41 +0100
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Dario Binacchi <dario.binacchi@...rulasolutions.com>
Cc: linux-kernel@...r.kernel.org, linux-amarula@...rulasolutions.com,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>, Vincent Mailhol <mailhol.vincent@...adoo.fr>,
linux-can@...r.kernel.org
Subject: Re: [PATCH v2 04/12] can: hi311x: fix txerr and rxerr reporting
On 22.11.2024 23:15:45, Dario Binacchi wrote:
> The commit a22bd630cfff ("can: hi311x: do not report txerr and rxerr
> during bus-off") removed the reporting of rxerr and txerr even in case
> of correct operation (i. e. not bus-off). The CAN frame is unnecessarily
> set since netif_rx() has already been called. The patch fixes the issue
> by postponing the netif_rx() call in case of txerr and rxerr reporting.
re-phrased to:
can: hi311x: hi3110_can_ist(): fix potential use-after-free
The commit a22bd630cfff ("can: hi311x: do not report txerr and rxerr
during bus-off") removed the reporting of rxerr and txerr even in case
of correct operation (i. e. not bus-off).
The error count information added to the CAN frame after netif_rx() is
a potential use after free, since there is no guarantee that the skb
is in the same state. It might be freed or reused.
Fix the issue by postponing the netif_rx() call in case of txerr and
rxerr reporting.
> Fixes: a22bd630cfff ("can: hi311x: do not report txerr and rxerr during bus-off")
> Signed-off-by: Dario Binacchi <dario.binacchi@...rulasolutions.com>
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists