]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: nf_conntrack_h323: check for zero length in DecodeQ931()
authorJenny Guanni Qu <qguanni@gmail.com>
Thu, 12 Mar 2026 14:49:50 +0000 (14:49 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Mar 2026 10:08:53 +0000 (11:08 +0100)
commit633e8f87dad32263f6a57dccdb873f042c062111
treeff631ad27bc0e7a6a41280abea9c3b1e082e3637
parent171fe8e6da02cf4ae4e8602f8974f1d45899bf7a
netfilter: nf_conntrack_h323: check for zero length in DecodeQ931()

[ Upstream commit f173d0f4c0f689173f8cdac79991043a4a89bf66 ]

In DecodeQ931(), the UserUserIE code path reads a 16-bit length from
the packet, then decrements it by 1 to skip the protocol discriminator
byte before passing it to DecodeH323_UserInformation(). If the encoded
length is 0, the decrement wraps to -1, which is then passed as a
large value to the decoder, leading to an out-of-bounds read.

Add a check to ensure len is positive after the decrement.

Fixes: 5e35941d9901 ("[NETFILTER]: Add H.323 conntrack/NAT helper")
Reported-by: Klaudia Kloc <klaudia@vidocsecurity.com>
Reported-by: Dawid Moczadło <dawid@vidocsecurity.com>
Tested-by: Jenny Guanni Qu <qguanni@gmail.com>
Signed-off-by: Jenny Guanni Qu <qguanni@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_conntrack_h323_asn1.c