Florian Westphal 8312923739 netfilter: nft_payload: rebuild vlan header on h_proto access
[ Upstream commit af84f9e447a65b4b9f79e7e5d69e19039b431c56 ]

nft can perform merging of adjacent payload requests.
This means that:

ether saddr 00:11 ... ether type 8021ad ...

is a single payload expression, for 8 bytes, starting at the
ethernet source offset.

Check that offset+length is fully within the source/destination mac
addersses.

This bug prevents 'ether type' from matching the correct h_proto in case
vlan tag got stripped.

Fixes: de6843be3082 ("netfilter: nft_payload: rebuild vlan header when needed")
Reported-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Florian Westphal <fw@strlen.de>
Stable-dep-of: 33c563ebf8d3 ("netfilter: nft_payload: skbuff vlan metadata mangle support")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-16 13:39:50 +02:00
..
2023-10-19 23:05:36 +02:00
2024-03-26 18:21:36 -04:00
2024-05-17 11:50:48 +02:00
2024-06-16 13:39:33 +02:00
2024-05-17 11:51:04 +02:00
2023-06-21 15:59:15 +02:00
2023-06-21 15:59:15 +02:00