mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-24 19:40:21 +09:00
netfilter: nft_payload: fix wrong mac header matching
commitd351c1ea2dupstream. 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:96518518cc("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
36a315c923
commit
02322c5177
@@ -132,7 +132,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)) {
|
||||
|
||||
Reference in New Issue
Block a user