android_kernel_motorola_sm6375/net/nfc
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Junxi Qian d3d47118ab
UPSTREAM: nfc: llcp: add missing return after LLCP_CLOSED checks
In nfc_llcp_recv_hdlc() and nfc_llcp_recv_disc(), when the socket
state is LLCP_CLOSED, the code correctly calls release_sock() and
nfc_llcp_sock_put() but fails to return. Execution falls through to
the remainder of the function, which calls release_sock() and
nfc_llcp_sock_put() again. This results in a double release_sock()
and a refcount underflow via double nfc_llcp_sock_put(), leading to
a use-after-free.

Add the missing return statements after the LLCP_CLOSED branches
in both functions to prevent the fall-through.

Bug: 499350302
Fixes: d646960f79 ("NFC: Initial LLCP support")
Signed-off-by: Junxi Qian <qjx1298677004@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260408081006.3723-1-qjx1298677004@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 2b5dd4632966c39da6ba74dbc8689b309065e82c)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I041f20fc1fea32f715d2646579fab071e58688d8
2026-09-09 00:38:21 +03:00
..
hci BACKPORT: net: Fix Kconfig indentation, continued 2026-02-01 20:39:45 -08:00
nci NFC: nci: uart: Set tty->disc_data only in success path 2025-06-27 11:02:51 +01:00
af_nfc.c
core.c
digital.h
digital_core.c
digital_dep.c
digital_technology.c
Kconfig
llcp.h net: nfc: Fix use-after-free caused by nfc_llcp_find_local 2023-07-27 08:37:11 +02:00
llcp_commands.c net: nfc: Fix use-after-free caused by nfc_llcp_find_local 2023-07-27 08:37:11 +02:00
llcp_core.c UPSTREAM: nfc: llcp: add missing return after LLCP_CLOSED checks 2026-09-09 00:38:21 +03:00
llcp_sock.c net: nfc: Fix use-after-free caused by nfc_llcp_find_local 2023-07-27 08:37:11 +02:00
Makefile
netlink.c net: nfc: Fix use-after-free caused by nfc_llcp_find_local 2023-07-27 08:37:11 +02:00
nfc.h net: nfc: Fix use-after-free caused by nfc_llcp_find_local 2023-07-27 08:37:11 +02:00
rawsock.c