]> www.infradead.org Git - users/dwmw2/linux.git/commit
netfilter: nf_queue: do not allow packet truncation below transport header offset
authorFlorian Westphal <fw@strlen.de>
Tue, 26 Jul 2022 10:42:06 +0000 (12:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Aug 2022 10:00:49 +0000 (12:00 +0200)
commit440dccd80f627e0e11ceb0429e4cdab61857d17e
tree1e3176139c0a9e506f41dd5d6fb4651c09d7011f
parentaeb2ff9f9f7059021f93313da3cc0c3f7f2f1641
netfilter: nf_queue: do not allow packet truncation below transport header offset

[ Upstream commit 99a63d36cb3ed5ca3aa6fcb64cffbeaf3b0fb164 ]

Domingo Dirutigliano and Nicola Guerrera report kernel panic when
sending nf_queue verdict with 1-byte nfta_payload attribute.

The IP/IPv6 stack pulls the IP(v6) header from the packet after the
input hook.

If user truncates the packet below the header size, this skb_pull() will
result in a malformed skb (skb->len < 0).

Fixes: 7af4cc3fa158 ("[NETFILTER]: Add "nfnetlink_queue" netfilter queue handler over nfnetlink")
Reported-by: Domingo Dirutigliano <pwnzer0tt1@proton.me>
Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nfnetlink_queue.c