CVE-2026-80799: nfc: llcp: fix OOB read and u8 offset wrap in TLV parsers
In the Linux kernel, the following vulnerability has been resolved:
nfc: llcp: fix OOB read and u8 offset wrap in TLV parsers
nfcllcpparsegbtlv() and nfcllcpparseconnectiontlv() contain three related bugs in their TLV parsing loops:
1. 'offset' is declared u8 but tlvarraylen is u16. When TLV data advances offset past 255 it silently wraps to zero, causing infinite loops or double-processing of buffer data.
2. Before reading tlv[0] (type) and tlv[1] (length) there is no check that offset+2 <= tlvarraylen. A truncated TLV causes an OOB read of one byte past the buffer end.
3. After reading the length field, the value bytes are accessed without checking offset+2+length <= tlvarraylen. A crafted length=0xFF on a short buffer causes up to 255 bytes of OOB read past the buffer end.
Both functions are reachable without authentication via nfcllcpsetremotegb() which feeds remote LLCP general bytes directly into nfcllcpparsegbtlv() with no additional validation.
Fix all three issues by widening offset from u8 to u16 and adding bounds checks for both the TLV header and value field before each access.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Linux kernel (nfc: llcp: fix OOB read and u8 offset wrap in TLV parsers)to a version that resolves this vulnerability.Patch nfc: llcp: fix OOB read and u8 offset wrap in TLV parsers - Configuration
Update the TLV parsing loops in both nfc_llcp_parse_gb_tlv() and nfc_llcp_parse_connection_tlv() to validate TLV header and value bounds before each access (specifically check offset+2 <= tlv_array_len and offset+2+length <= tlv_array_len).
Linux kernel NFC LLCP nfc_llcp_parse_gb_tlv() and nfc_llcp_parse_connection_tlv() TLV parsing bounds checks = Add/ensure checks that offset+2 <= tlv_array_len and offset+2+length <= tlv_array_len before accessing tlv[0]/tlv[1] and before reading value bytes
Event History
Frequently Asked Questions
Who is exposed to this issue?
Systems using the Linux kernel's NFC LLCP functionality are exposed when they process remote LLCP general bytes. The affected parsing path can be reached by a remote peer without authentication.
What does an attacker need to exploit it?
An attacker needs to provide crafted remote LLCP TLV data, such as a truncated TLV header or a length field that exceeds the available buffer. No authentication is required for the described reachable path.
What can happen with malicious TLV input?
Malformed input can cause out-of-bounds reads, including reads up to 255 bytes beyond a short buffer. TLV data exceeding 255 bytes can also make the 8-bit parser offset wrap, leading to infinite loops or repeated processing of buffer data.
What does the fix change?
The fix widens the parser offset from u8 to u16 and verifies that both each TLV header and its declared value bytes fit within the provided TLV buffer before accessing them.