diff options
| author | Breno Leitao <leitao@debian.org> | 2026-05-21 07:32:10 -0700 |
|---|---|---|
| committer | David Heidelberg <david@ixit.cz> | 2026-08-11 18:10:02 +0200 |
| commit | 36812527052c5bfb1ec6c1e292d67a5bf76b750f (patch) | |
| tree | f75362b41450d7d373325d10addf5985e389a496 /tools/perf/scripts/python/export-to-sqlite.py | |
| parent | 99985bfa8336fadcc69190ba2dcbd5386af3d661 (diff) | |
nfc: llcp: read llcp_sock->local under the socket lock in getsockopt
nfc_llcp_getsockopt() read llcp_sock->local before lock_sock(sk) and
then dereferenced the cached pointer inside the locked region.
llcp_sock_bind() assigns and clears llcp_sock->local under the same
socket lock, dropping the last reference on its error path. A
getsockopt() racing an in-flight bind() can observe the pointer, block
on lock_sock(), and then dereference a freed nfc_llcp_local once bind()
has unwound.
Move the llcp_sock->local read and the NULL check inside the
lock_sock(sk) region so bind() cannot mutate or free the pointer between
the load and the use.
Fixes: 26fd76cab2e6 ("NFC: llcp: Implement socket options")
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260521-fix_llc-v2-2-ab44cc09179c@debian.org
Signed-off-by: David Heidelberg <david@ixit.cz>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions
