Re: [PATCH net v2 2/2] nfc: rawsock: move nfc_deactivate_target() to rawsock_release()
From: bin luo
Date: Sun Dec 06 2026 - 05:50:25 EST
Thank you for the thorough review.
All of the reported issues are legitimate and I will address them in v3:
1. In Patch 2/2 (Critical): moving nfc_deactivate_target() into
rawsock_release() without waiting for an already-submitted in-flight
nfc_data_exchange() opens a race with driver completion paths such as
pn533_data_exchange_complete() on dev->resp_q. In v3, I will ensure
deactivation only runs after any in-flight data exchange completes
(and never synchronously from ndev->rx_wq).
2. In Patch 1/2 (Medium): setting sk->sk_err after
__rawsock_write_queue_purge() can wake writers via sock_wfree() before
sk_err is visible. I will set WRITE_ONCE(sk->sk_err, -err) before
acquiring sk_write_queue.lock and keep sk_error_report() after
unlocking.
3. I will also remove the inaccurate rawsock_release() mention from the
race 2 description, update the second Fixes tag to 23b7869c0fd0, and
fix the From:/Signed-off-by: author metadata in v3.
4. Regarding the pre-existing lockless dev/state race in rawsock_sendmsg(),
I will address it in a separate follow-up patch so this series stays
focused on the teardown fixes.
pw-bot: cr