{"id":81001,"date":"2026-06-24T10:44:30","date_gmt":"2026-06-24T07:14:30","guid":{"rendered":"https:\/\/afaghhosting.net\/blog\/cve-2026-52942-netfilter-nf_log-validate-mac-header-was-set-before-dumping-it\/"},"modified":"2026-06-24T10:44:30","modified_gmt":"2026-06-24T07:14:30","slug":"cve-2026-52942-netfilter-nf_log-validate-mac-header-was-set-before-dumping-it","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/cve-2026-52942-netfilter-nf_log-validate-mac-header-was-set-before-dumping-it\/","title":{"rendered":"CVE-2026-52942 &#8211; netfilter: nf_log: validate MAC header was set before dumping it"},"content":{"rendered":"<p>CVE ID :CVE-2026-52942<\/p>\n<p>  Published : June 24, 2026, 7:14 a.m. | 2\u00a0hours, 29\u00a0minutes ago<\/p>\n<p>  Description :In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>netfilter: nf_log: validate MAC header was set before dumping it<\/p>\n<p>The fallback path of dump_mac_header() guards the MAC header access<br \/>\nonly with &#8220;skb-&gt;mac_header != skb-&gt;network_header&#8221;, without checking<br \/>\nskb_mac_header_was_set(). When the MAC header is unset, mac_header is<br \/>\n0xffff, so the test passes and skb_mac_header(skb) returns<br \/>\nskb-&gt;head + 0xffff, ~64 KiB past the buffer; the loop then reads<br \/>\ndev-&gt;hard_header_len bytes out of bounds into the kernel log.<\/p>\n<p>This is reachable via the netdev logger: nf_log_unknown_packet() calls<br \/>\ndump_mac_header() unconditionally, and an skb sent through AF_PACKET<br \/>\nwith PACKET_QDISC_BYPASS reaches the egress hook with mac_header still<br \/>\nunset (__dev_queue_xmit(), which would reset it, is bypassed).<\/p>\n<p>Add the skb_mac_header_was_set() check the ARPHRD_ETHER path already<br \/>\nuses, and replace the open-coded MAC header length test with<br \/>\nskb_mac_header_len(). Only skbs with an unset MAC header are affected;<br \/>\nvalid ones are dumped as before.<\/p>\n<p> BUG: KASAN: slab-out-of-bounds in dump_mac_header (net\/netfilter\/nf_log_syslog.c:831)<br \/>\n Read of size 1 at addr ffff88800ea49d3f by task exploit\/148<br \/>\n Call Trace:<br \/>\n  kasan_report (mm\/kasan\/report.c:595)<br \/>\n  dump_mac_header (net\/netfilter\/nf_log_syslog.c:831)<br \/>\n  nf_log_netdev_packet (net\/netfilter\/nf_log_syslog.c:938 net\/netfilter\/nf_log_syslog.c:963)<br \/>\n  nf_log_packet (net\/netfilter\/nf_log.c:260)<br \/>\n  nft_log_eval (net\/netfilter\/nft_log.c:60)<br \/>\n  nft_do_chain (net\/netfilter\/nf_tables_core.c:285)<br \/>\n  nft_do_chain_netdev (net\/netfilter\/nft_chain_filter.c:307)<br \/>\n  nf_hook_slow (net\/netfilter\/core.c:619)<br \/>\n  nf_hook_direct_egress (net\/packet\/af_packet.c:257)<br \/>\n  packet_xmit (net\/packet\/af_packet.c:280)<br \/>\n  packet_sendmsg (net\/packet\/af_packet.c:3114)<br \/>\n  __sys_sendto (net\/socket.c:2265)<\/p>\n<p>  Severity: 0.0 | NA<\/p>\n<p>  Visit the link for more details, such as CVSS details, affected products, timeline, and more&#8230;\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CVE ID :CVE-2026-52942 Published : June 24, 2026, 7:14 a.m. | 2\u00a0hours, 29\u00a0minutes ago Description :In the Linux kernel, the following vulnerability has been resolved: netfilter: nf_log: validate MAC header was set before dumping it The fallback path of dump_mac_header() guards the MAC header access only with &#8220;skb-&gt;mac_header != skb-&gt;network_header&#8221;, without checking skb_mac_header_was_set(). When the &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-81001","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/81001","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=81001"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/81001\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=81001"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=81001"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=81001"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}