]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
netfilter: replace skb_try_make_writable() by skb_ensure_writable()
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 27 Apr 2026 12:34:45 +0000 (14:34 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 29 Apr 2026 22:57:42 +0000 (00:57 +0200)
commit1049970d7583194eedc30e45a3c898b2cb1c30ba
tree1da39d97fe437e06f7ec924c7f332f05a5fcdce5
parent0c7a5ba011d336df4fcd1f667fcc16ea5549be12
netfilter: replace skb_try_make_writable() by skb_ensure_writable()

skb_try_make_writable() only works on clones and uncloned packets might
have their network header in paged fragments.

nft_fwd needs to work for the ingress and egress hooks, but the egress
hook where skb->data points to the mac header, use skb_network_offset()
to include the mac header. The flowtable is fine since it already uses
the transport offset.

Fixes: d32de98ea70f ("netfilter: nft_fwd_netdev: allow to forward packets via neighbour layer")
Fixes: 7d2086871762 ("netfilter: nf_flow_table: move ipv4 offload hook code to nf_flow_table")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_flow_table_ip.c
net/netfilter/nft_fwd_netdev.c