netfilter: nf_conntrack_irc: fix parse_dcc() off-by-one OOB read
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · < aff589556ed772cb1c0c2d7b4d91ec45c0c39416| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nf_conntrack_irc: fix parse_dcc() off-by-one OOB read
parse_dcc() treats data_end as an inclusive end pointer, but its only caller passes data_limit = ib_ptr + datalen, which points one past the last valid byte.
The newline search loop iterates while tmp <= data_end, so when no newline is present, *tmp is read at tmp == data_end, one byte beyond the region filled by skb_header_pointer().
irc_buffer is kmalloc'd as MAX_SEARCH_SIZE + 1 bytes and datalen is capped at MAX_SEARCH_SIZE, so the stray read does not fault. The byte is uninitialized or stale; if it contains an ASCII digit, simple_strtoul will consume it and produce a wrong DCC IP or port in the conntrack expectation. The extra allocation byte is also a fragile guard: if the cap or allocation size changes, this becomes a real out-of-bounds read.
Change the loop and its post-loop check to use strict less-than, consistent with the caller's exclusive-end convention. Update the function comment accordingly.
From the CVE record · Linux
The Linux kernel’s nf_conntrack_irc helper reads one byte past the filled buffer when parsing DCC data without a newline. If that byte contains an ASCII digit, it can produce an incorrect IP address or port in a conntrack expectation. The input does not specify authentication or user-interaction requirements.
Engineers running Linux kernels with nf_conntrack_irc should check their kernel; affected versions are not specified.