netfilter: nft_exthdr: Fix non-linear header modification
authorXiao Liang <shaw.leon@gmail.com>
Fri, 25 Aug 2023 05:33:27 +0000 (13:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:42:59 +0000 (09:42 +0200)
commitbcdb4a5c42b09f7cc00bbdafece7eae177b959e9
treedb2e47f007b1cce4dc7d0e3d4afda3b1ec68b69c
parent7ca0706c68adadf86a36b60dca090f5e9481e808
netfilter: nft_exthdr: Fix non-linear header modification

commit 28427f368f0e08d504ed06e74bc7cc79d6d06511 upstream.

Fix skb_ensure_writable() size. Don't use nft_tcp_header_pointer() to
make it explicit that pointers point to the packet (not local buffer).

Fixes: 99d1712bc41c ("netfilter: exthdr: tcp option set support")
Fixes: 7890cbea66e7 ("netfilter: exthdr: add support for tcp option removal")
Cc: stable@vger.kernel.org
Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nft_exthdr.c