Re: [PATCH v1] can: j1939: Fix UAF in j1939_sk_match_filter during setsockopt(SO_J1939_FILTER)

From: Oleksij Rempel
Date: Thu Sep 28 2023 - 03:38:38 EST


On Wed, Sep 27, 2023 at 06:14:56PM +0200, Oleksij Rempel wrote:
> Lock jsk->sk to prevent UAF when setsockopt(..., SO_J1939_FILTER, ...)
> modifies jsk->filters while receiving packets.

...

> Fixes: 9d71dd0c70099 ("can: add support of SAE J1939 protocol")
> Reported-by: Sili Luo <rootlab@xxxxxxxxxx>
> Suggested-by: Sili Luo <rootlab@xxxxxxxxxx>
> Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
> Acked-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx

Tested-by: Sili Luo <rootlab@xxxxxxxxxx>

--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |