| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/08/31 08:08 | flow | patch-triage |
1mArgs:null Results: {
"EnableConfigs": [
"PACKET",
"VLAN_8021Q"
],
"FocusSymbols": [
"packet_sendmsg",
"packet_sendmsg_spkt",
"packet_snd",
"tpacket_snd"
],
"KMSANReasoning": "The patch updates `packet_parse_headers()` in `net/packet/af_packet.c` to properly position the network header offset for non-VLAN `SOCK_RAW` frames on Ethernet devices where `min_header_len \u003c hard_header_len`.\n\nKMSAN vs KASAN Applicability:\n- **KMSAN**: KMSAN detects use of uninitialized memory (stack, heap, page allocations) and uninitialized data leaks to user space. The patch introduces a single boolean local variable (`is_vlan`), which is explicitly initialized to `false` and set to `eth_type_vlan(skb-\u003eprotocol)`. It does not allocate new structures, copy uninitialized data to user space, or introduce branching on uninitialized variables.\n- **KASAN / Standard Sanitizers**: The changes only adjust internal `skb` header offsets (`mac_header`, `network_header`, `transport_header`) for packet transmission. Any potential offset or sizing issues affecting payload bounds during packet parsing or GSO would be out-of-bounds/bounds-check issues detectable by standard KASAN.\n\nTherefore, this patch does not introduce uninitialized memory risks and does not warrant a dedicated KMSAN fuzzing session.",
"NeedsKMSAN": false,
"Reasoning": "The patch modifies header parsing in af_packet (packet_parse_headers) for SOCK_RAW packet sockets over Ethernet devices where hard_header_len exceeds min_header_len. This changes the network and transport header offsets used during transmission and GSO, affecting reachable core networking code that can be exercised via AF_PACKET sockets.",
"WorthFuzzing": true
} |
| 1/1 | 2026/08/31 08:08 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 2a277378b05492f5dd1c15666ecdd609cad581a6\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Mon Aug 31 08:08:10 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/net/packet/af_packet.c b/net/packet/af_packet.c\nindex 1168bd6b09cd6..be5bf9db7ea15 100644\n--- a/net/packet/af_packet.c\n+++ b/net/packet/af_packet.c\n@@ -1935,6 +1935,7 @@ static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev,\n static void packet_parse_headers(struct sk_buff *skb, struct socket *sock)\n {\n \tint depth;\n+\tbool is_vlan = false;\n \n \t/* On TX skb-\u003edata is the L2 header; anchor it for all socket types. */\n \tskb_reset_mac_header(skb);\n@@ -1943,11 +1944,28 @@ static void packet_parse_headers(struct sk_buff *skb, struct socket *sock)\n \t sock-\u003etype == SOCK_RAW)\n \t\tskb-\u003eprotocol = dev_parse_header_protocol(skb);\n \n+\tif (likely(skb-\u003edev-\u003etype == ARPHRD_ETHER)) {\n+\t\tis_vlan = eth_type_vlan(skb-\u003eprotocol);\n+\n+\t\t/* For non-VLAN SOCK_RAW frames on Ethernet devices whose\n+\t\t * hard_header_len exceeds the on-wire L2 header length\n+\t\t * (min_header_len) -- e.g. software-offload VLAN subinterfaces,\n+\t\t * or Ethernet drivers that reserve extra space in\n+\t\t * hard_header_len for driver-internal wrapping -- the SOCK_RAW\n+\t\t * send paths leave network_header at hard_header_len, while the\n+\t\t * user frame's L3 sits at min_header_len. Move network_header\n+\t\t * to the actual L2/L3 boundary so the transport header probe\n+\t\t * below and subsequent GSO see the right L3.\n+\t\t */\n+\t\tif (!is_vlan \u0026\u0026 sock-\u003etype == SOCK_RAW \u0026\u0026\n+\t\t skb-\u003edev-\u003emin_header_len \u003c skb-\u003edev-\u003ehard_header_len)\n+\t\t\tskb_set_network_header(skb, skb-\u003edev-\u003emin_header_len);\n+\t}\n+\n \tskb_probe_transport_header(skb);\n \n \t/* Move network header to the right position for VLAN tagged packets */\n-\tif (likely(skb-\u003edev-\u003etype == ARPHRD_ETHER) \u0026\u0026\n-\t eth_type_vlan(skb-\u003eprotocol) \u0026\u0026\n+\tif (is_vlan \u0026\u0026\n \t vlan_get_protocol_and_depth(skb, skb-\u003eprotocol, \u0026depth) != 0)\n \t\tskb_set_network_header(skb, depth);\n }\n"
} |
| 2/1 | 2026/08/31 08:08 | agent | patch-evaluator |
0mModel:core Args: null Results: {
"EnableConfigs": [
"PACKET",
"VLAN_8021Q"
],
"FocusSymbols": [
"packet_sendmsg",
"packet_sendmsg_spkt",
"packet_snd",
"tpacket_snd"
],
"Reasoning": "The patch modifies header parsing in af_packet (packet_parse_headers) for SOCK_RAW packet sockets over Ethernet devices where hard_header_len exceeds min_header_len. This changes the network and transport header offsets used during transmission and GSO, affecting reachable core networking code that can be exercised via AF_PACKET sockets.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer. Your job is to review a provided patch series and determine if it makes functional changes to the kernel that should be fuzzed. IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively use your code access tools to examine the actual source code and confirm any assumptions. Return WorthFuzzing=false if the patch only contains: - Modifications to Documentation/, Kconfig files, or code comments. - Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints. - Changes to numeric constants or macros that do not functionally alter execution flow. - Code paths that are impossible to reach in virtualized environments like GCE or QEMU, even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim). - Code in vendor-specific PCIe switch, SmartNIC, or GPU drivers (e.g., mlxsw, pds_core, qed, ionic, amdgpu) that require physical PCIe hardware cards not emulated in standard QEMU. - Driver .remove, .shutdown, or pci_unregister_driver teardown callbacks (e.g., igb_remove) that are executed only during PCI hot-unplug or sysfs driver unbind operations. If it modifies reachable core kernel logic, drivers, or architectures, use your code search tools to verify the code can be executed, then return WorthFuzzing=true. When returning WorthFuzzing=true, you MUST ALSO: 1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols. Avoid listing generic hot-path functions to prevent skewed test distributions. Prefer non-static, non-inlined API entrypoint functions over internal static helper functions (which are inlined by the compiler and do not have distinct symbol addresses). 2. Identify any specific CONFIG_ options required to properly test this new/modified feature. Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions. Also check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed for Kbuild to compile the code statically into vmlinux. List them in the EnableConfigs output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4"). Prefer calling several tools at the same time to save round-trips. Use set-results tool to provide results of the analysis. It must be called exactly once before the final reply. Ignore results of this tool. Prompt: For your convenience, here is the diff of the changes:
commit 2a277378b05492f5dd1c15666ecdd609cad581a6
Author: syz-cluster <triage@syzkaller.com>
Date: Mon Aug 31 08:08:10 2026 +0000
syz-cluster: applied patch under review
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 1168bd6b09cd6..be5bf9db7ea15 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1935,6 +1935,7 @@ static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev,
static void packet_parse_headers(struct sk_buff *skb, struct socket *sock)
{
int depth;
+ bool is_vlan = false;
/* On TX skb->data is the L2 header; anchor it for all socket types. */
skb_reset_mac_header(skb);
@@ -1943,11 +1944,28 @@ static void packet_parse_headers(struct sk_buff *skb, struct socket *sock)
sock->type == SOCK_RAW)
skb->protocol = dev_parse_header_protocol(skb);
+ if (likely(skb->dev->type == ARPHRD_ETHER)) {
+ is_vlan = eth_type_vlan(skb->protocol);
+
+ /* For non-VLAN SOCK_RAW frames on Ethernet devices whose
+ * hard_header_len exceeds the on-wire L2 header length
+ * (min_header_len) -- e.g. software-offload VLAN subinterfaces,
+ * or Ethernet drivers that reserve extra space in
+ * hard_header_len for driver-internal wrapping -- the SOCK_RAW
+ * send paths leave network_header at hard_header_len, while the
+ * user frame's L3 sits at min_header_len. Move network_header
+ * to the actual L2/L3 boundary so the transport header probe
+ * below and subsequent GSO see the right L3.
+ */
+ if (!is_vlan && sock->type == SOCK_RAW &&
+ skb->dev->min_header_len < skb->dev->hard_header_len)
+ skb_set_network_header(skb, skb->dev->min_header_len);
+ }
+
skb_probe_transport_header(skb);
/* Move network header to the right position for VLAN tagged packets */
- if (likely(skb->dev->type == ARPHRD_ETHER) &&
- eth_type_vlan(skb->protocol) &&
+ if (is_vlan &&
vlan_get_protocol_and_depth(skb, skb->protocol, &depth) != 0)
skb_set_network_header(skb, depth);
}
|
| 3/2 | 2026/08/31 08:08 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 2566 output: 38 thoughts: 98 Thoughts: **Analyzing the Patch: Decoding the Network Packet Header Parsing** Okay, let's dive in. I need to fully understand this patch. My immediate focus is the modification to `net/packet/af_packet.c`, specifically the `packet_parse_headers` function. My first instinct is to get a solid grasp of *how* `af_packet.c` functions overall and how `packet_parse_headers` fits into that architecture. I'm thinking I'll use either `grepper` or a simple `read-file` command. Given the location mention of lines 1935-1970, that's where my focus needs to be. I want to see the surrounding code, the context of the call, and what's directly interacting with `packet_parse_headers`. Let's get a handle on what's changed and, more importantly, *why*. I need to understand the implications of this modification within the larger network packet processing pipeline. |
| 4/2 | 2026/08/31 08:08 | tool | read-file |
0mArgs:{
"File": "net/packet/af_packet.c",
"FirstLine": 1930,
"LineCount": 50
}Results: {
"Contents": "1930:\t\tkfree_skb(skb);\n1931:\toom:\n1932:\t\treturn 0;\n1933:\t}\n1934:\t\n1935:\tstatic void packet_parse_headers(struct sk_buff *skb, struct socket *sock)\n1936:\t{\n1937:\t\tint depth;\n1938:\t\tbool is_vlan = false;\n1939:\t\n1940:\t\t/* On TX skb-\u003edata is the L2 header; anchor it for all socket types. */\n1941:\t\tskb_reset_mac_header(skb);\n1942:\t\n1943:\t\tif ((!skb-\u003eprotocol || skb-\u003eprotocol == htons(ETH_P_ALL)) \u0026\u0026\n1944:\t\t sock-\u003etype == SOCK_RAW)\n1945:\t\t\tskb-\u003eprotocol = dev_parse_header_protocol(skb);\n1946:\t\n1947:\t\tif (likely(skb-\u003edev-\u003etype == ARPHRD_ETHER)) {\n1948:\t\t\tis_vlan = eth_type_vlan(skb-\u003eprotocol);\n1949:\t\n1950:\t\t\t/* For non-VLAN SOCK_RAW frames on Ethernet devices whose\n1951:\t\t\t * hard_header_len exceeds the on-wire L2 header length\n1952:\t\t\t * (min_header_len) -- e.g. software-offload VLAN subinterfaces,\n1953:\t\t\t * or Ethernet drivers that reserve extra space in\n1954:\t\t\t * hard_header_len for driver-internal wrapping -- the SOCK_RAW\n1955:\t\t\t * send paths leave network_header at hard_header_len, while the\n1956:\t\t\t * user frame's L3 sits at min_header_len. Move network_header\n1957:\t\t\t * to the actual L2/L3 boundary so the transport header probe\n1958:\t\t\t * below and subsequent GSO see the right L3.\n1959:\t\t\t */\n1960:\t\t\tif (!is_vlan \u0026\u0026 sock-\u003etype == SOCK_RAW \u0026\u0026\n1961:\t\t\t skb-\u003edev-\u003emin_header_len \u003c skb-\u003edev-\u003ehard_header_len)\n1962:\t\t\t\tskb_set_network_header(skb, skb-\u003edev-\u003emin_header_len);\n1963:\t\t}\n1964:\t\n1965:\t\tskb_probe_transport_header(skb);\n1966:\t\n1967:\t\t/* Move network header to the right position for VLAN tagged packets */\n1968:\t\tif (is_vlan \u0026\u0026\n1969:\t\t vlan_get_protocol_and_depth(skb, skb-\u003eprotocol, \u0026depth) != 0)\n1970:\t\t\tskb_set_network_header(skb, depth);\n1971:\t}\n1972:\t\n1973:\t/*\n1974:\t *\tOutput a raw packet to a device layer. This bypasses all the other\n1975:\t *\tprotocol layers and you must therefore supply it with a complete frame\n1976:\t */\n1977:\t\n1978:\tstatic int packet_sendmsg_spkt(struct socket *sock, struct msghdr *msg,\n1979:\t\t\t\t size_t len)\n"
} |
| 5/2 | 2026/08/31 08:08 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 3774 output: 29 thoughts: 22 Thoughts: Here's my take on those thoughts, tailored for an expert audience: **Analyzing Packet Header Parsing in af_packet.c** Okay, so I need to understand the call structure of `packet_parse_headers` within the `af_packet.c` module. My goal here is to quickly identify all the places where this crucial function is invoked. This is often the starting point for debugging or understanding data flow, especially when dealing with packet handling. I need to understand the function’s context within the af_packet module. I'll need to figure out where the information being parsed comes from and where it is subsequently sent. |
| 6/2 | 2026/08/31 08:08 | tool | grepper |
0mArgs:{
"Expression": "packet_parse_headers",
"PathPrefix": "net/packet/"
}Results: {
"Output": "net/packet/af_packet.c=1869=static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev,\n--\nnet/packet/af_packet.c-1934-\nnet/packet/af_packet.c:1935:static void packet_parse_headers(struct sk_buff *skb, struct socket *sock)\nnet/packet/af_packet.c-1936-{\n--\nnet/packet/af_packet.c=1978=static int packet_sendmsg_spkt(struct socket *sock, struct msghdr *msg,\n--\nnet/packet/af_packet.c-2095-\nnet/packet/af_packet.c:2096:\tpacket_parse_headers(skb, sock);\nnet/packet/af_packet.c-2097-\n--\nnet/packet/af_packet.c=2605=static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,\n--\nnet/packet/af_packet.c-2683-\nnet/packet/af_packet.c:2684:\tpacket_parse_headers(skb, sock);\nnet/packet/af_packet.c-2685-\n--\nnet/packet/af_packet.c=2987=static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)\n--\nnet/packet/af_packet.c-3114-\nnet/packet/af_packet.c:3115:\tpacket_parse_headers(skb, sock);\nnet/packet/af_packet.c-3116-\n"
} |
| 7/2 | 2026/08/31 08:08 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 4392 output: 25 thoughts: 36 Thoughts: **Investigating the Activation of af_packet.c** Alright, let's get down to brass tacks. I need to figure out which configuration option is responsible for enabling `af_packet.c`. My initial instinct is to dive into the kernel's source and pinpoint the relevant Kconfig and Makefile entries. Specifically, I'll be starting by examining `net/packet/Kconfig` and `net/packet/Makefile`. That should give me the clues I need to understand the dependencies and build process. From there, I can trace it back to the higher-level config options and see how it fits into the broader networking architecture. |
| 8/2 | 2026/08/31 08:08 | tool | grepper |
0mArgs:{
"Expression": "af_packet",
"PathPrefix": "net/"
}Results: {
"Output": "net/core/dev.c=594=static inline struct list_head *ptype_head(const struct packet_type *pt)\n--\nnet/core/dev.c-596-\tif (pt-\u003etype == htons(ETH_P_ALL)) {\nnet/core/dev.c:597:\t\tif (!pt-\u003eaf_packet_net \u0026\u0026 !pt-\u003edev)\nnet/core/dev.c-598-\t\t\treturn NULL;\n--\nnet/core/dev.c-600-\t\treturn pt-\u003edev ? \u0026pt-\u003edev-\u003eptype_all :\nnet/core/dev.c:601:\t\t\t\t \u0026pt-\u003eaf_packet_net-\u003eptype_all;\nnet/core/dev.c-602-\t}\n--\nnet/core/dev.c-606-\nnet/core/dev.c:607:\treturn pt-\u003eaf_packet_net ? \u0026pt-\u003eaf_packet_net-\u003eptype_specific :\nnet/core/dev.c-608-\t\t\t\t \u0026ptype_base[ntohs(pt-\u003etype) \u0026 PTYPE_HASH_MASK];\n--\nnet/core/dev.c=2539=static inline bool skb_loop_sk(struct packet_type *ptype, struct sk_buff *skb)\nnet/core/dev.c-2540-{\nnet/core/dev.c:2541:\tif (!ptype-\u003eaf_packet_priv || !skb-\u003esk)\nnet/core/dev.c-2542-\t\treturn false;\n--\nnet/core/dev.c-2545-\t\treturn ptype-\u003eid_match(ptype, skb-\u003esk);\nnet/core/dev.c:2546:\telse if ((struct sock *)ptype-\u003eaf_packet_priv == skb-\u003esk)\nnet/core/dev.c-2547-\t\treturn true;\n--\nnet/core/net-procfs.c=229=static void *ptype_seq_next(struct seq_file *seq, void *v, loff_t *pos)\n--\nnet/core/net-procfs.c-260-\nnet/core/net-procfs.c:261:\tif (pt-\u003eaf_packet_net) {\nnet/core/net-procfs.c-262-net_ptype_all:\n--\nnet/core/net-procfs.c=293=static int ptype_seq_show(struct seq_file *seq, void *v)\n--\nnet/core/net-procfs.c-303-\tdev = iter-\u003edev;\nnet/core/net-procfs.c:304:\tif ((!pt-\u003eaf_packet_net || net_eq(pt-\u003eaf_packet_net, seq_file_net(seq))) \u0026\u0026\nnet/core/net-procfs.c-305-\t\t (!dev || net_eq(dev_net(dev), seq_file_net(seq)))) {\n--\nnet/core/selftests.c=159=static int net_test_loopback_validate(struct sk_buff *skb,\n--\nnet/core/selftests.c-163-{\nnet/core/selftests.c:164:\tstruct net_test_priv *tpriv = pt-\u003eaf_packet_priv;\nnet/core/selftests.c-165-\tconst unsigned char *src = tpriv-\u003epacket-\u003esrc;\n--\nnet/core/selftests.c=233=static int __net_test_loopback(struct net_device *ndev,\n--\nnet/core/selftests.c-249-\ttpriv-\u003ept.dev = ndev;\nnet/core/selftests.c:250:\ttpriv-\u003ept.af_packet_priv = tpriv;\nnet/core/selftests.c-251-\ttpriv-\u003epacket = attr;\n--\nnet/packet/Kconfig=6=config PACKET\n--\nnet/packet/Kconfig-14-\t To compile this driver as a module, choose M here: the module will\nnet/packet/Kconfig:15:\t be called af_packet.\nnet/packet/Kconfig-16-\n--\nnet/packet/Makefile-5-\nnet/packet/Makefile:6:obj-$(CONFIG_PACKET) += af_packet.o\nnet/packet/Makefile:7:obj-$(CONFIG_PACKET_DIAG) += af_packet_diag.o\nnet/packet/Makefile:8:af_packet_diag-y += diag.o\n--\nnet/packet/af_packet.c=1468=static int packet_rcv_fanout(struct sk_buff *skb, struct net_device *dev,\n--\nnet/packet/af_packet.c-1470-{\nnet/packet/af_packet.c:1471:\tstruct packet_fanout *f = pt-\u003eaf_packet_priv;\nnet/packet/af_packet.c-1472-\tunsigned int num = READ_ONCE(f-\u003enum_members);\n--\nnet/packet/af_packet.c=1559=static bool match_fanout_group(struct packet_type *ptype, struct sock *sk)\n--\nnet/packet/af_packet.c-1563-\nnet/packet/af_packet.c:1564:\treturn ptype-\u003eaf_packet_priv == pkt_sk(sk)-\u003efanout;\nnet/packet/af_packet.c-1565-}\n--\nnet/packet/af_packet.c=1690=static int fanout_add(struct sock *sk, struct fanout_args *args)\n--\nnet/packet/af_packet.c-1783-\t\tmatch-\u003eprot_hook.func = packet_rcv_fanout;\nnet/packet/af_packet.c:1784:\t\tmatch-\u003eprot_hook.af_packet_priv = match;\nnet/packet/af_packet.c:1785:\t\tmatch-\u003eprot_hook.af_packet_net = read_pnet(\u0026match-\u003enet);\nnet/packet/af_packet.c-1786-\t\tmatch-\u003eprot_hook.id_match = match_fanout_group;\n--\nnet/packet/af_packet.c=1869=static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev,\n--\nnet/packet/af_packet.c-1879-\nnet/packet/af_packet.c:1880:\tsk = pt-\u003eaf_packet_priv;\nnet/packet/af_packet.c-1881-\n--\nnet/packet/af_packet.c=2151=static int packet_rcv(struct sk_buff *skb, struct net_device *dev,\n--\nnet/packet/af_packet.c-2164-\nnet/packet/af_packet.c:2165:\tsk = pt-\u003eaf_packet_priv;\nnet/packet/af_packet.c-2166-\tpo = pkt_sk(sk);\n--\nnet/packet/af_packet.c=2264=static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,\n--\nnet/packet/af_packet.c-2293-\nnet/packet/af_packet.c:2294:\tsk = pt-\u003eaf_packet_priv;\nnet/packet/af_packet.c-2295-\tpo = pkt_sk(sk);\n--\nnet/packet/af_packet.c=3381=static int packet_create(struct net *net, struct socket *sock, int protocol,\n--\nnet/packet/af_packet.c-3432-\nnet/packet/af_packet.c:3433:\tpo-\u003eprot_hook.af_packet_priv = sk;\nnet/packet/af_packet.c:3434:\tpo-\u003eprot_hook.af_packet_net = sock_net(sk);\nnet/packet/af_packet.c-3435-\n"
} |
| 9/2 | 2026/08/31 08:08 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 6592 output: 32 thoughts: 20 Thoughts: Here's my take on the thought process: **Diving into the Kernel Packet Configuration** Alright, time to get a handle on the kernel's packet handling configuration. My first step is to crack open the `net/packet/Kconfig` file. I need to understand all the available configuration options and, critically, their dependencies. This is where the core of understanding how various packet features are enabled or disabled lies. I'll be looking for the fundamental building blocks, the core knobs that control the entire packet processing subsystem. Understanding the dependencies is equally important; seeing which options are contingent on others will give me a better view of the overall architecture and potential areas of interaction or conflict. Let's see what `Kconfig` reveals... time to dig in. |
| 10/2 | 2026/08/31 08:08 | tool | read-file |
0mArgs:{
"File": "net/packet/Kconfig",
"FirstLine": 1,
"LineCount": 30
}Results: {
"Contents": " 1:\t# SPDX-License-Identifier: GPL-2.0-only\n 2:\t#\n 3:\t# Packet configuration\n 4:\t#\n 5:\t\n 6:\tconfig PACKET\n 7:\t\ttristate \"Packet socket\"\n 8:\t\thelp\n 9:\t\t The Packet protocol is used by applications which communicate\n 10:\t\t directly with network devices without an intermediate network\n 11:\t\t protocol implemented in the kernel, e.g. tcpdump. If you want them\n 12:\t\t to work, choose Y.\n 13:\t\n 14:\t\t To compile this driver as a module, choose M here: the module will\n 15:\t\t be called af_packet.\n 16:\t\n 17:\t\t If unsure, say Y.\n 18:\t\n 19:\tconfig PACKET_DIAG\n 20:\t\ttristate \"Packet: sockets monitoring interface\"\n 21:\t\tdepends on PACKET\n 22:\t\tdefault n\n 23:\t\thelp\n 24:\t\t Support for PF_PACKET sockets monitoring interface used by the ss tool.\n 25:\t\t If unsure, say Y.\n"
} |
| 11/2 | 2026/08/31 08:08 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 7108 output: 30 thoughts: 168 Thoughts: **VLAN/802.1Q Relevance Check** Okay, let's see if VLAN or 802.1Q is even playing a role here. The code's doing a few things that give me a hunch: `is_vlan = eth_type_vlan(skb->protocol)`, `vlan_get_protocol_and_depth(skb, skb->protocol, &depth)`, and then it's comparing `skb->dev->min_header_len` against `skb->dev->hard_header_len`. That last one has my attention. I'm thinking about VLAN interfaces like 802.1Q subinterfaces or macvlan devices. With VLANs, we often see `hard_header_len` being greater than `min_header_len`, which makes me think `CONFIG_VLAN_8021Q` in the kernel config might be the key. Let me go check that Kconfig option. |
| 12/2 | 2026/08/31 08:08 | tool | grepper |
0mArgs:{
"Expression": "config VLAN_8021Q",
"PathPrefix": "net/"
}Results: {
"Output": "net/8021q/Kconfig-5-\nnet/8021q/Kconfig:6:config VLAN_8021Q\nnet/8021q/Kconfig-7-\ttristate \"802.1Q/802.1ad VLAN Support\"\n--\nnet/8021q/Kconfig-21-\nnet/8021q/Kconfig:22:config VLAN_8021Q_GVRP\nnet/8021q/Kconfig-23-\tbool \"GVRP (GARP VLAN Registration Protocol) support\"\n--\nnet/8021q/Kconfig-31-\nnet/8021q/Kconfig:32:config VLAN_8021Q_MVRP\nnet/8021q/Kconfig-33-\tbool \"MVRP (Multiple VLAN Registration Protocol) support\"\n"
} |
| 13/2 | 2026/08/31 08:08 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 7744 output: 28 thoughts: 105 Thoughts: **Analyzing Packet Socket Header Parsing** Okay, so I need to figure out the most appropriate focus symbols here. First, I need to get a clear picture, a complete understanding of the system, that is. I'll start by tracing the entry points or the callers of `packet_parse_headers` within `af_packet.c`. Let's dig in and see the control flow. Okay, so in `af_packet.c`, I see a few key functions that might be relevant: `packet_sendmsg_spkt`, `tpacket_fill_skb` – which is itself called by either `packet_snd` or `tpacket_snd` – and then `packet_snd` directly. Good. Now that I have a handle on the main functions that interact with the header parsing process, I'll turn my attention towards a thorough examination of how packet sockets transmit packets within `af_packet.c`. This will give me a proper understanding. |
| 14/2 | 2026/08/31 08:08 | tool | grepper |
0mArgs:{
"Expression": "packet_sendmsg",
"PathPrefix": "net/packet/"
}Results: {
"Output": "net/packet/af_packet.c=1935=static void packet_parse_headers(struct sk_buff *skb, struct socket *sock)\n--\nnet/packet/af_packet.c-1977-\nnet/packet/af_packet.c:1978:static int packet_sendmsg_spkt(struct socket *sock, struct msghdr *msg,\nnet/packet/af_packet.c-1979-\t\t\t size_t len)\n--\nnet/packet/af_packet.c=2757=static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)\n--\nnet/packet/af_packet.c-2779-\nnet/packet/af_packet.c:2780:\t/* packet_sendmsg() check on tx_ring.pg_vec was lockless,\nnet/packet/af_packet.c-2781-\t * we need to confirm it under protection of pg_vec_lock.\n--\nnet/packet/af_packet.c=2987=static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)\n--\nnet/packet/af_packet.c-3145-\nnet/packet/af_packet.c:3146:static int packet_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)\nnet/packet/af_packet.c-3147-{\n--\nnet/packet/af_packet.c=4692=static const struct proto_ops packet_ops_spkt = {\n--\nnet/packet/af_packet.c-4705-\t.shutdown =\tsock_no_shutdown,\nnet/packet/af_packet.c:4706:\t.sendmsg =\tpacket_sendmsg_spkt,\nnet/packet/af_packet.c-4707-\t.recvmsg =\tpacket_recvmsg,\n--\nnet/packet/af_packet.c=4711=static const struct proto_ops packet_ops = {\n--\nnet/packet/af_packet.c-4726-\t.getsockopt_iter =\tpacket_getsockopt,\nnet/packet/af_packet.c:4727:\t.sendmsg =\tpacket_sendmsg,\nnet/packet/af_packet.c-4728-\t.recvmsg =\tpacket_recvmsg,\n"
} |
| 15/2 | 2026/08/31 08:08 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 8685 output: 144 thoughts: 680 Thoughts: **Fuzzing Target Assessment: AF_PACKET TX Path** Alright, let's break this down systematically. My initial investigation focused on the transmission (TX) paths within the `af_packet` subsystem. I've identified the key function calls: `packet_sendmsg`, `packet_snd`, and `tpacket_snd`, along with `packet_sendmsg_spkt` which is specific to `packet_ops_spkt`. It's worth noting that `packet_parse_headers` is a static helper used by several of these, particularly `packet_sendmsg_spkt`, `tpacket_fill_skb`, and `packet_snd`. Importantly, `packet_snd`, `packet_sendmsg_spkt`, `packet_sendmsg`, and `tpacket_snd` constitute the primary TX entry points. The core question is whether this area is suitable for fuzzing, and the answer is a resounding yes. The code in question touches reachable kernel networking logic within `af_packet.c`. Specifically, it appears to modify the `network_header` for non-VLAN `SOCK_RAW` frames on Ethernet devices where `hard_header_len > min_header_len`. This functional change focuses on the parsing of headers for raw frames sent via packet sockets. The attack surface is easily accessible via standard socket syscalls, namely `socket(AF_PACKET, SOCK_RAW, ...)` and `sendto()`/`sendmsg()`. This makes it ideal for fuzzing. Now, let's solidify the requirements for effective fuzzing. We need to define two crucial components: `FocusSymbols` and `EnableConfigs`. For the `FocusSymbols`, I've selected the main entry points: `packet_sendmsg`, `packet_sendmsg_spkt`, `packet_snd`, and `tpacket_snd`. Although `packet_parse_headers` is relevant, I prefer the non-static entry points for fuzzing. For `EnableConfigs`, we need to ensure the necessary kernel configurations are enabled. Specifically, `PACKET` is essential (duh), and `VLAN_8021Q` is beneficial because it helps trigger the `min_header_len < hard_header_len` condition, as highlighted in the associated comments. I verified these mappings in the relevant Kconfig files (`net/packet/Kconfig` and `net/8021q/Kconfig`). Finally, a quick sanity check to ensure everything is in order: * `EnableConfigs`: `["PACKET", "VLAN_8021Q"]` * `FocusSymbols`: `["packet_sendmsg", "packet_sendmsg_spkt", "packet_snd", "tpacket_snd"]` * `WorthFuzzing`: `true` * `Reasoning`: Concise and functional analysis, justifying the fuzzing decision. With this comprehensive analysis complete, I'm confident we can proceed with fuzzing this target. Let's call `set-results`. |
| 16/2 | 2026/08/31 08:08 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"PACKET",
"VLAN_8021Q"
],
"FocusSymbols": [
"packet_sendmsg",
"packet_sendmsg_spkt",
"packet_snd",
"tpacket_snd"
],
"Reasoning": "The patch modifies header parsing in af_packet (packet_parse_headers) for SOCK_RAW packet sockets over Ethernet devices where hard_header_len exceeds min_header_len. This changes the network and transport header offsets used during transmission and GSO, affecting reachable core networking code that can be exercised via AF_PACKET sockets.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"PACKET",
"VLAN_8021Q"
],
"FocusSymbols": [
"packet_sendmsg",
"packet_sendmsg_spkt",
"packet_snd",
"tpacket_snd"
],
"Reasoning": "The patch modifies header parsing in af_packet (packet_parse_headers) for SOCK_RAW packet sockets over Ethernet devices where hard_header_len exceeds min_header_len. This changes the network and transport header offsets used during transmission and GSO, affecting reachable core networking code that can be exercised via AF_PACKET sockets.",
"WorthFuzzing": true
} |
| 17/1 | 2026/08/31 08:08 | action | If |
0mArgs:{
"WorthFuzzing": true
}Results: null |
| 18/2 | 2026/08/31 08:08 | agent | kmsan-evaluator |
0mModel:core Args: null Results: {
"KMSANReasoning": "The patch updates `packet_parse_headers()` in `net/packet/af_packet.c` to properly position the network header offset for non-VLAN `SOCK_RAW` frames on Ethernet devices where `min_header_len \u003c hard_header_len`.\n\nKMSAN vs KASAN Applicability:\n- **KMSAN**: KMSAN detects use of uninitialized memory (stack, heap, page allocations) and uninitialized data leaks to user space. The patch introduces a single boolean local variable (`is_vlan`), which is explicitly initialized to `false` and set to `eth_type_vlan(skb-\u003eprotocol)`. It does not allocate new structures, copy uninitialized data to user space, or introduce branching on uninitialized variables.\n- **KASAN / Standard Sanitizers**: The changes only adjust internal `skb` header offsets (`mac_header`, `network_header`, `transport_header`) for packet transmission. Any potential offset or sizing issues affecting payload bounds during packet parsing or GSO would be out-of-bounds/bounds-check issues detectable by standard KASAN.\n\nTherefore, this patch does not introduce uninitialized memory risks and does not warrant a dedicated KMSAN fuzzing session.",
"NeedsKMSAN": false
}Instruction: You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.
CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
a comprehensive suite of debugging tools and sanitizers, including KASAN
(out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
(locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
or page allocations) and kernel-to-user memory info-leaks.
Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.
Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.
Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
attributes, ioctl output arguments, socket options, or BPF buffers) where fields
or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
uninitialized bytes of existing buffers.
Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
dereferences, locking deadlocks, or use-after-free bugs (these are already caught
by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.
Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: For your convenience, here is the diff of the changes:
commit 2a277378b05492f5dd1c15666ecdd609cad581a6
Author: syz-cluster <triage@syzkaller.com>
Date: Mon Aug 31 08:08:10 2026 +0000
syz-cluster: applied patch under review
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 1168bd6b09cd6..be5bf9db7ea15 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1935,6 +1935,7 @@ static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev,
static void packet_parse_headers(struct sk_buff *skb, struct socket *sock)
{
int depth;
+ bool is_vlan = false;
/* On TX skb->data is the L2 header; anchor it for all socket types. */
skb_reset_mac_header(skb);
@@ -1943,11 +1944,28 @@ static void packet_parse_headers(struct sk_buff *skb, struct socket *sock)
sock->type == SOCK_RAW)
skb->protocol = dev_parse_header_protocol(skb);
+ if (likely(skb->dev->type == ARPHRD_ETHER)) {
+ is_vlan = eth_type_vlan(skb->protocol);
+
+ /* For non-VLAN SOCK_RAW frames on Ethernet devices whose
+ * hard_header_len exceeds the on-wire L2 header length
+ * (min_header_len) -- e.g. software-offload VLAN subinterfaces,
+ * or Ethernet drivers that reserve extra space in
+ * hard_header_len for driver-internal wrapping -- the SOCK_RAW
+ * send paths leave network_header at hard_header_len, while the
+ * user frame's L3 sits at min_header_len. Move network_header
+ * to the actual L2/L3 boundary so the transport header probe
+ * below and subsequent GSO see the right L3.
+ */
+ if (!is_vlan && sock->type == SOCK_RAW &&
+ skb->dev->min_header_len < skb->dev->hard_header_len)
+ skb_set_network_header(skb, skb->dev->min_header_len);
+ }
+
skb_probe_transport_header(skb);
/* Move network header to the right position for VLAN tagged packets */
- if (likely(skb->dev->type == ARPHRD_ETHER) &&
- eth_type_vlan(skb->protocol) &&
+ if (is_vlan &&
vlan_get_protocol_and_depth(skb, skb->protocol, &depth) != 0)
skb_set_network_header(skb, depth);
}
|
| 19/3 | 2026/08/31 08:08 | llm | kmsan-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 2563 output: 38 thoughts: 161 Thoughts: **Assessing the Need for a Dedicated KMSAN Fuzzing Session** Okay, I need to figure out if this patch to `net/packet/af_packet.c` warrants a full-blown KMSAN fuzzing session within syzkaller. Let's break this down systematically, the way I always do. First, risk assessment. No red flags here. This isn't about offensive code, exploit generation, or anything malicious. It's a straight-up code review/security assessment and fuzzing configuration decision. I classify this as "Benign" - developer tooling/kernel fuzzing analysis. The request is fully fulfillable. Good. Now, let's dive into the specifics. The patch is touching `packet_parse_headers` in `net/packet/af_packet.c`. Time to get a close look. I'll read around line 1935 in `net/packet/af_packet.c`, probably using `read-file` or `grepper` – whatever's fastest. I need to understand the context and the potential impact of the changes to make a well-informed decision. Let's see what's actually going on. |
| 20/3 | 2026/08/31 08:08 | tool | read-file |
0mArgs:{
"File": "net/packet/af_packet.c",
"FirstLine": 1930,
"LineCount": 50
}Results: {
"Contents": "1930:\t\tkfree_skb(skb);\n1931:\toom:\n1932:\t\treturn 0;\n1933:\t}\n1934:\t\n1935:\tstatic void packet_parse_headers(struct sk_buff *skb, struct socket *sock)\n1936:\t{\n1937:\t\tint depth;\n1938:\t\tbool is_vlan = false;\n1939:\t\n1940:\t\t/* On TX skb-\u003edata is the L2 header; anchor it for all socket types. */\n1941:\t\tskb_reset_mac_header(skb);\n1942:\t\n1943:\t\tif ((!skb-\u003eprotocol || skb-\u003eprotocol == htons(ETH_P_ALL)) \u0026\u0026\n1944:\t\t sock-\u003etype == SOCK_RAW)\n1945:\t\t\tskb-\u003eprotocol = dev_parse_header_protocol(skb);\n1946:\t\n1947:\t\tif (likely(skb-\u003edev-\u003etype == ARPHRD_ETHER)) {\n1948:\t\t\tis_vlan = eth_type_vlan(skb-\u003eprotocol);\n1949:\t\n1950:\t\t\t/* For non-VLAN SOCK_RAW frames on Ethernet devices whose\n1951:\t\t\t * hard_header_len exceeds the on-wire L2 header length\n1952:\t\t\t * (min_header_len) -- e.g. software-offload VLAN subinterfaces,\n1953:\t\t\t * or Ethernet drivers that reserve extra space in\n1954:\t\t\t * hard_header_len for driver-internal wrapping -- the SOCK_RAW\n1955:\t\t\t * send paths leave network_header at hard_header_len, while the\n1956:\t\t\t * user frame's L3 sits at min_header_len. Move network_header\n1957:\t\t\t * to the actual L2/L3 boundary so the transport header probe\n1958:\t\t\t * below and subsequent GSO see the right L3.\n1959:\t\t\t */\n1960:\t\t\tif (!is_vlan \u0026\u0026 sock-\u003etype == SOCK_RAW \u0026\u0026\n1961:\t\t\t skb-\u003edev-\u003emin_header_len \u003c skb-\u003edev-\u003ehard_header_len)\n1962:\t\t\t\tskb_set_network_header(skb, skb-\u003edev-\u003emin_header_len);\n1963:\t\t}\n1964:\t\n1965:\t\tskb_probe_transport_header(skb);\n1966:\t\n1967:\t\t/* Move network header to the right position for VLAN tagged packets */\n1968:\t\tif (is_vlan \u0026\u0026\n1969:\t\t vlan_get_protocol_and_depth(skb, skb-\u003eprotocol, \u0026depth) != 0)\n1970:\t\t\tskb_set_network_header(skb, depth);\n1971:\t}\n1972:\t\n1973:\t/*\n1974:\t *\tOutput a raw packet to a device layer. This bypasses all the other\n1975:\t *\tprotocol layers and you must therefore supply it with a complete frame\n1976:\t */\n1977:\t\n1978:\tstatic int packet_sendmsg_spkt(struct socket *sock, struct msghdr *msg,\n1979:\t\t\t\t size_t len)\n"
} |
| 21/3 | 2026/08/31 08:08 | llm | kmsan-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 3876 output: 34 thoughts: 26 Thoughts: Here's my thought process, as if I were considering this code: **Finding the Callers of `packet_parse_headers`** Okay, so I need to track down the call sites for `packet_parse_headers` within the `net/packet/af_packet.c` file. No problem. That's a relatively straightforward task for a good code search. I'll need to use my preferred tool, which I'm assuming is either `grep`, `ack`, `ripgrep`, or perhaps even my IDE's built-in search functionality, depending on what I'm working with at the moment. The goal is to identify all instances where this function is invoked. Once I have the list of calling functions, I can then examine each one to understand the context in which `packet_parse_headers` is being used and what the upstream data flow looks like. This is foundational to any real understanding of how this portion of the networking stack works. I'll be looking for clues about the type of packets being processed, error handling, and any associated data structures or locking. It's time to dig in. |
| 22/3 | 2026/08/31 08:09 | tool | grepper |
0mArgs:{
"Expression": "packet_parse_headers",
"PathPrefix": "net/packet/af_packet.c"
}Results: {
"Output": "net/packet/af_packet.c=1869=static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev,\n--\nnet/packet/af_packet.c-1934-\nnet/packet/af_packet.c:1935:static void packet_parse_headers(struct sk_buff *skb, struct socket *sock)\nnet/packet/af_packet.c-1936-{\n--\nnet/packet/af_packet.c=1978=static int packet_sendmsg_spkt(struct socket *sock, struct msghdr *msg,\n--\nnet/packet/af_packet.c-2095-\nnet/packet/af_packet.c:2096:\tpacket_parse_headers(skb, sock);\nnet/packet/af_packet.c-2097-\n--\nnet/packet/af_packet.c=2605=static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,\n--\nnet/packet/af_packet.c-2683-\nnet/packet/af_packet.c:2684:\tpacket_parse_headers(skb, sock);\nnet/packet/af_packet.c-2685-\n--\nnet/packet/af_packet.c=2987=static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)\n--\nnet/packet/af_packet.c-3114-\nnet/packet/af_packet.c:3115:\tpacket_parse_headers(skb, sock);\nnet/packet/af_packet.c-3116-\n"
} |
| 23/3 | 2026/08/31 08:09 | llm | kmsan-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 4609 output: 38 thoughts: 47 Thoughts: Okay, let's dive into this code. I need to understand the control flow, so I'll start by dissecting `packet_parse_headers`. I want to see exactly how it processes the data and, more importantly, what contextual information the callers are providing. Understanding the inputs and outputs is crucial for grasping its role in the larger system. Then, I'll need to follow the data path to see how the parsed headers are used. I'll look into `packet_snd`, `packet_sendmsg_spkt`, and `tpacket_fill_skb`. Examining these functions will illuminate how the parsed headers inform the actual packet transmission process. I need to see how the headers are packaged into the packet and what considerations are made for different transmission methods. By understanding the interaction of these components, I should gain a solid understanding of this aspect of the networking stack. |
| 24/3 | 2026/08/31 08:09 | tool | read-file |
0mArgs:{
"File": "net/packet/af_packet.c",
"FirstLine": 3080,
"LineCount": 50
}Results: {
"Contents": "3080:\t\t} else if (reserve) {\n3081:\t\t\tskb_reserve(skb, -reserve);\n3082:\t\t\tif (len \u003c reserve + sizeof(struct ipv6hdr) \u0026\u0026\n3083:\t\t\t dev-\u003emin_header_len != hard_header_len)\n3084:\t\t\t\tskb_reset_network_header(skb);\n3085:\t\t}\n3086:\t\n3087:\t\t/* Returns -EFAULT on error */\n3088:\t\terr = skb_copy_datagram_from_iter(skb, offset, \u0026msg-\u003emsg_iter, len);\n3089:\t\tif (err)\n3090:\t\t\tgoto out_free;\n3091:\t\n3092:\t\tif ((sock-\u003etype == SOCK_RAW \u0026\u0026\n3093:\t\t !dev_validate_header(dev, skb-\u003edata, len)) || !skb-\u003elen) {\n3094:\t\t\terr = -EINVAL;\n3095:\t\t\tgoto out_free;\n3096:\t\t}\n3097:\t\n3098:\t\tskb_setup_tx_timestamp(skb, \u0026sockc);\n3099:\t\n3100:\t\tif (!vnet_hdr.gso_type \u0026\u0026 (len \u003e dev-\u003emtu + reserve + extra_len) \u0026\u0026\n3101:\t\t !packet_extra_vlan_len_allowed(dev, skb)) {\n3102:\t\t\terr = -EMSGSIZE;\n3103:\t\t\tgoto out_free;\n3104:\t\t}\n3105:\t\n3106:\t\tskb-\u003eprotocol = proto;\n3107:\t\tskb-\u003edev = dev;\n3108:\t\tskb-\u003epriority = sockc.priority;\n3109:\t\tskb-\u003emark = sockc.mark;\n3110:\t\tskb_set_delivery_type_by_clockid(skb, sockc.transmit_time, sk-\u003esk_clockid);\n3111:\t\n3112:\t\tif (unlikely(extra_len == 4))\n3113:\t\t\tskb-\u003eno_fcs = 1;\n3114:\t\n3115:\t\tpacket_parse_headers(skb, sock);\n3116:\t\n3117:\t\tif (vnet_hdr_sz) {\n3118:\t\t\terr = virtio_net_hdr_to_skb(skb, \u0026vnet_hdr, vio_le());\n3119:\t\t\tif (err)\n3120:\t\t\t\tgoto out_free;\n3121:\t\t\tlen += vnet_hdr_sz;\n3122:\t\t\tvirtio_net_hdr_set_proto(skb, \u0026vnet_hdr);\n3123:\t\t}\n3124:\t\n3125:\t\terr = packet_xmit(po, skb);\n3126:\t\n3127:\t\tif (unlikely(err != 0)) {\n3128:\t\t\tif (err \u003e 0)\n3129:\t\t\t\terr = net_xmit_errno(err);\n"
} |
| 25/3 | 2026/08/31 08:09 | llm | kmsan-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 5683 output: 287 thoughts: 873 Thoughts: **Analyzing the Patch for KMSAN Implications** Okay, let's break this down. My initial focus is on whether this patch introduces any uninitialized memory reads that KMSAN would catch. The code changes are in `packet_parse_headers`, specifically for non-VLAN `SOCK_RAW` frames on Ethernet devices. What's happening is an adjustment to the network header offset using `skb_set_network_header` when `skb->dev->min_header_len` is less than `skb->dev->hard_header_len`, after which `skb_probe_transport_header` is called, and then the VLAN check if applicable. First, I need to look at the criteria for a KMSAN issue: kernel data sent to user space, conditional logic based on uninitialized data, new data structure allocations with potential uninitialized fields, and bounds check vulnerabilities that might lead to reading uninitialized memory. From my review, none of these are triggered. This patch deals with TX parsing in `af_packet`, no kernel memory is being copied to user space. The `is_vlan` variable is initialized correctly. There are no new allocations or any changes to the allocation routines. The skb buffer payload is copied from user space, and adjusting the network header offset just changes where the kernel looks within that pre-existing buffer from user space, so, no reads of uninitialized kernel memory. Even if `min_header_len` and `skb->len` caused an out-of-bounds access, that would be a KASAN issue (bounds-check) not a KMSAN issue (uninitialized memory read). To recap, the patch primarily adjusts the network header offset for certain types of raw packet sockets. KMSAN is for uninitialized memory reads, not bounds checking. Here's my clear conclusion: there's no evidence of KMSAN-related problems here. The patch doesn't introduce any new allocations of uninitialized memory and no information leakage to user space. The variables it uses are properly initialized. So, based on my expert review, I'm confident in saying that `NeedsKMSAN = false`. I'm going to set the results. |
| 26/3 | 2026/08/31 08:09 | tool | set-results |
0mArgs:{
"KMSANReasoning": "The patch updates `packet_parse_headers()` in `net/packet/af_packet.c` to properly position the network header offset for non-VLAN `SOCK_RAW` frames on Ethernet devices where `min_header_len \u003c hard_header_len`.\n\nKMSAN vs KASAN Applicability:\n- **KMSAN**: KMSAN detects use of uninitialized memory (stack, heap, page allocations) and uninitialized data leaks to user space. The patch introduces a single boolean local variable (`is_vlan`), which is explicitly initialized to `false` and set to `eth_type_vlan(skb-\u003eprotocol)`. It does not allocate new structures, copy uninitialized data to user space, or introduce branching on uninitialized variables.\n- **KASAN / Standard Sanitizers**: The changes only adjust internal `skb` header offsets (`mac_header`, `network_header`, `transport_header`) for packet transmission. Any potential offset or sizing issues affecting payload bounds during packet parsing or GSO would be out-of-bounds/bounds-check issues detectable by standard KASAN.\n\nTherefore, this patch does not introduce uninitialized memory risks and does not warrant a dedicated KMSAN fuzzing session.",
"NeedsKMSAN": false
}Results: {
"KMSANReasoning": "The patch updates `packet_parse_headers()` in `net/packet/af_packet.c` to properly position the network header offset for non-VLAN `SOCK_RAW` frames on Ethernet devices where `min_header_len \u003c hard_header_len`.\n\nKMSAN vs KASAN Applicability:\n- **KMSAN**: KMSAN detects use of uninitialized memory (stack, heap, page allocations) and uninitialized data leaks to user space. The patch introduces a single boolean local variable (`is_vlan`), which is explicitly initialized to `false` and set to `eth_type_vlan(skb-\u003eprotocol)`. It does not allocate new structures, copy uninitialized data to user space, or introduce branching on uninitialized variables.\n- **KASAN / Standard Sanitizers**: The changes only adjust internal `skb` header offsets (`mac_header`, `network_header`, `transport_header`) for packet transmission. Any potential offset or sizing issues affecting payload bounds during packet parsing or GSO would be out-of-bounds/bounds-check issues detectable by standard KASAN.\n\nTherefore, this patch does not introduce uninitialized memory risks and does not warrant a dedicated KMSAN fuzzing session.",
"NeedsKMSAN": false
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|