]> git.itanic.dy.fi Git - linux-stable/commit
netfilter: nft_payload: rebuild vlan header on h_proto access
authorFlorian Westphal <fw@strlen.de>
Fri, 29 Sep 2023 08:42:10 +0000 (10:42 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 4 Oct 2023 12:12:01 +0000 (14:12 +0200)
commitaf84f9e447a65b4b9f79e7e5d69e19039b431c56
treebe8ad3a2ab4243a2ab132af9c63bd4eddfa749f4
parent51e7a66666e0ca9642c59464ef8359f0ac604d41
netfilter: nft_payload: rebuild vlan header on h_proto access

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>
net/netfilter/nft_payload.c