diff options
author | Florian Westphal <fw@strlen.de> | 2023-10-08 20:36:53 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-10-25 12:54:19 +0300 |
commit | 287401f92c57dd0006ab9c18295edc42ef08f87d (patch) | |
tree | e9c6c15253c9f5b2fd688dc0b42a38997deb3395 | |
parent | fe37e56ed47d8789f2be2076fed7c1a6085c60de (diff) | |
download | linux-287401f92c57dd0006ab9c18295edc42ef08f87d.tar.xz |
netfilter: nft_payload: fix wrong mac header matching
commit d351c1ea2de3e36e608fc355d8ae7d0cc80e6cd6 upstream.
mcast packets get looped back to the local machine.
Such packets have a 0-length mac header, we should treat
this like "mac header not set" and abort rule evaluation.
As-is, we just copy data from the network header instead.
Fixes: 96518518cc41 ("netfilter: add nftables")
Reported-by: Blažej Krajňák <krajnak@levonet.sk>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | net/netfilter/nft_payload.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nft_payload.c b/net/netfilter/nft_payload.c index b2b63c3653d4..56f6c05362ae 100644 --- a/net/netfilter/nft_payload.c +++ b/net/netfilter/nft_payload.c @@ -93,7 +93,7 @@ void nft_payload_eval(const struct nft_expr *expr, switch (priv->base) { case NFT_PAYLOAD_LL_HEADER: - if (!skb_mac_header_was_set(skb)) + if (!skb_mac_header_was_set(skb) || skb_mac_header_len(skb) == 0) goto err; if (skb_vlan_tag_present(skb)) { |