public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] net/smc: fix potential UAF in smc_pnet_add_ib
@ 2026-03-25 11:03 Li Xiasong
  2026-03-25 11:03 ` [PATCH net 1/2] net/smc: fix potential UAF in smc_pnet_add_ib for ib device Li Xiasong
  2026-03-25 11:03 ` [PATCH net 2/2] net/smc: fix potential UAF in smc_pnet_add_ib for smcd device Li Xiasong
  0 siblings, 2 replies; 5+ messages in thread
From: Li Xiasong @ 2026-03-25 11:03 UTC (permalink / raw)
  To: D. Wythe, Dust Li, Sidraya Jayagond, Wenjia Zhang,
	Mahanta Jambigi, Tony Lu, Wen Gu, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman
  Cc: linux-rdma, linux-s390, netdev, linux-kernel, yuehaibing,
	zhangchangzhong, weiyongjun1

This series fixes potential use-after-free issues in smc_pnet_add_ib()
where the device pointer could be freed between find and apply operations.

The race occurs because smc_pnet_find_ib() and smc_pnet_find_smcd()
release the mutex before returning the device pointer. If the device is
removed (e.g., via smc_ib_remove_dev() or smcd_unregister_dev()) before
smc_pnet_apply_ib() or smc_pnet_apply_smcd() is called, the freed
pointer will be accessed.

Patch 1 fixes the issue for ib device, and patch 2 fixes the same issue
for smcd device.

Li Xiasong (2):
  net/smc: fix potential UAF in smc_pnet_add_ib for ib device
  net/smc: fix potential UAF in smc_pnet_add_ib for smcd device

 net/smc/smc_pnet.c | 121 ++++++++++++++++++++++++++++-----------------
 1 file changed, 75 insertions(+), 46 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2026-03-29 20:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-25 11:03 [PATCH net 0/2] net/smc: fix potential UAF in smc_pnet_add_ib Li Xiasong
2026-03-25 11:03 ` [PATCH net 1/2] net/smc: fix potential UAF in smc_pnet_add_ib for ib device Li Xiasong
2026-03-29 20:35   ` Jakub Kicinski
2026-03-25 11:03 ` [PATCH net 2/2] net/smc: fix potential UAF in smc_pnet_add_ib for smcd device Li Xiasong
2026-03-29 20:35   ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox