Re: [PATCH net] nfc: llcp: check socket state after locking in nfc_llcp_recv_dm()

From: David Heidelberg

Date: Fri Sep 25 2026 - 11:32:16 EST


On 25/09/2026 04:35, Aldo Ariel Panzardo wrote:
Between nfc_llcp_connecting_sock_get() and lock_sock(), another
thread can move the socket from connecting_sockets to sockets via
a failed connect + re-bind. After lock_sock(), the socket may no
longer be in LLCP_CONNECTING state, so unconditionally unlinking
from connecting_sockets corrupts the wrong list.

Add a state check after acquiring the socket lock: only unlink
from connecting_sockets if the socket is still LLCP_CONNECTING.

Fixes: bf1460acdf8c ("nfc: llcp: Fix list corruption / refcount desync in nfc_llcp_recv_dm()")
Cc: stable@xxxxxxxxxxxxxxx
Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
Signed-off-by: Aldo Ariel Panzardo <qwe.aldo@xxxxxxxxx>
---
Thank you for your patch, but please never send new version OR another patches as follow up to existing thread.

Please read: https://docs.kernel.org/process/submitting-patches.html

Thank you
David