netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] can: j1939: avoid possible use-after-free when j1939_can_rx_register fails
@ 2023-05-26 17:19 Fedor Pchelkin
  2023-05-26 17:19 ` [PATCH 1/2] can: j1939: change j1939_netdev_lock type to mutex Fedor Pchelkin
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Fedor Pchelkin @ 2023-05-26 17:19 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Fedor Pchelkin, Marc Kleine-Budde, kernel, Robin van der Gracht,
	Oliver Hartkopp, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Kurt Van Dijck, linux-can, netdev, linux-kernel,
	Alexey Khoroshilov, lvc-project

The patch series fixes a possible racy use-after-free scenario described
in 2/2: if j1939_can_rx_register() fails then the concurrent thread may
have already read the invalid priv structure.

The 1/2 makes j1939_netdev_lock a mutex so that access to
j1939_can_rx_register() can be serialized without changing GFP_KERNEL to
GFP_ATOMIC inside can_rx_register(). This seems to be safe.

Note that the patch series has been tested only via Syzkaller and not with
a real device.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-06-05  6:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-26 17:19 [PATCH 0/2] can: j1939: avoid possible use-after-free when j1939_can_rx_register fails Fedor Pchelkin
2023-05-26 17:19 ` [PATCH 1/2] can: j1939: change j1939_netdev_lock type to mutex Fedor Pchelkin
2023-06-02 12:33   ` Oleksij Rempel
2023-05-26 17:19 ` [PATCH 2/2] can: j1939: avoid possible use-after-free when j1939_can_rx_register fails Fedor Pchelkin
2023-05-26 18:15   ` Oleksij Rempel
2023-05-26 18:50     ` Fedor Pchelkin
2023-05-27  5:57       ` Oleksij Rempel
2023-05-27 10:05         ` Fedor Pchelkin
2023-06-02 12:35   ` Oleksij Rempel
2023-06-02 16:06     ` Fedor Pchelkin
2023-06-05  6:37 ` [PATCH 0/2] " Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).