get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2219772/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2219772,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2219772/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/8a97a5560b3bcede951dbd1214e126754dc55cb4.1775260446.git.zcliangcn@gmail.com/",
    "project": {
        "id": 26,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/26/?format=api",
        "name": "Netfilter Development",
        "link_name": "netfilter-devel",
        "list_id": "netfilter-devel.vger.kernel.org",
        "list_email": "netfilter-devel@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null
    },
    "msgid": "<8a97a5560b3bcede951dbd1214e126754dc55cb4.1775260446.git.zcliangcn@gmail.com>",
    "date": "2026-04-04T09:39:48",
    "name": "[nf,v2,2/2] netfilter: require Ethernet MAC header before using eth_hdr()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "4ae7e9b0586b4d6d64e92ee0be2bf220128f254f",
    "submitter": {
        "id": 92912,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/92912/?format=api",
        "name": "Ren Wei",
        "email": "n05ec@lzu.edu.cn"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/8a97a5560b3bcede951dbd1214e126754dc55cb4.1775260446.git.zcliangcn@gmail.com/mbox/",
    "series": [
        {
            "id": 498135,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/498135/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=498135",
            "date": "2026-03-31T07:34:41",
            "name": "[1/1] netfilter: ip6t_eui64: validate MAC header before using it",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/498135/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2219772/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2219772/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <netfilter-devel+bounces-11628-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "netfilter-devel@vger.kernel.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-11628-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=52.229.168.213",
            "smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=lzu.edu.cn",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=lzu.edu.cn"
        ],
        "Received": [
            "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fnrFX0M7Qz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 04 Apr 2026 20:41:20 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 93C3B301DB92\n\tfor <incoming@patchwork.ozlabs.org>; Sat,  4 Apr 2026 09:40:54 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 831E33A874B;\n\tSat,  4 Apr 2026 09:40:53 +0000 (UTC)",
            "from azure-sdnproxy.icoremail.net (azure-sdnproxy.icoremail.net\n [52.229.168.213])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id A84EA3A7F52;\n\tSat,  4 Apr 2026 09:40:48 +0000 (UTC)",
            "from enjou-Legion-Y7000P-2019.coin-barley.ts.net (unknown\n [172.23.56.36])\n\tby app1 (Coremail) with SMTP id ygmowADnXwB93NBps2+lAA--.38592S3;\n\tSat, 04 Apr 2026 17:40:25 +0800 (CST)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775295653; cv=none;\n b=NtC6nRFUr/Xxf9/HCO0wo860T0Qjieusv4IzA/kaxzZkItk8z96zCmweVDjeXZ+X8epBHtJDl5KvUmEvr3d3JhkBnxG+Fr1SEDdqG1+NQjJ+NF8QA5rx6aSROpmWo5BjXPkf3SQMuso3PDL8AIBcn5GOLC2bgbD60sDufEjPT0s=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775295653; c=relaxed/simple;\n\tbh=OwPt9XHHkjnSsh68AOZSdcby1t48S2XGm/KMVKt3zlE=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=P3exEs52xNs1SMmvENl58idW3VQJ3XmWLxedsUz38KOrodaECOFfcRGtzh/AtIeRank/uGapctBP/2RvkwcKxvVzob8pBKgT+gQMGLtLA36+M+J2ikZkaoiPJo6+uouoTF+/w3JdCBC/b3udLwK5Mi/C9R/Ihoo21sgCogPklvE=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=lzu.edu.cn;\n spf=pass smtp.mailfrom=lzu.edu.cn; arc=none smtp.client-ip=52.229.168.213",
        "From": "Ren Wei <n05ec@lzu.edu.cn>",
        "To": "netfilter-devel@vger.kernel.org,\n\tnetdev@vger.kernel.org",
        "Cc": "pablo@netfilter.org,\n\tfw@strlen.de,\n\tphil@nwl.cc,\n\tdavem@davemloft.net,\n\tdsahern@kernel.org,\n\tedumazet@google.com,\n\tkuba@kernel.org,\n\tpabeni@redhat.com,\n\thorms@kernel.org,\n\tyifanwucs@gmail.com,\n\ttomapufckgml@gmail.com,\n\tyuantan098@gmail.com,\n\tbird@lzu.edu.cn,\n\tenjou1224z@gmail.com,\n\tzcliangcn@gmail.com,\n\tn05ec@lzu.edu.cn",
        "Subject": "[PATCH nf v2 2/2] netfilter: require Ethernet MAC header before using\n eth_hdr()",
        "Date": "Sat,  4 Apr 2026 17:39:48 +0800",
        "Message-ID": "\n <8a97a5560b3bcede951dbd1214e126754dc55cb4.1775260446.git.zcliangcn@gmail.com>",
        "X-Mailer": "git-send-email 2.51.0",
        "In-Reply-To": "<cover.1774859629.git.zcliangcn@gmail.com>",
        "References": "<cover.1774859629.git.zcliangcn@gmail.com>",
        "Precedence": "bulk",
        "X-Mailing-List": "netfilter-devel@vger.kernel.org",
        "List-Id": "<netfilter-devel.vger.kernel.org>",
        "List-Subscribe": "<mailto:netfilter-devel+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:netfilter-devel+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-CM-TRANSID": "ygmowADnXwB93NBps2+lAA--.38592S3",
        "X-Coremail-Antispam": "1UD129KBjvJXoW3XryftF1DZryxKr1fGF18Grg_yoWxtF15pa\n\t1DCa4rJrs3Jr43Gr18Ca1xZr45Jw4kAF4S934Yy3sYv3WqgrZ5tay0kr4ag3W8XrZYgrsx\n\tW3Wjvw4ruws8XrJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2\n\t9KBjDU0xBIdaVrnRJUUUBY1xkIjI8I6I8E6xAIw20EY4v20xvaj40_JFC_Wr1l1IIY67AE\n\tw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2\n\tIY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1l84ACjcxK6I8E\n\t87Iv67AKxVWxJr0_GcWl84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcV\n\tAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j\n\t6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64\n\tvIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E8cxan2IY04v7MxkF7I0E\n\tn4kS14v26r4a6rW5MxkIecxEwVCm-wCF04k20xvY0x0EwIxGrwCF04k20xvE74AGY7Cv6c\n\tx26r48MxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCj\n\tr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVW8ZVWrXwCIc40Y0x0EwIxGrwCI42IY6x\n\tIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAI\n\tw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x\n\t0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7sRi_HU3UUUUU==",
        "X-CM-SenderInfo": "zqqvvuo6o23hxhgxhubq/1tbiAQQHCWnP4nwFrAAAsa"
    },
    "content": "From: Zhengchuan Liang <zcliangcn@gmail.com>\n\n`ip6t_eui64`, `xt_mac`, the `bitmap:ip,mac`, `hash:ip,mac`, and\n`hash:mac` ipset types, and `nf_log_syslog` access `eth_hdr(skb)`\nafter either assuming that the skb is associated with an Ethernet\ndevice or checking only that the `ETH_HLEN` bytes at\n`skb_mac_header(skb)` lie between `skb->head` and `skb->data`.\n\nMake these paths first verify that the skb is associated with an\nEthernet device, that the MAC header was set, and that it spans at\nleast a full Ethernet header before accessing `eth_hdr(skb)`.\n\nSuggested-by: Florian Westphal <fw@strlen.de>\nTested-by: Ren Wei <enjou1224z@gmail.com>\nSigned-off-by: Zhengchuan Liang <zcliangcn@gmail.com>\nSigned-off-by: Ren Wei <n05ec@lzu.edu.cn>\n---\nChanges in v2:\nThis patch addresses suspicious `eth_hdr(skb)` users by requiring an\nEthernet device together with a valid MAC header before accessing it.\n\n net/ipv6/netfilter/ip6t_eui64.c           | 7 +++++--\n net/netfilter/ipset/ip_set_bitmap_ipmac.c | 5 +++--\n net/netfilter/ipset/ip_set_hash_ipmac.c   | 9 +++++----\n net/netfilter/ipset/ip_set_hash_mac.c     | 5 +++--\n net/netfilter/nf_log_syslog.c             | 7 ++++++-\n net/netfilter/xt_mac.c                    | 4 +---\n 6 files changed, 23 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/net/ipv6/netfilter/ip6t_eui64.c b/net/ipv6/netfilter/ip6t_eui64.c\nindex da69a27e8332c..bbb684f9964c0 100644\n--- a/net/ipv6/netfilter/ip6t_eui64.c\n+++ b/net/ipv6/netfilter/ip6t_eui64.c\n@@ -7,6 +7,7 @@\n #include <linux/module.h>\n #include <linux/skbuff.h>\n #include <linux/ipv6.h>\n+#include <linux/if_arp.h>\n #include <linux/if_ether.h>\n \n #include <linux/netfilter/x_tables.h>\n@@ -21,8 +22,10 @@ eui64_mt6(const struct sk_buff *skb, struct xt_action_param *par)\n {\n \tunsigned char eui64[8];\n \n-\tif (!(skb_mac_header(skb) >= skb->head &&\n-\t      skb_mac_header(skb) + ETH_HLEN <= skb->data)) {\n+\tif (!skb->dev || skb->dev->type != ARPHRD_ETHER)\n+\t\treturn false;\n+\n+\tif (!skb_mac_header_was_set(skb) || skb_mac_header_len(skb) < ETH_HLEN) {\n \t\tpar->hotdrop = true;\n \t\treturn false;\n \t}\ndiff --git a/net/netfilter/ipset/ip_set_bitmap_ipmac.c b/net/netfilter/ipset/ip_set_bitmap_ipmac.c\nindex 2c625e0f49ec0..752f59ef87442 100644\n--- a/net/netfilter/ipset/ip_set_bitmap_ipmac.c\n+++ b/net/netfilter/ipset/ip_set_bitmap_ipmac.c\n@@ -11,6 +11,7 @@\n #include <linux/etherdevice.h>\n #include <linux/skbuff.h>\n #include <linux/errno.h>\n+#include <linux/if_arp.h>\n #include <linux/if_ether.h>\n #include <linux/netlink.h>\n #include <linux/jiffies.h>\n@@ -220,8 +221,8 @@ bitmap_ipmac_kadt(struct ip_set *set, const struct sk_buff *skb,\n \t\treturn -IPSET_ERR_BITMAP_RANGE;\n \n \t/* Backward compatibility: we don't check the second flag */\n-\tif (skb_mac_header(skb) < skb->head ||\n-\t    (skb_mac_header(skb) + ETH_HLEN) > skb->data)\n+\tif (!skb->dev || skb->dev->type != ARPHRD_ETHER ||\n+\t    !skb_mac_header_was_set(skb) || skb_mac_header_len(skb) < ETH_HLEN)\n \t\treturn -EINVAL;\n \n \te.id = ip_to_id(map, ip);\ndiff --git a/net/netfilter/ipset/ip_set_hash_ipmac.c b/net/netfilter/ipset/ip_set_hash_ipmac.c\nindex 467c59a83c0ab..b9a2681e24888 100644\n--- a/net/netfilter/ipset/ip_set_hash_ipmac.c\n+++ b/net/netfilter/ipset/ip_set_hash_ipmac.c\n@@ -11,6 +11,7 @@\n #include <linux/skbuff.h>\n #include <linux/errno.h>\n #include <linux/random.h>\n+#include <linux/if_arp.h>\n #include <linux/if_ether.h>\n #include <net/ip.h>\n #include <net/ipv6.h>\n@@ -89,8 +90,8 @@ hash_ipmac4_kadt(struct ip_set *set, const struct sk_buff *skb,\n \tstruct hash_ipmac4_elem e = { .ip = 0, { .foo[0] = 0, .foo[1] = 0 } };\n \tstruct ip_set_ext ext = IP_SET_INIT_KEXT(skb, opt, set);\n \n-\tif (skb_mac_header(skb) < skb->head ||\n-\t    (skb_mac_header(skb) + ETH_HLEN) > skb->data)\n+\tif (!skb->dev || skb->dev->type != ARPHRD_ETHER ||\n+\t    !skb_mac_header_was_set(skb) || skb_mac_header_len(skb) < ETH_HLEN)\n \t\treturn -EINVAL;\n \n \tif (opt->flags & IPSET_DIM_TWO_SRC)\n@@ -205,8 +206,8 @@ hash_ipmac6_kadt(struct ip_set *set, const struct sk_buff *skb,\n \t};\n \tstruct ip_set_ext ext = IP_SET_INIT_KEXT(skb, opt, set);\n \n-\tif (skb_mac_header(skb) < skb->head ||\n-\t    (skb_mac_header(skb) + ETH_HLEN) > skb->data)\n+\tif (!skb->dev || skb->dev->type != ARPHRD_ETHER ||\n+\t    !skb_mac_header_was_set(skb) || skb_mac_header_len(skb) < ETH_HLEN)\n \t\treturn -EINVAL;\n \n \tif (opt->flags & IPSET_DIM_TWO_SRC)\ndiff --git a/net/netfilter/ipset/ip_set_hash_mac.c b/net/netfilter/ipset/ip_set_hash_mac.c\nindex 718814730acf6..41a122591fe24 100644\n--- a/net/netfilter/ipset/ip_set_hash_mac.c\n+++ b/net/netfilter/ipset/ip_set_hash_mac.c\n@@ -8,6 +8,7 @@\n #include <linux/etherdevice.h>\n #include <linux/skbuff.h>\n #include <linux/errno.h>\n+#include <linux/if_arp.h>\n #include <linux/if_ether.h>\n #include <net/netlink.h>\n \n@@ -77,8 +78,8 @@ hash_mac4_kadt(struct ip_set *set, const struct sk_buff *skb,\n \tstruct hash_mac4_elem e = { { .foo[0] = 0, .foo[1] = 0 } };\n \tstruct ip_set_ext ext = IP_SET_INIT_KEXT(skb, opt, set);\n \n-\tif (skb_mac_header(skb) < skb->head ||\n-\t    (skb_mac_header(skb) + ETH_HLEN) > skb->data)\n+\tif (!skb->dev || skb->dev->type != ARPHRD_ETHER ||\n+\t    !skb_mac_header_was_set(skb) || skb_mac_header_len(skb) < ETH_HLEN)\n \t\treturn -EINVAL;\n \n \tif (opt->flags & IPSET_DIM_ONE_SRC)\ndiff --git a/net/netfilter/nf_log_syslog.c b/net/netfilter/nf_log_syslog.c\nindex 41503847d9d7f..f62049d429653 100644\n--- a/net/netfilter/nf_log_syslog.c\n+++ b/net/netfilter/nf_log_syslog.c\n@@ -78,7 +78,9 @@ dump_arp_packet(struct nf_log_buf *m,\n \telse\n \t\tlogflags = NF_LOG_DEFAULT_MASK;\n \n-\tif (logflags & NF_LOG_MACDECODE) {\n+\tif ((logflags & NF_LOG_MACDECODE) &&\n+\t    skb->dev && skb->dev->type == ARPHRD_ETHER &&\n+\t    skb_mac_header_was_set(skb) &&\n+\t    skb_mac_header_len(skb) >= ETH_HLEN) {\n \t\tnf_log_buf_add(m, \"MACSRC=%pM MACDST=%pM \",\n \t\t\t       eth_hdr(skb)->h_source, eth_hdr(skb)->h_dest);\n \t\tnf_log_dump_vlan(m, skb);\n@@ -789,6 +791,9 @@ static void dump_mac_header(struct nf_log_buf *m,\n \n \tswitch (dev->type) {\n \tcase ARPHRD_ETHER:\n+\t\tif (!skb_mac_header_was_set(skb) || skb_mac_header_len(skb) < ETH_HLEN)\n+\t\t\treturn;\n+\n \t\tnf_log_buf_add(m, \"MACSRC=%pM MACDST=%pM \",\n \t\t\t       eth_hdr(skb)->h_source, eth_hdr(skb)->h_dest);\n \t\tnf_log_dump_vlan(m, skb);\ndiff --git a/net/netfilter/xt_mac.c b/net/netfilter/xt_mac.c\nindex 81649da57ba5d..4798cd2ca26ed 100644\n--- a/net/netfilter/xt_mac.c\n+++ b/net/netfilter/xt_mac.c\n@@ -29,9 +29,7 @@ static bool mac_mt(const struct sk_buff *skb, struct xt_action_param *par)\n \n \tif (skb->dev == NULL || skb->dev->type != ARPHRD_ETHER)\n \t\treturn false;\n-\tif (skb_mac_header(skb) < skb->head)\n-\t\treturn false;\n-\tif (skb_mac_header(skb) + ETH_HLEN > skb->data)\n+\tif (!skb_mac_header_was_set(skb) || skb_mac_header_len(skb) < ETH_HLEN)\n \t\treturn false;\n \tret  = ether_addr_equal(eth_hdr(skb)->h_source, info->srcaddr);\n \tret ^= info->invert;\n",
    "prefixes": [
        "nf",
        "v2",
        "2/2"
    ]
}