diff options
| author | Muhammad Bilal <meatuni001@gmail.com> | 2026-05-20 00:23:28 +0300 |
|---|---|---|
| committer | Florian Westphal <fw@strlen.de> | 2026-05-24 23:55:47 +0300 |
| commit | ef6400ca25a13fd6dedbe8ef4a1d0979bbbfe88a (patch) | |
| tree | a9537064a693e09c57a98a262b5b889846761adb /include/linux/patchkey.h | |
| parent | d738feccb98cb224ebabecb703e98f5008276bff (diff) | |
| download | linux-ef6400ca25a13fd6dedbe8ef4a1d0979bbbfe88a.tar.xz | |
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.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Muhammad Bilal <meatuni001@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'include/linux/patchkey.h')
0 files changed, 0 insertions, 0 deletions
