The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH net v2 0/2] nfc: rawsock: fix write-queue race and sk_destruct deadlock
@ 2026-12-04  6:06 Bin Luo via B4 Relay
  2026-12-04  6:06 ` [PATCH net v2 1/2] nfc: rawsock: serialize SEND_SHUTDOWN and write queue teardown Bin Luo via B4 Relay
  2026-12-04  6:06 ` [PATCH net v2 2/2] nfc: rawsock: move nfc_deactivate_target() to rawsock_release() Bin Luo via B4 Relay
  0 siblings, 2 replies; 3+ messages in thread
From: Bin Luo via B4 Relay @ 2026-12-04  6:06 UTC (permalink / raw)
  To: David Heidelberg, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman
  Cc: oe-linux-nfc, netdev, linux-kernel

This series fixes two teardown issues in net/nfc/rawsock.c:

1. Patch 1/2 serializes SEND_SHUTDOWN updates/checks, sk_write_queue
   purging, and tx_work scheduling under sk->sk_write_queue.lock,
   closing the residual window left after commit d793458c45df ("nfc:
   rawsock: cancel tx_work before socket teardown") where an in-flight
   completion could re-queue tx_work during release, and guarding
   against NULL skb dereference in rawsock_tx_work().

2. Patch 2/2 moves nfc_deactivate_target() out of rawsock_destruct()
   into rawsock_release() (process context), preventing a 30-second
   self-deadlock on ndev->rx_wq when rawsock_data_exchange_complete()
   drops the final socket reference from nci_rx_work().

Changes in v2:
- Resend via b4 web relay (v1 had broken diff lines from Gmail wrapping)
  and send both dependent rawsock patches together as a threaded series.

Both patches were regression-tested in QEMU KVM with KASAN, LOCKDEP,
and DEBUG_OBJECTS enabled using virtual_ncidev across 3 x 200
iterations with zero timeouts or warnings, and passed
tools/testing/selftests/nci/nci_dev (8/8).

Bin Luo (University of Electronic Science and Technology of China) (2):
  nfc: rawsock: serialize SEND_SHUTDOWN and write queue teardown
  nfc: rawsock: move nfc_deactivate_target() to rawsock_release()

 net/nfc/rawsock.c | 54 +++++++++++++++++++++++++++++++++++-------------------
 1 file changed, 35 insertions(+), 19 deletions(-)
-- 
2.43.0



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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04  6:06 [PATCH net v2 0/2] nfc: rawsock: fix write-queue race and sk_destruct deadlock Bin Luo via B4 Relay
2026-12-04  6:06 ` [PATCH net v2 1/2] nfc: rawsock: serialize SEND_SHUTDOWN and write queue teardown Bin Luo via B4 Relay
2026-12-04  6:06 ` [PATCH net v2 2/2] nfc: rawsock: move nfc_deactivate_target() to rawsock_release() Bin Luo via B4 Relay

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