nfc: llcp: fix slab-out-of-bounds reads when logging service names
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ d9b8d8e19b073096d3609bbd60f82148d128b555 · < 8978dff632519712d1fa432991e1f2e857f90239| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nfc: llcp: fix slab-out-of-bounds reads when logging service names
nfc_llcp_wks_sap() and nfc_llcp_build_sdreq_tlv() pass non-null- terminated strings to pr_debug() using the %s format specifier. The buffers are allocated via kmemdup() or come from netlink attributes and are not guaranteed to be null-terminated, causing __dynamic_pr_debug() to read beyond the allocated region:
KASAN: slab-out-of-bounds Read in __dynamic_pr_debug
Fix both call sites by using %.*s with the explicit length to limit the output to the actual length of the string.
From the CVE record · Linux
The Linux kernel's NFC LLCP code can read beyond an allocated buffer when debug-logging service names that are not null-terminated. The input does not specify attacker access requirements or whether user interaction is needed.
Engineers running Linux kernels with NFC LLCP support should check their kernel versions against the vendor advisory; affected versions are not specified in the input.