]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
netfilter: handle unreadable frags
authorFlorian Westphal <fw@strlen.de>
Sun, 5 Jul 2026 13:29:13 +0000 (15:29 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 8 Jul 2026 13:33:44 +0000 (15:33 +0200)
commitda5b58478a9c1b85608c9e40a3b8432d071b409e
tree77db84123781dc90946186a49c8fe0e62a25d837
parentfa7395c02d95e51bad2952325d2d6503bfbad437
netfilter: handle unreadable frags

sashiko reports:
 When an skb with unreadable fragments (such as from devmem TCP, where
 skb_frags_readable(skb) returns false) is processed by the u32 module,
 skb_copy_bits() will safely return a negative error code [..]

xt_u32: bail out with hotdrop in this case.
gather_frags: return -1, just as if we had no fragment header.
nfnetlink_queue: restrict to the linear part.
nfnetlink_log: restrict to the linear part.

v2:
 - skb_zerocopy helpers don't copy readable flag, i.e. nfnetlink_queue
 is broken too
 xt_u32 shouldn't return true if hotdrop was set.

Fixes: 65249feb6b3d ("net: add support for skbs with unreadable frags")
Cc: stable@vger.kernel.org
Acked-by: Mina Almasry <almasrymina@google.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
net/ipv6/netfilter/nf_conntrack_reasm.c
net/netfilter/nfnetlink_log.c
net/netfilter/nfnetlink_queue.c
net/netfilter/xt_u32.c