]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
netfilter: xt_tcpmss: check remaining length before reading optlen
authorFlorian Westphal <fw@strlen.de>
Mon, 19 Jan 2026 11:30:42 +0000 (12:30 +0100)
committerFlorian Westphal <fw@strlen.de>
Tue, 20 Jan 2026 15:23:38 +0000 (16:23 +0100)
commit735ee8582da3d239eb0c7a53adca61b79fb228b3
treed54a941765e14fa2e42d75adfb792d513bf93fdd
parentde8a70cefcb26cdceaafdc5ac144712681419c29
netfilter: xt_tcpmss: check remaining length before reading optlen

Quoting reporter:
  In net/netfilter/xt_tcpmss.c (lines 53-68), the TCP option parser reads
 op[i+1] directly without validating the remaining option length.

  If the last byte of the option field is not EOL/NOP (0/1), the code attempts
  to index op[i+1]. In the case where i + 1 == optlen, this causes an
  out-of-bounds read, accessing memory past the optlen boundary
  (either reading beyond the stack buffer _opt or the
  following payload).

Reported-by: sungzii <sungzii@pm.me>
Signed-off-by: Florian Westphal <fw@strlen.de>
net/netfilter/xt_tcpmss.c