]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: nft_exthdr: fix offset with ipv4_find_option()
authorAlexey Kashavkin <akashavkin@gmail.com>
Sat, 1 Mar 2025 21:14:36 +0000 (00:14 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:31:49 +0000 (14:31 +0200)
commit46ea2a7a8c27fb6a5fb464d8d78c2deef6df78b6
tree1c92ceb0fd5f700ae102a9bd8faa89b101ce97d5
parent003d92c91cdb5a64b25a9a74cb8543aac9a8bb48
netfilter: nft_exthdr: fix offset with ipv4_find_option()

[ Upstream commit 6edd78af9506bb182518da7f6feebd75655d9a0e ]

There is an incorrect calculation in the offset variable which causes
the nft_skb_copy_to_reg() function to always return -EFAULT. Adding the
start variable is redundant. In the __ip_options_compile() function the
correct offset is specified when finding the function. There is no need
to add the size of the iphdr structure to the offset.

Fixes: dbb5281a1f84 ("netfilter: nf_tables: add support for matching IPv4 options")
Signed-off-by: Alexey Kashavkin <akashavkin@gmail.com>
Reviewed-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nft_exthdr.c