]> git.baikalelectronics.ru Git - kernel.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)
committerFlorian Westphal <fw@strlen.de>
Tue, 26 Jul 2022 19:12:42 +0000 (21:12 +0200)
commit7f94d46ce22e6b98b09bc57db5d3f47a409c9607
tree3c552bf8a966f236cf0bfb778f4b3a945150b2cc
parentb5445f9da1b4d70b74092ae7863fbd3707a2e878
netfilter: nf_queue: do not allow packet truncation below transport header offset

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: c68374e54fde ("[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>
net/netfilter/nfnetlink_queue.c