Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH net v3 0/3] nfc: fix LLCP, nfcsim, and digital teardown ordering races
@ 2026-12-06 10:52 Bin Luo via B4 Relay
  2026-12-06 10:52 ` [PATCH net v3 1/3] nfc: llcp: fix work and timer teardown order in local_cleanup() Bin Luo via B4 Relay
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Bin Luo via B4 Relay @ 2026-12-06 10:52 UTC (permalink / raw)
  To: David Heidelberg, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman
  Cc: Krzysztof Kozlowski, oe-linux-nfc, netdev, linux-kernel, stable

This 3-patch series fixes teardown ordering use-after-free and
work/timer re-arming bugs across NFC LLCP, nfcsim, and the NFC Digital
core:

1. Patch 1 reorders local_cleanup() in net/nfc/llcp_core.c using
   disable_work_sync() and timer_shutdown_sync() in producer-to-consumer
   order and purges tx_queue after tx_work is disabled.
2. Patch 2 stops link_in and permanently disables send_work/recv_work in
   nfcsim_device_free() before nfc_digital_unregister_device() drains
   ddev->cmd_queue, keeps dev->up = false after unregister so in-flight
   commands are not silently dropped without cmd_cb(), and wakes
   nfcsim_link_recv_skb() on link->shutdown to prevent teardown stalls.
3. Patch 3 reorders nfc_digital_unregister_device() to stop works and
   drain cmd_queue (freeing orphaned cmd->req/cmd->resp skbs) before
   nfc_remove_device() tears down LLCP.

Changes in v3:
- Address all Sashiko AI review comments: keep dev->up = false after
  nfc_digital_unregister_device() and wake nfcsim_link_recv_skb() on
  link->shutdown (Patch 2 Medium x2), free orphaned cmd->req and
  cmd->resp skbs in the digital drain loop (Patch 3 Medium), fix Fixes
  tags and commit descriptions (Low), and normalize From:/Signed-off-by:
  author metadata (Low).

Bin Luo (3):
  nfc: llcp: fix work and timer teardown order in local_cleanup()
  nfc: nfcsim: stop link and works before unregistering digital device
  nfc: digital: stop works and drain commands before nfc_remove_device()

 drivers/nfc/nfcsim.c   | 23 ++++++++++++-----------
 net/nfc/digital_core.c | 15 +++++++++++----
 net/nfc/llcp_core.c    | 12 ++++++------
 3 files changed, 29 insertions(+), 21 deletions(-)

-- 
2.43.0




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

end of thread, other threads:[~2026-12-06 11:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-06 10:52 [PATCH net v3 0/3] nfc: fix LLCP, nfcsim, and digital teardown ordering races Bin Luo via B4 Relay
2026-12-06 10:52 ` [PATCH net v3 1/3] nfc: llcp: fix work and timer teardown order in local_cleanup() Bin Luo via B4 Relay
2026-12-06 10:52 ` [PATCH net v3 3/3] nfc: digital: stop works and drain commands before nfc_remove_device() Bin Luo via B4 Relay
2026-12-06 10:52 ` [PATCH net v3 2/3] nfc: nfcsim: stop link and works before unregistering digital device Bin Luo via B4 Relay
2026-12-06 10:57 ` [PATCH net v3 0/3] nfc: fix LLCP, nfcsim, and digital teardown ordering races netdev-bot+sinfo
2026-12-06 11:04   ` bin luo

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