Skip to content

Commit f0663d7

Browse files
CIQ Kernel Automationroxanan1996
authored andcommitted
netfilter: ip6t_eui64: reject invalid MAC header for all packets
jira VULN-183038 cve CVE-2026-31685 commit-author Zhengchuan Liang <zcliangcn@gmail.com> commit fdce0b3 `eui64_mt6()` derives a modified EUI-64 from the Ethernet source address and compares it with the low 64 bits of the IPv6 source address. The existing guard only rejects an invalid MAC header when `par->fragoff != 0`. For packets with `par->fragoff == 0`, `eui64_mt6()` can still reach `eth_hdr(skb)` even when the MAC header is not valid. Fix this by removing the `par->fragoff != 0` condition so that packets with an invalid MAC header are rejected before accessing `eth_hdr(skb)`. Fixes: 1da177e ("Linux-2.6.12-rc2") Reported-by: Yifan Wu <yifanwucs@gmail.com> Reported-by: Juefei Pu <tomapufckgml@gmail.com> Co-developed-by: Yuan Tan <yuantan098@gmail.com> Signed-off-by: Yuan Tan <yuantan098@gmail.com> Suggested-by: Xin Liu <bird@lzu.edu.cn> Tested-by: Ren Wei <enjou1224z@gmail.com> Signed-off-by: Zhengchuan Liang <zcliangcn@gmail.com> Signed-off-by: Ren Wei <n05ec@lzu.edu.cn> Signed-off-by: Florian Westphal <fw@strlen.de> (cherry picked from commit fdce0b3) Signed-off-by: CIQ Kernel Automation <ciq_kernel_automation@ciq.com>
1 parent 794f919 commit f0663d7

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

net/ipv6/netfilter/ip6t_eui64.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ eui64_mt6(const struct sk_buff *skb, struct xt_action_param *par)
2222
unsigned char eui64[8];
2323

2424
if (!(skb_mac_header(skb) >= skb->head &&
25-
skb_mac_header(skb) + ETH_HLEN <= skb->data) &&
26-
par->fragoff != 0) {
25+
skb_mac_header(skb) + ETH_HLEN <= skb->data)) {
2726
par->hotdrop = true;
2827
return false;
2928
}

0 commit comments

Comments
 (0)