]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: nft_payload: sanitize offset and length before calling skb_checksum()
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 30 Oct 2024 22:13:48 +0000 (23:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Nov 2024 15:25:53 +0000 (16:25 +0100)
commitb1d2de8a669fa14c499a385e056944d5352b3b40
treee8c0418d5a09f14b6b8151c93605ba2b69d8942f
parent9f605135a5c0fe614c2b15197b9ced1e217eca59
netfilter: nft_payload: sanitize offset and length before calling skb_checksum()

[ Upstream commit d5953d680f7e96208c29ce4139a0e38de87a57fe ]

If access to offset + length is larger than the skbuff length, then
skb_checksum() triggers BUG_ON().

skb_checksum() internally subtracts the length parameter while iterating
over skbuff, BUG_ON(len) at the end of it checks that the expected
length to be included in the checksum calculation is fully consumed.

Fixes: 7ec3f7b47b8d ("netfilter: nft_payload: add packet mangling support")
Reported-by: Slavin Liu <slavin-ayu@qq.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nft_payload.c