| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/05 09:16 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": [
"BRIDGE",
"BRIDGE_CFM",
"BRIDGE_MRP"
],
"FocusSymbols": [
"br_add_frame",
"br_del_frame",
"br_del_frame_all",
"br_cfm_mep_create",
"br_cfm_mep_delete",
"br_mrp_add",
"br_mrp_del",
"br_dev_delete"
],
"KMSANReasoning": "The patch modifies how ethernet frame handlers (such as CFM and MRP) are registered in the bridge module. Instead of using static global `struct br_frame_type` variables, it dynamically allocates `struct br_frame_type` using `kmalloc_obj` and protects its removal with `kfree_rcu`.\n\nAll fields (`type`, `frame_handler`, and `list`) accessed by `br_process_frame_type` and list traversal functions are explicitly initialized before insertion into `br-\u003eframe_type_list`. None of these structures are exposed or copied to user space, nor are any uninitialized variables used in conditional branching or calculations. Any potential bugs (such as RCU synchronization issues, use-after-free, or memory leaks) are covered by KASAN and standard kernel debuggers. Therefore, a dedicated KMSAN fuzzing session is not needed.",
"NeedsKMSAN": false,
"Reasoning": "The patch refactors the bridge Ethernet frame type handler registration/deregistration mechanism. Previously, statically allocated frame type structures (such as cfm_frame_type and mrp_frame_type) were registered directly to bridge instances, which could lead to list corruption across multiple bridges. The patch changes this to dynamic per-bridge allocation and RCU-based freeing of frame type nodes, introduces error handling on allocation failure, and adds cleanup of all registered frame types during bridge device deletion (br_dev_delete). These reachable core networking changes warrant fuzzing to uncover potential memory leaks, concurrency issues, or error handling regressions.",
"WorthFuzzing": true
} |
| 1/1 | 2026/09/05 09:16 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit b66fda227b229c0afcf20e395171252963af6619\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Sat Sep 5 09:16:44 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/net/bridge/br_cfm.c b/net/bridge/br_cfm.c\nindex dea56fffa1c19..5790248588298 100644\n--- a/net/bridge/br_cfm.c\n+++ b/net/bridge/br_cfm.c\n@@ -489,11 +489,6 @@ static int br_cfm_frame_rx(struct net_bridge_port *port, struct sk_buff *skb)\n \treturn 1;\n }\n \n-static struct br_frame_type cfm_frame_type __read_mostly = {\n-\t.type = cpu_to_be16(ETH_P_CFM),\n-\t.frame_handler = br_cfm_frame_rx,\n-};\n-\n int br_cfm_mep_create(struct net_bridge *br,\n \t\t const u32 instance,\n \t\t struct br_cfm_mep_create *const create,\n@@ -501,6 +496,7 @@ int br_cfm_mep_create(struct net_bridge *br,\n {\n \tstruct net_bridge_port *p;\n \tstruct br_cfm_mep *mep;\n+\tint err;\n \n \tASSERT_RTNL();\n \n@@ -558,8 +554,13 @@ int br_cfm_mep_create(struct net_bridge *br,\n \tINIT_HLIST_HEAD(\u0026mep-\u003epeer_mep_list);\n \tINIT_DELAYED_WORK(\u0026mep-\u003eccm_tx_dwork, ccm_tx_work_expired);\n \n-\tif (hlist_empty(\u0026br-\u003emep_list))\n-\t\tbr_add_frame(br, \u0026cfm_frame_type);\n+\tif (hlist_empty(\u0026br-\u003emep_list)) {\n+\t\terr = br_add_frame(br, cpu_to_be16(ETH_P_CFM), br_cfm_frame_rx);\n+\t\tif (err) {\n+\t\t\tkfree(mep);\n+\t\t\treturn err;\n+\t\t}\n+\t}\n \n \thlist_add_tail_rcu(\u0026mep-\u003ehead, \u0026br-\u003emep_list);\n \n@@ -588,7 +589,7 @@ static void mep_delete_implementation(struct net_bridge *br,\n \tkfree_rcu(mep, rcu);\n \n \tif (hlist_empty(\u0026br-\u003emep_list))\n-\t\tbr_del_frame(br, \u0026cfm_frame_type);\n+\t\tbr_del_frame(br, cpu_to_be16(ETH_P_CFM));\n }\n \n int br_cfm_mep_delete(struct net_bridge *br,\ndiff --git a/net/bridge/br_if.c b/net/bridge/br_if.c\nindex c52613431f886..fe8e9a47e1ac1 100644\n--- a/net/bridge/br_if.c\n+++ b/net/bridge/br_if.c\n@@ -397,6 +397,8 @@ void br_dev_delete(struct net_device *dev, struct list_head *head)\n \ttimer_shutdown_sync(\u0026br-\u003etcn_timer);\n \tcancel_delayed_work_sync(\u0026br-\u003egc_work);\n \n+\tbr_del_frame_all(br);\n+\n \tbr_sysfs_delbr(br-\u003edev);\n \tunregister_netdevice_queue(br-\u003edev, head);\n }\ndiff --git a/net/bridge/br_input.c b/net/bridge/br_input.c\nindex d87a5f9fa92b7..07efd0fbcf9cd 100644\n--- a/net/bridge/br_input.c\n+++ b/net/bridge/br_input.c\n@@ -468,18 +468,48 @@ rx_handler_func_t *br_get_rx_handler(const struct net_device *dev)\n \treturn br_handle_frame;\n }\n \n-void br_add_frame(struct net_bridge *br, struct br_frame_type *ft)\n+int br_add_frame(struct net_bridge *br, __be16 type,\n+\t\t int (*frame_handler)(struct net_bridge_port *port,\n+\t\t\t\t struct sk_buff *skb))\n {\n+\tstruct br_frame_type *ft;\n+\n+\thlist_for_each_entry(ft, \u0026br-\u003eframe_type_list, list) {\n+\t\tif (ft-\u003etype == type)\n+\t\t\treturn -EEXIST;\n+\t}\n+\n+\tft = kmalloc_obj(*ft);\n+\tif (!ft)\n+\t\treturn -ENOMEM;\n+\n+\tft-\u003etype = type;\n+\tft-\u003eframe_handler = frame_handler;\n \thlist_add_head_rcu(\u0026ft-\u003elist, \u0026br-\u003eframe_type_list);\n+\n+\treturn 0;\n }\n \n-void br_del_frame(struct net_bridge *br, struct br_frame_type *ft)\n+void br_del_frame(struct net_bridge *br, __be16 type)\n {\n-\tstruct br_frame_type *tmp;\n+\tstruct br_frame_type *ft;\n \n-\thlist_for_each_entry(tmp, \u0026br-\u003eframe_type_list, list)\n-\t\tif (ft == tmp) {\n+\thlist_for_each_entry(ft, \u0026br-\u003eframe_type_list, list) {\n+\t\tif (ft-\u003etype == type) {\n \t\t\thlist_del_rcu(\u0026ft-\u003elist);\n+\t\t\tkfree_rcu(ft, rcu);\n \t\t\treturn;\n \t\t}\n+\t}\n+}\n+\n+void br_del_frame_all(struct net_bridge *br)\n+{\n+\tstruct br_frame_type *ft;\n+\tstruct hlist_node *n;\n+\n+\thlist_for_each_entry_safe(ft, n, \u0026br-\u003eframe_type_list, list) {\n+\t\thlist_del_rcu(\u0026ft-\u003elist);\n+\t\tkfree_rcu(ft, rcu);\n+\t}\n }\ndiff --git a/net/bridge/br_mrp.c b/net/bridge/br_mrp.c\nindex ef16d07039241..511ae8af3d033 100644\n--- a/net/bridge/br_mrp.c\n+++ b/net/bridge/br_mrp.c\n@@ -8,11 +8,6 @@ static const u8 mrp_in_test_dmac[ETH_ALEN] = { 0x1, 0x15, 0x4e, 0x0, 0x0, 0x3 };\n \n static int br_mrp_process(struct net_bridge_port *p, struct sk_buff *skb);\n \n-static struct br_frame_type mrp_frame_type __read_mostly = {\n-\t.type = cpu_to_be16(ETH_P_MRP),\n-\t.frame_handler = br_mrp_process,\n-};\n-\n static bool br_mrp_is_ring_port(struct net_bridge_port *p_port,\n \t\t\t\tstruct net_bridge_port *s_port,\n \t\t\t\tstruct net_bridge_port *port)\n@@ -486,7 +481,7 @@ static void br_mrp_del_impl(struct net_bridge *br, struct br_mrp *mrp)\n \tkfree_rcu(mrp, rcu);\n \n \tif (hlist_empty(\u0026br-\u003emrp_list))\n-\t\tbr_del_frame(br, \u0026mrp_frame_type);\n+\t\tbr_del_frame(br, cpu_to_be16(ETH_P_MRP));\n }\n \n /* Adds a new MRP instance.\n@@ -535,13 +530,16 @@ int br_mrp_add(struct net_bridge *br, struct br_mrp_instance *instance)\n \tspin_unlock_bh(\u0026br-\u003elock);\n \trcu_assign_pointer(mrp-\u003es_port, p);\n \n-\tif (hlist_empty(\u0026br-\u003emrp_list))\n-\t\tbr_add_frame(br, \u0026mrp_frame_type);\n-\n \tINIT_DELAYED_WORK(\u0026mrp-\u003etest_work, br_mrp_test_work_expired);\n \tINIT_DELAYED_WORK(\u0026mrp-\u003ein_test_work, br_mrp_in_test_work_expired);\n \thlist_add_tail_rcu(\u0026mrp-\u003elist, \u0026br-\u003emrp_list);\n \n+\tif (hlist_is_singular_node(\u0026mrp-\u003elist, \u0026br-\u003emrp_list)) {\n+\t\terr = br_add_frame(br, cpu_to_be16(ETH_P_MRP), br_mrp_process);\n+\t\tif (err)\n+\t\t\tgoto delete_mrp;\n+\t}\n+\n \terr = br_mrp_switchdev_add(br, mrp);\n \tif (err)\n \t\tgoto delete_mrp;\ndiff --git a/net/bridge/br_private.h b/net/bridge/br_private.h\nindex d337b1cfb980d..5163017feb74d 100644\n--- a/net/bridge/br_private.h\n+++ b/net/bridge/br_private.h\n@@ -937,10 +937,14 @@ struct br_frame_type {\n \tint\t\t\t(*frame_handler)(struct net_bridge_port *port,\n \t\t\t\t\t\t struct sk_buff *skb);\n \tstruct hlist_node\tlist;\n+\tstruct rcu_head\t\trcu;\n };\n \n-void br_add_frame(struct net_bridge *br, struct br_frame_type *ft);\n-void br_del_frame(struct net_bridge *br, struct br_frame_type *ft);\n+int br_add_frame(struct net_bridge *br, __be16 type,\n+\t\t int (*frame_handler)(struct net_bridge_port *port,\n+\t\t\t\t struct sk_buff *skb));\n+void br_del_frame(struct net_bridge *br, __be16 type);\n+void br_del_frame_all(struct net_bridge *br);\n \n static inline bool br_rx_handler_check_rcu(const struct net_device *dev)\n {\n"
} |
| 2/1 | 2026/09/05 09:16 | agent | patch-evaluator |
0mModel:core Args: null Results: {
"EnableConfigs": [
"BRIDGE",
"BRIDGE_CFM",
"BRIDGE_MRP"
],
"FocusSymbols": [
"br_add_frame",
"br_del_frame",
"br_del_frame_all",
"br_cfm_mep_create",
"br_cfm_mep_delete",
"br_mrp_add",
"br_mrp_del",
"br_dev_delete"
],
"Reasoning": "The patch refactors the bridge Ethernet frame type handler registration/deregistration mechanism. Previously, statically allocated frame type structures (such as cfm_frame_type and mrp_frame_type) were registered directly to bridge instances, which could lead to list corruption across multiple bridges. The patch changes this to dynamic per-bridge allocation and RCU-based freeing of frame type nodes, introduces error handling on allocation failure, and adds cleanup of all registered frame types during bridge device deletion (br_dev_delete). These reachable core networking changes warrant fuzzing to uncover potential memory leaks, concurrency issues, or error handling regressions.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.
IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.
================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.
- REACHABILITY IS THE PRIMARY GATE:
Fuzzing can only discover bugs in code that can actually execute in standard virtualized
environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
regardless of whether it adds assertions or complex logic.
- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
Patch authors routinely label changes as "cleanups", "refactorings", or state
"No functional change intended". Do NOT take these claims at face value.
Code refactorings that rearrange logic, introduce helper functions, or alter state management
in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
If reachable executable code is modified or refactored, it MUST be fuzzed.
- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
Even if the author believes the invariant always holds, fuzzing is essential to verify whether
an unusual sequence of operations can violate it.
================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:
- Non-kernel and non-executable changes:
* Modifications to Documentation/, comments, or spelling fixes.
* User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
that do not affect the compiled kernel image (vmlinux) or kernel modules.
* Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
that do not alter control flow or data structures.
* Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
* Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
* Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
physical PCI hot-unplug or manual sysfs driver unbinding.
* Code paths exclusive to architectures other than the target architecture.
================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
* Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
* Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
* Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
* Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).
================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:
- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
Do NOT list generic, ubiquitous functions called by almost every program in the corpus
(including, but not limited to: general memory allocators and deallocators, page fault
and trap handlers, or core synchronization primitives; this is not an exhaustive list).
Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
which severely dilutes fuzzing effort away from the actual changes.
- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
List functions that specifically implement the logic being added or altered, or direct API entrypoints
for the subsystem feature under review.
- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).
================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any '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: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit b66fda227b229c0afcf20e395171252963af6619
Author: syz-cluster <triage@syzkaller.com>
Date: Sat Sep 5 09:16:44 2026 +0000
syz-cluster: applied patch under review
diff --git a/net/bridge/br_cfm.c b/net/bridge/br_cfm.c
index dea56fffa1c19..5790248588298 100644
--- a/net/bridge/br_cfm.c
+++ b/net/bridge/br_cfm.c
@@ -489,11 +489,6 @@ static int br_cfm_frame_rx(struct net_bridge_port *port, struct sk_buff *skb)
return 1;
}
-static struct br_frame_type cfm_frame_type __read_mostly = {
- .type = cpu_to_be16(ETH_P_CFM),
- .frame_handler = br_cfm_frame_rx,
-};
-
int br_cfm_mep_create(struct net_bridge *br,
const u32 instance,
struct br_cfm_mep_create *const create,
@@ -501,6 +496,7 @@ int br_cfm_mep_create(struct net_bridge *br,
{
struct net_bridge_port *p;
struct br_cfm_mep *mep;
+ int err;
ASSERT_RTNL();
@@ -558,8 +554,13 @@ int br_cfm_mep_create(struct net_bridge *br,
INIT_HLIST_HEAD(&mep->peer_mep_list);
INIT_DELAYED_WORK(&mep->ccm_tx_dwork, ccm_tx_work_expired);
- if (hlist_empty(&br->mep_list))
- br_add_frame(br, &cfm_frame_type);
+ if (hlist_empty(&br->mep_list)) {
+ err = br_add_frame(br, cpu_to_be16(ETH_P_CFM), br_cfm_frame_rx);
+ if (err) {
+ kfree(mep);
+ return err;
+ }
+ }
hlist_add_tail_rcu(&mep->head, &br->mep_list);
@@ -588,7 +589,7 @@ static void mep_delete_implementation(struct net_bridge *br,
kfree_rcu(mep, rcu);
if (hlist_empty(&br->mep_list))
- br_del_frame(br, &cfm_frame_type);
+ br_del_frame(br, cpu_to_be16(ETH_P_CFM));
}
int br_cfm_mep_delete(struct net_bridge *br,
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index c52613431f886..fe8e9a47e1ac1 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -397,6 +397,8 @@ void br_dev_delete(struct net_device *dev, struct list_head *head)
timer_shutdown_sync(&br->tcn_timer);
cancel_delayed_work_sync(&br->gc_work);
+ br_del_frame_all(br);
+
br_sysfs_delbr(br->dev);
unregister_netdevice_queue(br->dev, head);
}
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index d87a5f9fa92b7..07efd0fbcf9cd 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -468,18 +468,48 @@ rx_handler_func_t *br_get_rx_handler(const struct net_device *dev)
return br_handle_frame;
}
-void br_add_frame(struct net_bridge *br, struct br_frame_type *ft)
+int br_add_frame(struct net_bridge *br, __be16 type,
+ int (*frame_handler)(struct net_bridge_port *port,
+ struct sk_buff *skb))
{
+ struct br_frame_type *ft;
+
+ hlist_for_each_entry(ft, &br->frame_type_list, list) {
+ if (ft->type == type)
+ return -EEXIST;
+ }
+
+ ft = kmalloc_obj(*ft);
+ if (!ft)
+ return -ENOMEM;
+
+ ft->type = type;
+ ft->frame_handler = frame_handler;
hlist_add_head_rcu(&ft->list, &br->frame_type_list);
+
+ return 0;
}
-void br_del_frame(struct net_bridge *br, struct br_frame_type *ft)
+void br_del_frame(struct net_bridge *br, __be16 type)
{
- struct br_frame_type *tmp;
+ struct br_frame_type *ft;
- hlist_for_each_entry(tmp, &br->frame_type_list, list)
- if (ft == tmp) {
+ hlist_for_each_entry(ft, &br->frame_type_list, list) {
+ if (ft->type == type) {
hlist_del_rcu(&ft->list);
+ kfree_rcu(ft, rcu);
return;
}
+ }
+}
+
+void br_del_frame_all(struct net_bridge *br)
+{
+ struct br_frame_type *ft;
+ struct hlist_node *n;
+
+ hlist_for_each_entry_safe(ft, n, &br->frame_type_list, list) {
+ hlist_del_rcu(&ft->list);
+ kfree_rcu(ft, rcu);
+ }
}
diff --git a/net/bridge/br_mrp.c b/net/bridge/br_mrp.c
index ef16d07039241..511ae8af3d033 100644
--- a/net/bridge/br_mrp.c
+++ b/net/bridge/br_mrp.c
@@ -8,11 +8,6 @@ static const u8 mrp_in_test_dmac[ETH_ALEN] = { 0x1, 0x15, 0x4e, 0x0, 0x0, 0x3 };
static int br_mrp_process(struct net_bridge_port *p, struct sk_buff *skb);
-static struct br_frame_type mrp_frame_type __read_mostly = {
- .type = cpu_to_be16(ETH_P_MRP),
- .frame_handler = br_mrp_process,
-};
-
static bool br_mrp_is_ring_port(struct net_bridge_port *p_port,
struct net_bridge_port *s_port,
struct net_bridge_port *port)
@@ -486,7 +481,7 @@ static void br_mrp_del_impl(struct net_bridge *br, struct br_mrp *mrp)
kfree_rcu(mrp, rcu);
if (hlist_empty(&br->mrp_list))
- br_del_frame(br, &mrp_frame_type);
+ br_del_frame(br, cpu_to_be16(ETH_P_MRP));
}
/* Adds a new MRP instance.
@@ -535,13 +530,16 @@ int br_mrp_add(struct net_bridge *br, struct br_mrp_instance *instance)
spin_unlock_bh(&br->lock);
rcu_assign_pointer(mrp->s_port, p);
- if (hlist_empty(&br->mrp_list))
- br_add_frame(br, &mrp_frame_type);
-
INIT_DELAYED_WORK(&mrp->test_work, br_mrp_test_work_expired);
INIT_DELAYED_WORK(&mrp->in_test_work, br_mrp_in_test_work_expired);
hlist_add_tail_rcu(&mrp->list, &br->mrp_list);
+ if (hlist_is_singular_node(&mrp->list, &br->mrp_list)) {
+ err = br_add_frame(br, cpu_to_be16(ETH_P_MRP), br_mrp_process);
+ if (err)
+ goto delete_mrp;
+ }
+
err = br_mrp_switchdev_add(br, mrp);
if (err)
goto delete_mrp;
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index d337b1cfb980d..5163017feb74d 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -937,10 +937,14 @@ struct br_frame_type {
int (*frame_handler)(struct net_bridge_port *port,
struct sk_buff *skb);
struct hlist_node list;
+ struct rcu_head rcu;
};
-void br_add_frame(struct net_bridge *br, struct br_frame_type *ft);
-void br_del_frame(struct net_bridge *br, struct br_frame_type *ft);
+int br_add_frame(struct net_bridge *br, __be16 type,
+ int (*frame_handler)(struct net_bridge_port *port,
+ struct sk_buff *skb));
+void br_del_frame(struct net_bridge *br, __be16 type);
+void br_del_frame_all(struct net_bridge *br);
static inline bool br_rx_handler_check_rcu(const struct net_device *dev)
{
|
| 3/2 | 2026/09/05 09:16 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 5317 output: 30 thoughts: 531 Thoughts: **Analyzing the Bridging Patch** Okay, let's dive into this patch targeting the `net/bridge` subsystem, specifically touching `br_cfm.c`, `br_if.c`, `br_input.c`, `br_mrp.c`, and `br_private.h`. My immediate thought is, "Finally, someone addressed that shared `struct br_frame_type` issue." I've seen that kind of static structure cause headaches for ages. My initial scan of the diff confirms my suspicion. The core problem, as I recall, was that `br_add_frame` was using statically declared `struct br_frame_type` instances like `cfm_frame_type` and `mrp_frame_type`. That's a textbook recipe for list corruption and race conditions if multiple bridges were adding the same instance, or if there was concurrent registration. The shared `struct hlist_node list` within those static instances was the culprit. This patch smartly addresses it by allocating a *dynamic* `struct br_frame_type` per bridge using `kmalloc_obj`. This is the right approach. Then, `br_del_frame` now calls `kfree_rcu(ft, rcu)` to release the allocated memory, and crucially, `br_del_frame_all(br)` has been added to `br_dev_delete` to clean up the frame types during bridge device deletion. Good, thorough cleanup is essential here. The changes in `br_cfm.c` and `br_mrp.c` updating function signatures to match the new `br_add_frame` and `br_del_frame` are as expected, and good to see. The error handling is also in place, which is a very good addition. It's also great that `br_input.c` is updated, too. And of course, the addition of the `struct rcu_head rcu;` member in `struct br_frame_type` within `br_private.h` is necessary to support the RCU-based memory freeing. Now, before I give this a rubber stamp, I'm going to run a quick check on the Kconfig requirements for bridge, CFM, and MRP. Let's make sure that everything's configured as expected and that any dependencies are correctly handled. I think a quick grepping session through the `net/bridge` Kconfig files should provide what I need. |
| 4/2 | 2026/09/05 09:16 | tool | grepper |
0mArgs:{
"Expression": "CFM|MRP",
"PathPrefix": "net/bridge/Kconfig"
}Results: {
"Output": "net/bridge/Kconfig=50=config BRIDGE_VLAN_FILTERING\n--\nnet/bridge/Kconfig-63-\nnet/bridge/Kconfig:64:config BRIDGE_MRP\nnet/bridge/Kconfig:65:\tbool \"MRP protocol\"\nnet/bridge/Kconfig-66-\tdepends on BRIDGE\n--\nnet/bridge/Kconfig-68-\thelp\nnet/bridge/Kconfig:69:\t If you say Y here, then the Ethernet bridge will be able to run MRP\nnet/bridge/Kconfig-70-\t protocol to detect loops\n--\nnet/bridge/Kconfig-75-\nnet/bridge/Kconfig:76:config BRIDGE_CFM\nnet/bridge/Kconfig:77:\tbool \"CFM protocol\"\nnet/bridge/Kconfig-78-\tdepends on BRIDGE\nnet/bridge/Kconfig-79-\thelp\nnet/bridge/Kconfig:80:\t If you say Y here, then the Ethernet bridge will be able to run CFM\nnet/bridge/Kconfig-81-\t protocol according to 802.1Q section 12.14\n"
} |
| 5/2 | 2026/09/05 09:16 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 6686 output: 31 thoughts: 27 Thoughts: Here's my take on the thought process, as if it were my own: **Investigating Bridge Configuration in the Kernel** Okay, so I need to get a handle on the bridge configuration options within the kernel. Time to dig in! The best place to start, as always, is by examining the build system files. I'm going to head straight for `net/bridge/Makefile` and `net/bridge/Kconfig`. These two files should give me a complete picture. The Makefile will lay out the build dependencies and relevant source files, while the Kconfig file holds all of the configuration options, dependencies, and help text. This should allow me to see everything related to bridging and how it's enabled and configured at compile time. This is where the magic happens. |
| 6/2 | 2026/09/05 09:16 | tool | read-file |
0mArgs:{
"File": "net/bridge/Makefile",
"FirstLine": 1,
"LineCount": 40
}Results: {
"Contents": " 1:\t# SPDX-License-Identifier: GPL-2.0\n 2:\t#\n 3:\t# Makefile for the IEEE 802.1d ethernet bridging layer.\n 4:\t#\n 5:\t\n 6:\tobj-$(CONFIG_BRIDGE) += bridge.o\n 7:\t\n 8:\tbridge-y\t:= br.o br_device.o br_fdb.o br_forward.o br_if.o br_input.o \\\n 9:\t\t\t\tbr_ioctl.o br_stp.o br_stp_bpdu.o \\\n 10:\t\t\t\tbr_stp_if.o br_stp_timer.o br_netlink.o \\\n 11:\t\t\t\tbr_netlink_tunnel.o br_arp_nd_proxy.o\n 12:\t\n 13:\tbridge-$(CONFIG_SYSFS) += br_sysfs_if.o br_sysfs_br.o\n 14:\t\n 15:\tbridge-$(subst m,y,$(CONFIG_BRIDGE_NETFILTER)) += br_nf_core.o\n 16:\t\n 17:\tbr_netfilter-y := br_netfilter_hooks.o\n 18:\tbr_netfilter-$(subst m,y,$(CONFIG_IPV6)) += br_netfilter_ipv6.o\n 19:\tobj-$(CONFIG_BRIDGE_NETFILTER) += br_netfilter.o\n 20:\t\n 21:\tbridge-$(CONFIG_BRIDGE_IGMP_SNOOPING) += br_multicast.o br_mdb.o br_multicast_eht.o\n 22:\t\n 23:\tbridge-$(CONFIG_BRIDGE_VLAN_FILTERING) += br_vlan.o br_vlan_tunnel.o br_vlan_options.o br_mst.o\n 24:\t\n 25:\tbridge-$(CONFIG_NET_SWITCHDEV) += br_switchdev.o\n 26:\t\n 27:\tobj-$(CONFIG_NETFILTER) += netfilter/\n 28:\t\n 29:\tbridge-$(CONFIG_BRIDGE_MRP)\t+= br_mrp_switchdev.o br_mrp.o br_mrp_netlink.o\n 30:\t\n 31:\tbridge-$(CONFIG_BRIDGE_CFM)\t+= br_cfm.o br_cfm_netlink.o\n 32:\t\n 33:\tifdef CONFIG_GCOV_PROFILE_NETFILTER\n 34:\tGCOV_PROFILE_br_nf_core.o := y\n 35:\tGCOV_PROFILE_br_netfilter_hooks.o := y\n 36:\tGCOV_PROFILE_br_netfilter_ipv6.o := y\n 37:\tendif\n"
} |
| 7/2 | 2026/09/05 09:16 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 7602 output: 39 thoughts: 36 Thoughts: **Investigating MRP and CFM Configuration and Invocation** Okay, let's dive into this. My immediate thought is to understand the technical underpinnings of how MRP (Multiple Registration Protocol) and CFM (Connectivity Fault Management) are configured and actually called – how they're *invoked*. Specifically, I need to know how these things are wired up. My gut feeling is that Netlink is involved here, given the kernel-level nature of these protocols, so that's the angle I'm taking. So the next logical step is to pinpoint the Netlink entry points for both CFM and MRP. I need to find the specific hooks, the critical control points, where the configuration and operation of these protocols are handled within the system. This will give me a solid base to understand how to interact with them at a system level. |
| 8/2 | 2026/09/05 09:16 | tool | grepper |
0mArgs:{
"Expression": "br_cfm_mep_create|br_mrp_add",
"PathPrefix": "net/bridge/"
}Results: {
"Output": "net/bridge/br_cfm.c=370=static int br_cfm_frame_rx(struct net_bridge_port *port, struct sk_buff *skb)\n--\nnet/bridge/br_cfm.c-491-\nnet/bridge/br_cfm.c:492:int br_cfm_mep_create(struct net_bridge *br,\nnet/bridge/br_cfm.c-493-\t\t const u32 instance,\nnet/bridge/br_cfm.c:494:\t\t struct br_cfm_mep_create *const create,\nnet/bridge/br_cfm.c-495-\t\t struct netlink_ext_ack *extack)\n--\nnet/bridge/br_cfm_netlink.c=8=static const struct nla_policy\nnet/bridge/br_cfm_netlink.c:9:br_cfm_mep_create_policy[IFLA_BRIDGE_CFM_MEP_CREATE_MAX + 1] = {\nnet/bridge/br_cfm_netlink.c-10-\t[IFLA_BRIDGE_CFM_MEP_CREATE_UNSPEC]\t= { .type = NLA_REJECT },\n--\nnet/bridge/br_cfm_netlink.c=72=br_cfm_policy[IFLA_BRIDGE_CFM_MAX + 1] = {\n--\nnet/bridge/br_cfm_netlink.c-74-\t[IFLA_BRIDGE_CFM_MEP_CREATE]\t\t=\nnet/bridge/br_cfm_netlink.c:75:\t\t\t\tNLA_POLICY_NESTED(br_cfm_mep_create_policy),\nnet/bridge/br_cfm_netlink.c-76-\t[IFLA_BRIDGE_CFM_MEP_DELETE]\t\t=\n--\nnet/bridge/br_cfm_netlink.c=92=static int br_mep_create_parse(struct net_bridge *br, struct nlattr *attr,\n--\nnet/bridge/br_cfm_netlink.c-95-\tstruct nlattr *tb[IFLA_BRIDGE_CFM_MEP_CREATE_MAX + 1];\nnet/bridge/br_cfm_netlink.c:96:\tstruct br_cfm_mep_create create;\nnet/bridge/br_cfm_netlink.c-97-\tu32 instance;\n--\nnet/bridge/br_cfm_netlink.c-100-\terr = nla_parse_nested(tb, IFLA_BRIDGE_CFM_MEP_CREATE_MAX, attr,\nnet/bridge/br_cfm_netlink.c:101:\t\t\t br_cfm_mep_create_policy, extack);\nnet/bridge/br_cfm_netlink.c-102-\tif (err)\n--\nnet/bridge/br_cfm_netlink.c-128-\nnet/bridge/br_cfm_netlink.c:129:\treturn br_cfm_mep_create(br, instance, \u0026create, extack);\nnet/bridge/br_cfm_netlink.c-130-}\n--\nnet/bridge/br_mrp.c=421=static void br_mrp_del_impl(struct net_bridge *br, struct br_mrp *mrp)\n--\nnet/bridge/br_mrp.c-489- */\nnet/bridge/br_mrp.c:490:int br_mrp_add(struct net_bridge *br, struct br_mrp_instance *instance)\nnet/bridge/br_mrp.c-491-{\n--\nnet/bridge/br_mrp_netlink.c=31=static int br_mrp_instance_parse(struct net_bridge *br, struct nlattr *attr,\n--\nnet/bridge/br_mrp_netlink.c-61-\tif (cmd == RTM_SETLINK)\nnet/bridge/br_mrp_netlink.c:62:\t\treturn br_mrp_add(br, \u0026inst);\nnet/bridge/br_mrp_netlink.c-63-\telse\n--\nnet/bridge/br_private_cfm.h-8-\nnet/bridge/br_private_cfm.h:9:struct br_cfm_mep_create {\nnet/bridge/br_private_cfm.h-10-\tenum br_cfm_domain domain; /* Domain for this MEP */\n--\nnet/bridge/br_private_cfm.h-14-\nnet/bridge/br_private_cfm.h:15:int br_cfm_mep_create(struct net_bridge *br,\nnet/bridge/br_private_cfm.h-16-\t\t const u32 instance,\nnet/bridge/br_private_cfm.h:17:\t\t struct br_cfm_mep_create *const create,\nnet/bridge/br_private_cfm.h-18-\t\t struct netlink_ext_ack *extack);\n--\nnet/bridge/br_private_cfm.h=117=struct br_cfm_mep {\n--\nnet/bridge/br_private_cfm.h-120-\tu32\t\t\t\tinstance;\nnet/bridge/br_private_cfm.h:121:\tstruct br_cfm_mep_create\tcreate;\nnet/bridge/br_private_cfm.h-122-\tstruct br_cfm_mep_config\tconfig;\n--\nnet/bridge/br_private_mrp.h=59=enum br_mrp_hw_support {\n--\nnet/bridge/br_private_mrp.h-65-/* br_mrp.c */\nnet/bridge/br_private_mrp.h:66:int br_mrp_add(struct net_bridge *br, struct br_mrp_instance *instance);\nnet/bridge/br_private_mrp.h-67-int br_mrp_del(struct net_bridge *br, struct br_mrp_instance *instance);\n"
} |
| 9/2 | 2026/09/05 09:16 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 9331 output: 29 thoughts: 33 Thoughts: Here's my attempt at summarizing the thought process, as if I were thinking it: **Digging into Frame Type Lookup** Okay, so I need to refresh my memory on the frame type lookup process during packet reception, specifically within the bridging context. My focus is going to be on understanding how the system determines what *kind* of frame it's dealing with when a packet comes in. This really gets down to the core of the bridge's handling logic. I'm thinking I'll start by taking a look at `br_input.c` and specifically `br_handle_frame`, as that seems like the logical entry point for frame processing. I want to see how the system differentiates between, say, a standard Ethernet frame, a VLAN-tagged frame, or anything else it might encounter. Understanding this lookup process is crucial for troubleshooting potential issues in frame handling, especially when dealing with unusual or customized frame formats, and for optimizing performance if I need to. Let's see what the code reveals. |
| 10/2 | 2026/09/05 09:17 | tool | grepper |
0mArgs:{
"Expression": "frame_type_list",
"PathPrefix": "net/bridge/"
}Results: {
"Output": "net/bridge/br_device.c=480=void br_dev_setup(struct net_device *dev)\n--\nnet/bridge/br_device.c-505-\tINIT_HLIST_HEAD(\u0026br-\u003efdb_list);\nnet/bridge/br_device.c:506:\tINIT_HLIST_HEAD(\u0026br-\u003eframe_type_list);\nnet/bridge/br_device.c-507-#if IS_ENABLED(CONFIG_BRIDGE_MRP)\n--\nnet/bridge/br_input.c=323=static int br_process_frame_type(struct net_bridge_port *p,\n--\nnet/bridge/br_input.c-327-\nnet/bridge/br_input.c:328:\thlist_for_each_entry_rcu(tmp, \u0026p-\u003ebr-\u003eframe_type_list, list)\nnet/bridge/br_input.c-329-\t\tif (unlikely(tmp-\u003etype == skb-\u003eprotocol))\n--\nnet/bridge/br_input.c=471=int br_add_frame(struct net_bridge *br, __be16 type,\n--\nnet/bridge/br_input.c-476-\nnet/bridge/br_input.c:477:\thlist_for_each_entry(ft, \u0026br-\u003eframe_type_list, list) {\nnet/bridge/br_input.c-478-\t\tif (ft-\u003etype == type)\n--\nnet/bridge/br_input.c-487-\tft-\u003eframe_handler = frame_handler;\nnet/bridge/br_input.c:488:\thlist_add_head_rcu(\u0026ft-\u003elist, \u0026br-\u003eframe_type_list);\nnet/bridge/br_input.c-489-\n--\nnet/bridge/br_input.c=493=void br_del_frame(struct net_bridge *br, __be16 type)\n--\nnet/bridge/br_input.c-496-\nnet/bridge/br_input.c:497:\thlist_for_each_entry(ft, \u0026br-\u003eframe_type_list, list) {\nnet/bridge/br_input.c-498-\t\tif (ft-\u003etype == type) {\n--\nnet/bridge/br_input.c=506=void br_del_frame_all(struct net_bridge *br)\n--\nnet/bridge/br_input.c-510-\nnet/bridge/br_input.c:511:\thlist_for_each_entry_safe(ft, n, \u0026br-\u003eframe_type_list, list) {\nnet/bridge/br_input.c-512-\t\thlist_del_rcu(\u0026ft-\u003elist);\n--\nnet/bridge/br_private.h=500=struct net_bridge {\n--\nnet/bridge/br_private.h-502-\tspinlock_t\t\t\thash_lock;\nnet/bridge/br_private.h:503:\tstruct hlist_head\t\tframe_type_list;\nnet/bridge/br_private.h-504-\tstruct net_device\t\t*dev;\n"
} |
| 11/2 | 2026/09/05 09:17 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 10398 output: 39 thoughts: 351 Thoughts: **My Fuzzing Strategy: Core Networking Code**
Okay, so this is definitely core networking code – we're talking about Ethernet bridging, CFM (Connectivity Fault Management), and MRP (Multiple Registration Protocol). The good news is, from what I can see, this *should* be reachable in a standard QEMU environment. We're dealing with the usual suspects: standard bridge netdevice creation using `ip link add name br0 type bridge`, netlink configuration of CFM/MRP (likely via `RTM_SETLINK` and `rtnl`), packet transmission and reception via the common interfaces like TAP/veth/loopback, and of course the critical `br_process_frame_type` function for bridge frame processing, along with the bridge device deletion routines. So, yes, the initial assessment of "WorthFuzzing" is spot on!
Now, let's break this down systematically.
1. **`WorthFuzzing`**: Absolutely, confirmed. We have enough accessibility to put this through its paces.
2. **`Reasoning`**: The significant changes here are the refactoring of bridge frame type registration and deregistration. They went from static structures to per-bridge dynamically allocated entries managed with RCU (Read-Copy-Update). I'm also seeing updated error handling and cleanup paths sprinkled throughout CFM, MRP, and the bridge deletion routines. This is *reachable* because bridging functionality with CFM/MRP protocols is accessible via netlink and packet reception. Specifically, we can craft packets that flow through the netlink interface, and through the bridge processing that targets those protocols.
3. **`FocusSymbols`**: We need to zero in on specific functions and parts of the code. Let's select non-ubiquitous functions, that were modified, or directly call the modified code. I'm thinking we need to directly target:
* `br_add_frame`
* `br_del_frame`
* `br_del_frame_all`
* `br_cfm_mep_create`
* `br_cfm_mep_delete`
* `br_mrp_add`
* `br_mrp_del_impl` / `br_mrp_del`
* `br_process_frame_type`
* `br_dev_delete`
I need to double-check those exact symbol names within `br_cfm.c` and `br_mrp.c` to be completely sure, but that's my target list. We have a clear path to generating fuzzer input based on the netlink interfaces and packet flows, and those function calls.
|
| 12/2 | 2026/09/05 09:17 | tool | grepper |
0mArgs:{
"Expression": "br_cfm_mep_delete|br_mrp_del",
"PathPrefix": "net/bridge/"
}Results: {
"Output": "net/bridge/br_cfm.c=570=static void mep_delete_implementation(struct net_bridge *br,\n--\nnet/bridge/br_cfm.c-594-\nnet/bridge/br_cfm.c:595:int br_cfm_mep_delete(struct net_bridge *br,\nnet/bridge/br_cfm.c-596-\t\t const u32 instance,\n--\nnet/bridge/br_cfm_netlink.c=17=static const struct nla_policy\nnet/bridge/br_cfm_netlink.c:18:br_cfm_mep_delete_policy[IFLA_BRIDGE_CFM_MEP_DELETE_MAX + 1] = {\nnet/bridge/br_cfm_netlink.c-19-\t[IFLA_BRIDGE_CFM_MEP_DELETE_UNSPEC]\t= { .type = NLA_REJECT },\n--\nnet/bridge/br_cfm_netlink.c=72=br_cfm_policy[IFLA_BRIDGE_CFM_MAX + 1] = {\n--\nnet/bridge/br_cfm_netlink.c-76-\t[IFLA_BRIDGE_CFM_MEP_DELETE]\t\t=\nnet/bridge/br_cfm_netlink.c:77:\t\t\t\tNLA_POLICY_NESTED(br_cfm_mep_delete_policy),\nnet/bridge/br_cfm_netlink.c-78-\t[IFLA_BRIDGE_CFM_MEP_CONFIG]\t\t=\n--\nnet/bridge/br_cfm_netlink.c=132=static int br_mep_delete_parse(struct net_bridge *br, struct nlattr *attr,\n--\nnet/bridge/br_cfm_netlink.c-139-\terr = nla_parse_nested(tb, IFLA_BRIDGE_CFM_MEP_DELETE_MAX, attr,\nnet/bridge/br_cfm_netlink.c:140:\t\t\t br_cfm_mep_delete_policy, extack);\nnet/bridge/br_cfm_netlink.c-141-\tif (err)\n--\nnet/bridge/br_cfm_netlink.c-151-\nnet/bridge/br_cfm_netlink.c:152:\treturn br_cfm_mep_delete(br, instance, extack);\nnet/bridge/br_cfm_netlink.c-153-}\n--\nnet/bridge/br_mrp.c=345=static void br_mrp_in_test_work_expired(struct work_struct *work)\n--\nnet/bridge/br_mrp.c-420- */\nnet/bridge/br_mrp.c:421:static void br_mrp_del_impl(struct net_bridge *br, struct br_mrp *mrp)\nnet/bridge/br_mrp.c-422-{\n--\nnet/bridge/br_mrp.c=490=int br_mrp_add(struct net_bridge *br, struct br_mrp_instance *instance)\n--\nnet/bridge/br_mrp.c-549-delete_mrp:\nnet/bridge/br_mrp.c:550:\tbr_mrp_del_impl(br, mrp);\nnet/bridge/br_mrp.c-551-\n--\nnet/bridge/br_mrp.c=558=void br_mrp_port_del(struct net_bridge *br, struct net_bridge_port *p)\n--\nnet/bridge/br_mrp.c-565-\nnet/bridge/br_mrp.c:566:\tbr_mrp_del_impl(br, mrp);\nnet/bridge/br_mrp.c-567-}\n--\nnet/bridge/br_mrp.c-571- */\nnet/bridge/br_mrp.c:572:int br_mrp_del(struct net_bridge *br, struct br_mrp_instance *instance)\nnet/bridge/br_mrp.c-573-{\n--\nnet/bridge/br_mrp.c-578-\nnet/bridge/br_mrp.c:579:\tbr_mrp_del_impl(br, mrp);\nnet/bridge/br_mrp.c-580-\n--\nnet/bridge/br_mrp_netlink.c=31=static int br_mrp_instance_parse(struct net_bridge *br, struct nlattr *attr,\n--\nnet/bridge/br_mrp_netlink.c-63-\telse\nnet/bridge/br_mrp_netlink.c:64:\t\treturn br_mrp_del(br, \u0026inst);\nnet/bridge/br_mrp_netlink.c-65-\n--\nnet/bridge/br_private_cfm.h=15=int br_cfm_mep_create(struct net_bridge *br,\n--\nnet/bridge/br_private_cfm.h-19-\nnet/bridge/br_private_cfm.h:20:int br_cfm_mep_delete(struct net_bridge *br,\nnet/bridge/br_private_cfm.h-21-\t\t const u32 instance,\n--\nnet/bridge/br_private_mrp.h=66=int br_mrp_add(struct net_bridge *br, struct br_mrp_instance *instance);\nnet/bridge/br_private_mrp.h:67:int br_mrp_del(struct net_bridge *br, struct br_mrp_instance *instance);\nnet/bridge/br_private_mrp.h-68-int br_mrp_set_port_state(struct net_bridge_port *p,\n"
} |
| 13/2 | 2026/09/05 09:17 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 12809 output: 28 thoughts: 88 Thoughts: Here's my thinking process: **Configuration Verification for Bridging Functionality** Okay, so I need to verify a bridge configuration. The initial checklist mandates ensuring `BRIDGE`, `BRIDGE_CFM`, and `BRIDGE_MRP` are all correctly set. I know I need to delve deeper into these settings to ensure they're configured appropriately, so I need to double-check the dependencies of `BRIDGE_CFM` and `BRIDGE_MRP`. They are, after all, features built on top of the base bridge functionality. I need to consult the `net/bridge/Kconfig` file specifically. I recall that `BRIDGE_CFM` and `BRIDGE_MRP` require `BRIDGE`, which in turn probably depends on things like `NET` and perhaps `INET` (or similar networking infrastructure). I should probably verify what the exact dependencies are within that Kconfig file. Better safe than sorry when configuring these complex networking features. |
| 14/2 | 2026/09/05 09:17 | tool | grepper |
0mArgs:{
"Expression": "config BRIDGE",
"PathPrefix": "net/bridge/Kconfig"
}Results: {
"Output": "net/bridge/Kconfig-5-\nnet/bridge/Kconfig:6:config BRIDGE\nnet/bridge/Kconfig-7-\ttristate \"802.1d Ethernet Bridging\"\n--\nnet/bridge/Kconfig-35-\nnet/bridge/Kconfig:36:config BRIDGE_IGMP_SNOOPING\nnet/bridge/Kconfig-37-\tbool \"IGMP/MLD snooping\"\n--\nnet/bridge/Kconfig-49-\nnet/bridge/Kconfig:50:config BRIDGE_VLAN_FILTERING\nnet/bridge/Kconfig-51-\tbool \"VLAN filtering\"\n--\nnet/bridge/Kconfig-63-\nnet/bridge/Kconfig:64:config BRIDGE_MRP\nnet/bridge/Kconfig-65-\tbool \"MRP protocol\"\n--\nnet/bridge/Kconfig-75-\nnet/bridge/Kconfig:76:config BRIDGE_CFM\nnet/bridge/Kconfig-77-\tbool \"CFM protocol\"\n"
} |
| 15/2 | 2026/09/05 09:17 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 13376 output: 32 thoughts: 20 Thoughts: Here's a summary of my thought process, as if I were analyzing that configuration file: **Investigating Bridge Configuration** Okay, time to dive into `net/bridge/Kconfig`. I'm starting by looking at lines 1 through 20. This usually indicates the main, top-level settings and definitions for the bridge module itself. My initial goal is to understand the general options presented, the dependencies they might have, and any preliminary comments or explanations that set the stage for the rest of the configuration. I'm expecting to see things like: the main bridge support enabling option, probably a default setting for some basic functionality, and maybe some early comments outlining the core purpose of the bridging code. I'll be looking for keywords and symbols that I'll need to remember for the rest of the review. The goal right now is just to get my bearings and understand the bigger picture before getting into the weeds of more specific functionalities. |
| 16/2 | 2026/09/05 09:17 | tool | read-file |
0mArgs:{
"File": "net/bridge/Kconfig",
"FirstLine": 1,
"LineCount": 30
}Results: {
"Contents": " 1:\t# SPDX-License-Identifier: GPL-2.0-only\n 2:\t#\n 3:\t# 802.1d Ethernet Bridging\n 4:\t#\n 5:\t\n 6:\tconfig BRIDGE\n 7:\t\ttristate \"802.1d Ethernet Bridging\"\n 8:\t\tselect LLC\n 9:\t\tselect STP\n 10:\t\thelp\n 11:\t\t If you say Y here, then your Linux box will be able to act as an\n 12:\t\t Ethernet bridge, which means that the different Ethernet segments it\n 13:\t\t is connected to will appear as one Ethernet to the participants.\n 14:\t\t Several such bridges can work together to create even larger\n 15:\t\t networks of Ethernets using the IEEE 802.1 spanning tree algorithm.\n 16:\t\t As this is a standard, Linux bridges will cooperate properly with\n 17:\t\t other third party bridge products.\n 18:\t\n 19:\t\t In order to use the Ethernet bridge, you'll need the bridge\n 20:\t\t configuration tools; see \u003cfile:Documentation/networking/bridge.rst\u003e\n 21:\t\t for location. Please read the Bridge mini-HOWTO for more\n 22:\t\t information.\n 23:\t\n 24:\t\t If you enable iptables support along with the bridge support then you\n 25:\t\t turn your bridge into a bridging IP firewall.\n 26:\t\t iptables will then see the IP packets being bridged, so you need to\n 27:\t\t take this into account when setting up your firewall rules.\n 28:\t\t Enabling arptables support when bridging will let arptables see\n 29:\t\t bridged ARP traffic in the arptables FORWARD chain.\n 30:\t\n"
} |
| 17/2 | 2026/09/05 09:17 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 14079 output: 247 thoughts: 120 Thoughts: Okay, here's my take on those notes. **My Analysis of Bridge Configuration & Associated Functions** Right, so I'm looking at this configuration setup, and it's immediately clear that we need to enable the `BRIDGE`, `BRIDGE_CFM`, and `BRIDGE_MRP` flags. No surprises there. These are the fundamental building blocks, the foundation, for getting a bridge implementation up and running. Now, digging deeper, I see the core function symbols that need careful consideration. `br_add_frame`, `br_del_frame`, `br_del_frame_all` are crucial for frame handling – adding, removing, and clearing frames within the bridge's forwarding table. Obviously, we'll need robust logic around those. Then, `br_cfm_mep_create` and `br_cfm_mep_delete` suggest that we are going to use Connectivity Fault Management. Definitely key in larger deployments. Following on from that, the MRP-specific functions, `br_mrp_add` and `br_mrp_del`, confirm MRP support. Finally `br_dev_delete` is an obvious choice when we need to tear down the bridge. Overall, it's a good set of symbols – pretty comprehensive really – and all seems to be logically interconnected. I'm going to have to make sure that the `set-results` variable tracks those correctly. |
| 18/2 | 2026/09/05 09:17 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"BRIDGE",
"BRIDGE_CFM",
"BRIDGE_MRP"
],
"FocusSymbols": [
"br_add_frame",
"br_del_frame",
"br_del_frame_all",
"br_cfm_mep_create",
"br_cfm_mep_delete",
"br_mrp_add",
"br_mrp_del",
"br_dev_delete"
],
"Reasoning": "The patch refactors the bridge Ethernet frame type handler registration/deregistration mechanism. Previously, statically allocated frame type structures (such as cfm_frame_type and mrp_frame_type) were registered directly to bridge instances, which could lead to list corruption across multiple bridges. The patch changes this to dynamic per-bridge allocation and RCU-based freeing of frame type nodes, introduces error handling on allocation failure, and adds cleanup of all registered frame types during bridge device deletion (br_dev_delete). These reachable core networking changes warrant fuzzing to uncover potential memory leaks, concurrency issues, or error handling regressions.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"BRIDGE",
"BRIDGE_CFM",
"BRIDGE_MRP"
],
"FocusSymbols": [
"br_add_frame",
"br_del_frame",
"br_del_frame_all",
"br_cfm_mep_create",
"br_cfm_mep_delete",
"br_mrp_add",
"br_mrp_del",
"br_dev_delete"
],
"Reasoning": "The patch refactors the bridge Ethernet frame type handler registration/deregistration mechanism. Previously, statically allocated frame type structures (such as cfm_frame_type and mrp_frame_type) were registered directly to bridge instances, which could lead to list corruption across multiple bridges. The patch changes this to dynamic per-bridge allocation and RCU-based freeing of frame type nodes, introduces error handling on allocation failure, and adds cleanup of all registered frame types during bridge device deletion (br_dev_delete). These reachable core networking changes warrant fuzzing to uncover potential memory leaks, concurrency issues, or error handling regressions.",
"WorthFuzzing": true
} |
| 19/1 | 2026/09/05 09:17 | action | If |
0mArgs:{
"WorthFuzzing": true
}Results: null |
| 20/2 | 2026/09/05 09:17 | agent | kmsan-evaluator |
0mModel:core Args: null Results: {
"KMSANReasoning": "The patch modifies how ethernet frame handlers (such as CFM and MRP) are registered in the bridge module. Instead of using static global `struct br_frame_type` variables, it dynamically allocates `struct br_frame_type` using `kmalloc_obj` and protects its removal with `kfree_rcu`.\n\nAll fields (`type`, `frame_handler`, and `list`) accessed by `br_process_frame_type` and list traversal functions are explicitly initialized before insertion into `br-\u003eframe_type_list`. None of these structures are exposed or copied to user space, nor are any uninitialized variables used in conditional branching or calculations. Any potential bugs (such as RCU synchronization issues, use-after-free, or memory leaks) are covered by KASAN and standard kernel debuggers. Therefore, a dedicated KMSAN fuzzing session is not needed.",
"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: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit b66fda227b229c0afcf20e395171252963af6619
Author: syz-cluster <triage@syzkaller.com>
Date: Sat Sep 5 09:16:44 2026 +0000
syz-cluster: applied patch under review
diff --git a/net/bridge/br_cfm.c b/net/bridge/br_cfm.c
index dea56fffa1c19..5790248588298 100644
--- a/net/bridge/br_cfm.c
+++ b/net/bridge/br_cfm.c
@@ -489,11 +489,6 @@ static int br_cfm_frame_rx(struct net_bridge_port *port, struct sk_buff *skb)
return 1;
}
-static struct br_frame_type cfm_frame_type __read_mostly = {
- .type = cpu_to_be16(ETH_P_CFM),
- .frame_handler = br_cfm_frame_rx,
-};
-
int br_cfm_mep_create(struct net_bridge *br,
const u32 instance,
struct br_cfm_mep_create *const create,
@@ -501,6 +496,7 @@ int br_cfm_mep_create(struct net_bridge *br,
{
struct net_bridge_port *p;
struct br_cfm_mep *mep;
+ int err;
ASSERT_RTNL();
@@ -558,8 +554,13 @@ int br_cfm_mep_create(struct net_bridge *br,
INIT_HLIST_HEAD(&mep->peer_mep_list);
INIT_DELAYED_WORK(&mep->ccm_tx_dwork, ccm_tx_work_expired);
- if (hlist_empty(&br->mep_list))
- br_add_frame(br, &cfm_frame_type);
+ if (hlist_empty(&br->mep_list)) {
+ err = br_add_frame(br, cpu_to_be16(ETH_P_CFM), br_cfm_frame_rx);
+ if (err) {
+ kfree(mep);
+ return err;
+ }
+ }
hlist_add_tail_rcu(&mep->head, &br->mep_list);
@@ -588,7 +589,7 @@ static void mep_delete_implementation(struct net_bridge *br,
kfree_rcu(mep, rcu);
if (hlist_empty(&br->mep_list))
- br_del_frame(br, &cfm_frame_type);
+ br_del_frame(br, cpu_to_be16(ETH_P_CFM));
}
int br_cfm_mep_delete(struct net_bridge *br,
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index c52613431f886..fe8e9a47e1ac1 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -397,6 +397,8 @@ void br_dev_delete(struct net_device *dev, struct list_head *head)
timer_shutdown_sync(&br->tcn_timer);
cancel_delayed_work_sync(&br->gc_work);
+ br_del_frame_all(br);
+
br_sysfs_delbr(br->dev);
unregister_netdevice_queue(br->dev, head);
}
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index d87a5f9fa92b7..07efd0fbcf9cd 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -468,18 +468,48 @@ rx_handler_func_t *br_get_rx_handler(const struct net_device *dev)
return br_handle_frame;
}
-void br_add_frame(struct net_bridge *br, struct br_frame_type *ft)
+int br_add_frame(struct net_bridge *br, __be16 type,
+ int (*frame_handler)(struct net_bridge_port *port,
+ struct sk_buff *skb))
{
+ struct br_frame_type *ft;
+
+ hlist_for_each_entry(ft, &br->frame_type_list, list) {
+ if (ft->type == type)
+ return -EEXIST;
+ }
+
+ ft = kmalloc_obj(*ft);
+ if (!ft)
+ return -ENOMEM;
+
+ ft->type = type;
+ ft->frame_handler = frame_handler;
hlist_add_head_rcu(&ft->list, &br->frame_type_list);
+
+ return 0;
}
-void br_del_frame(struct net_bridge *br, struct br_frame_type *ft)
+void br_del_frame(struct net_bridge *br, __be16 type)
{
- struct br_frame_type *tmp;
+ struct br_frame_type *ft;
- hlist_for_each_entry(tmp, &br->frame_type_list, list)
- if (ft == tmp) {
+ hlist_for_each_entry(ft, &br->frame_type_list, list) {
+ if (ft->type == type) {
hlist_del_rcu(&ft->list);
+ kfree_rcu(ft, rcu);
return;
}
+ }
+}
+
+void br_del_frame_all(struct net_bridge *br)
+{
+ struct br_frame_type *ft;
+ struct hlist_node *n;
+
+ hlist_for_each_entry_safe(ft, n, &br->frame_type_list, list) {
+ hlist_del_rcu(&ft->list);
+ kfree_rcu(ft, rcu);
+ }
}
diff --git a/net/bridge/br_mrp.c b/net/bridge/br_mrp.c
index ef16d07039241..511ae8af3d033 100644
--- a/net/bridge/br_mrp.c
+++ b/net/bridge/br_mrp.c
@@ -8,11 +8,6 @@ static const u8 mrp_in_test_dmac[ETH_ALEN] = { 0x1, 0x15, 0x4e, 0x0, 0x0, 0x3 };
static int br_mrp_process(struct net_bridge_port *p, struct sk_buff *skb);
-static struct br_frame_type mrp_frame_type __read_mostly = {
- .type = cpu_to_be16(ETH_P_MRP),
- .frame_handler = br_mrp_process,
-};
-
static bool br_mrp_is_ring_port(struct net_bridge_port *p_port,
struct net_bridge_port *s_port,
struct net_bridge_port *port)
@@ -486,7 +481,7 @@ static void br_mrp_del_impl(struct net_bridge *br, struct br_mrp *mrp)
kfree_rcu(mrp, rcu);
if (hlist_empty(&br->mrp_list))
- br_del_frame(br, &mrp_frame_type);
+ br_del_frame(br, cpu_to_be16(ETH_P_MRP));
}
/* Adds a new MRP instance.
@@ -535,13 +530,16 @@ int br_mrp_add(struct net_bridge *br, struct br_mrp_instance *instance)
spin_unlock_bh(&br->lock);
rcu_assign_pointer(mrp->s_port, p);
- if (hlist_empty(&br->mrp_list))
- br_add_frame(br, &mrp_frame_type);
-
INIT_DELAYED_WORK(&mrp->test_work, br_mrp_test_work_expired);
INIT_DELAYED_WORK(&mrp->in_test_work, br_mrp_in_test_work_expired);
hlist_add_tail_rcu(&mrp->list, &br->mrp_list);
+ if (hlist_is_singular_node(&mrp->list, &br->mrp_list)) {
+ err = br_add_frame(br, cpu_to_be16(ETH_P_MRP), br_mrp_process);
+ if (err)
+ goto delete_mrp;
+ }
+
err = br_mrp_switchdev_add(br, mrp);
if (err)
goto delete_mrp;
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index d337b1cfb980d..5163017feb74d 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -937,10 +937,14 @@ struct br_frame_type {
int (*frame_handler)(struct net_bridge_port *port,
struct sk_buff *skb);
struct hlist_node list;
+ struct rcu_head rcu;
};
-void br_add_frame(struct net_bridge *br, struct br_frame_type *ft);
-void br_del_frame(struct net_bridge *br, struct br_frame_type *ft);
+int br_add_frame(struct net_bridge *br, __be16 type,
+ int (*frame_handler)(struct net_bridge_port *port,
+ struct sk_buff *skb));
+void br_del_frame(struct net_bridge *br, __be16 type);
+void br_del_frame_all(struct net_bridge *br);
static inline bool br_rx_handler_check_rcu(const struct net_device *dev)
{
|
| 21/3 | 2026/09/05 09:17 | llm | kmsan-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 4529 output: 26 thoughts: 720 Thoughts: **Analyzing the Dynamic Allocation of `br_frame_type`** Okay, so I'm looking at this patch and it's all about moving away from those static, global `cfm_frame_type` and `mrp_frame_type` structures. Instead, the patch dynamically allocates `struct br_frame_type` instances on a per-bridge basis. This is a good move; it makes the code cleaner, more flexible, and potentially safer. Let's see how this plays out across the bridge code. First, in `net/bridge/br_cfm.c`, I see they've removed the static `cfm_frame_type`. Now, when creating a CFM MEP (Maintenance Entity Point) in `br_cfm_mep_create`, they call `br_add_frame` with the protocol type `ETH_P_CFM` and the handler `br_cfm_frame_rx`. If `br_add_frame` fails (always a good check), the MEP is freed and an error is returned. On deletion, they call `br_del_frame` with `ETH_P_CFM` instead of the old static structure. This feels cleaner and more intuitive. Then, in `net/bridge/br_if.c`, they've added `br_del_frame_all(br)` to `br_dev_delete`. This ensures all dynamically allocated frame types are properly cleaned up when a bridge interface is deleted, which is absolutely critical to avoid memory leaks. Excellent. Peeking into `net/bridge/br_input.c`, the heart of the changes seems to be in the implementation of `br_add_frame` and `br_del_frame`. `br_add_frame` now checks for duplicate frame types (a `type` already exists in `br->frame_type_list`), which is a decent sanity check and returns an error code. It then dynamically allocates a `struct br_frame_type` with `kmalloc_obj`, and if that fails, returns an error. It sets the `type` and `frame_handler`, and adds the new `ft` to `br->frame_type_list`. `br_del_frame` now finds the appropriate `ft` based on the `type`, and safely removes and frees it. `br_del_frame_all` just iterates through the list and cleans up everything. I'm glad to see the use of `kfree_rcu` with the `rcu` head, proper use of RCU for synchronization is the way to go here. Next, in `net/bridge/br_mrp.c`, the static `mrp_frame_type` is gone. On MRP deletion, `br_del_frame` is called with `ETH_P_MRP`. On MRP addition, it checks if `mrp->list` is singular, and then calls `br_add_frame` with `ETH_P_MRP` and the `br_mrp_process` handler. Sounds straightforward. Finally, `net/bridge/br_private.h` adds the `struct rcu_head rcu;` to `struct br_frame_type`. This is essential for RCU-safe memory management. The declarations for the core functions are updated to reflect the new structure. Now, I want to make sure I'm not missing anything. I'll need to use `grepper` or similar tool to quickly scan the rest of the bridge code to confirm that the `frame_type_list` and `br_frame_type` are only used within the intended scope. This seems like a solid, well-thought-out change. The dynamic allocation approach is correct here. |
| 22/3 | 2026/09/05 09:17 | tool | grepper |
0mArgs:{
"Expression": "frame_type",
"PathPrefix": "net/bridge"
}Results: {
"Output": "net/bridge/br_device.c=480=void br_dev_setup(struct net_device *dev)\n--\nnet/bridge/br_device.c-505-\tINIT_HLIST_HEAD(\u0026br-\u003efdb_list);\nnet/bridge/br_device.c:506:\tINIT_HLIST_HEAD(\u0026br-\u003eframe_type_list);\nnet/bridge/br_device.c-507-#if IS_ENABLED(CONFIG_BRIDGE_MRP)\n--\nnet/bridge/br_input.c=267=static int nf_hook_bridge_pre(struct sk_buff *skb, struct sk_buff **pskb)\n--\nnet/bridge/br_input.c-322- */\nnet/bridge/br_input.c:323:static int br_process_frame_type(struct net_bridge_port *p,\nnet/bridge/br_input.c-324-\t\t\t\t struct sk_buff *skb)\nnet/bridge/br_input.c-325-{\nnet/bridge/br_input.c:326:\tstruct br_frame_type *tmp;\nnet/bridge/br_input.c-327-\nnet/bridge/br_input.c:328:\thlist_for_each_entry_rcu(tmp, \u0026p-\u003ebr-\u003eframe_type_list, list)\nnet/bridge/br_input.c-329-\t\tif (unlikely(tmp-\u003etype == skb-\u003eprotocol))\n--\nnet/bridge/br_input.c=339=static rx_handler_result_t br_handle_frame(struct sk_buff **pskb)\n--\nnet/bridge/br_input.c-427-\nnet/bridge/br_input.c:428:\tif (unlikely(br_process_frame_type(p, skb)))\nnet/bridge/br_input.c-429-\t\treturn RX_HANDLER_PASS;\n--\nnet/bridge/br_input.c=471=int br_add_frame(struct net_bridge *br, __be16 type,\n--\nnet/bridge/br_input.c-474-{\nnet/bridge/br_input.c:475:\tstruct br_frame_type *ft;\nnet/bridge/br_input.c-476-\nnet/bridge/br_input.c:477:\thlist_for_each_entry(ft, \u0026br-\u003eframe_type_list, list) {\nnet/bridge/br_input.c-478-\t\tif (ft-\u003etype == type)\n--\nnet/bridge/br_input.c-487-\tft-\u003eframe_handler = frame_handler;\nnet/bridge/br_input.c:488:\thlist_add_head_rcu(\u0026ft-\u003elist, \u0026br-\u003eframe_type_list);\nnet/bridge/br_input.c-489-\n--\nnet/bridge/br_input.c=493=void br_del_frame(struct net_bridge *br, __be16 type)\nnet/bridge/br_input.c-494-{\nnet/bridge/br_input.c:495:\tstruct br_frame_type *ft;\nnet/bridge/br_input.c-496-\nnet/bridge/br_input.c:497:\thlist_for_each_entry(ft, \u0026br-\u003eframe_type_list, list) {\nnet/bridge/br_input.c-498-\t\tif (ft-\u003etype == type) {\n--\nnet/bridge/br_input.c=506=void br_del_frame_all(struct net_bridge *br)\nnet/bridge/br_input.c-507-{\nnet/bridge/br_input.c:508:\tstruct br_frame_type *ft;\nnet/bridge/br_input.c-509-\tstruct hlist_node *n;\nnet/bridge/br_input.c-510-\nnet/bridge/br_input.c:511:\thlist_for_each_entry_safe(ft, n, \u0026br-\u003eframe_type_list, list) {\nnet/bridge/br_input.c-512-\t\thlist_del_rcu(\u0026ft-\u003elist);\n--\nnet/bridge/br_mrp.c=994=static bool br_mrp_mim_process(struct br_mrp *mrp, struct net_bridge_port *port,\n--\nnet/bridge/br_mrp.c-1032- */\nnet/bridge/br_mrp.c:1033:static u8 br_mrp_get_frame_type(struct sk_buff *skb)\nnet/bridge/br_mrp.c-1034-{\n--\nnet/bridge/br_mrp.c=1070=static int br_mrp_rcv(struct net_bridge_port *p,\n--\nnet/bridge/br_mrp.c-1122-\tif (br_mrp_in_frame(skb)) {\nnet/bridge/br_mrp.c:1123:\t\tu8 in_type = br_mrp_get_frame_type(skb);\nnet/bridge/br_mrp.c-1124-\n--\nnet/bridge/br_private.h=500=struct net_bridge {\n--\nnet/bridge/br_private.h-502-\tspinlock_t\t\t\thash_lock;\nnet/bridge/br_private.h:503:\tstruct hlist_head\t\tframe_type_list;\nnet/bridge/br_private.h-504-\tstruct net_device\t\t*dev;\n--\nnet/bridge/br_private.h=933=rx_handler_func_t *br_get_rx_handler(const struct net_device *dev);\nnet/bridge/br_private.h-934-\nnet/bridge/br_private.h:935:struct br_frame_type {\nnet/bridge/br_private.h-936-\t__be16\t\t\ttype;\n"
} |
| 23/3 | 2026/09/05 09:17 | llm | kmsan-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 7599 output: 37 thoughts: 25 Thoughts: Here's my take on the thought process, as if it were my own: **Investigating `br_process_frame_type`** Okay, so I need to dive into this `br_process_frame_type` function. Specifically, I'll be looking at it within the `net/bridge/br_input.c` file. This is where the bridge input processing logic is, so it makes sense that the frame type would be handled here. I'm going to want to understand exactly how it determines the incoming frame's type and what it does with it. I suspect there may be a performance bottleneck or a logic error that I need to pinpoint. Time to fire up the editor and start reading through that section of the code. Let's see what we can find. |
| 24/3 | 2026/09/05 09:17 | tool | read-file |
0mArgs:{
"File": "net/bridge/br_input.c",
"FirstLine": 320,
"LineCount": 25
}Results: {
"Contents": " 320:\t/* Return 0 if the frame was not processed otherwise 1\n 321:\t * note: already called with rcu_read_lock\n 322:\t */\n 323:\tstatic int br_process_frame_type(struct net_bridge_port *p,\n 324:\t\t\t\t\t struct sk_buff *skb)\n 325:\t{\n 326:\t\tstruct br_frame_type *tmp;\n 327:\t\n 328:\t\thlist_for_each_entry_rcu(tmp, \u0026p-\u003ebr-\u003eframe_type_list, list)\n 329:\t\t\tif (unlikely(tmp-\u003etype == skb-\u003eprotocol))\n 330:\t\t\t\treturn tmp-\u003eframe_handler(p, skb);\n 331:\t\n 332:\t\treturn 0;\n 333:\t}\n 334:\t\n 335:\t/*\n 336:\t * Return NULL if skb is handled\n 337:\t * note: already called with rcu_read_lock\n 338:\t */\n 339:\tstatic rx_handler_result_t br_handle_frame(struct sk_buff **pskb)\n 340:\t{\n 341:\t\tenum skb_drop_reason reason = SKB_DROP_REASON_NOT_SPECIFIED;\n 342:\t\tstruct net_bridge_port *p;\n 343:\t\tstruct sk_buff *skb = *pskb;\n 344:\t\tconst unsigned char *dest = eth_hdr(skb)-\u003eh_dest;\n"
} |
| 25/3 | 2026/09/05 09:17 | llm | kmsan-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 8243 output: 208 thoughts: 699 Thoughts: **Analysis of `br_add_frame` for Uninitialized Memory and Memory Safety** Okay, let's break this down. I'm looking at the `br_add_frame` function in `br_input.c`. My initial concern is always uninitialized memory reads or potential leaks. The function adds a frame type to a bridge's list. I need to be meticulous. First, the code iterates through the existing frame types to ensure uniqueness. That's good defensive programming. Then, it allocates memory for a new `br_frame_type` structure using `kmalloc_obj`. This is critical. `kmalloc_obj(*ft)` means it allocates the size of the structure `ft`. Next, the structure fields are initialized: `type` and `frame_handler` are assigned their provided values, and the `list` member is added to the `hlist_head` of frame types. The `rcu` member is likely used for RCU-safe freeing later. The `hlist_add_head_rcu` function implicitly initializes `list`. Now, the important part: are there any uninitialized reads or potential leaks to userspace? Let's trace it. The `ft` structure is used internally by `br_process_frame_type` to read its `type` and `frame_handler` members, and to traverse the list via `list`. Importantly, all fields *read* are explicitly assigned values. There is no copying of data to userspace, so there's no risk of leaking uninitialized data through that channel. I see no uninitialized data being used for conditional branching. And no padding is copied to user space either. Next, I need to consider memory management, concurrency, and potential use-after-free (UAF) or memory leaks. The function dynamically allocates `br_frame_type` using `kmalloc_obj`. This structure will eventually be deallocated using `kfree_rcu`, indicating it's RCU-protected. That suggests we have to consider RCU synchronization. However, any bugs in RCU list traversal or memory freeing (like UAF or double-free) are things that would get caught by KASAN or other standard memory detectors. I feel confident about this point. Given the overall code analysis, this patch doesn't introduce any new uninitialized memory risks. Everything touched is initialized before being read. Reviewing the KMSAN rules helps me confirm my conclusion. The code doesn't meet the criteria for `NeedsKMSAN=true`. It falls into the category of code that primarily introduces risks like UAF, memory leaks, etc., which are caught by existing detectors. The patch doesn't create a risk of uninitialized memory usage or info-leaks. Therefore, `NeedsKMSAN` should be `false`. |
| 26/3 | 2026/09/05 09:17 | tool | set-results |
0mArgs:{
"KMSANReasoning": "The patch modifies how ethernet frame handlers (such as CFM and MRP) are registered in the bridge module. Instead of using static global `struct br_frame_type` variables, it dynamically allocates `struct br_frame_type` using `kmalloc_obj` and protects its removal with `kfree_rcu`.\n\nAll fields (`type`, `frame_handler`, and `list`) accessed by `br_process_frame_type` and list traversal functions are explicitly initialized before insertion into `br-\u003eframe_type_list`. None of these structures are exposed or copied to user space, nor are any uninitialized variables used in conditional branching or calculations. Any potential bugs (such as RCU synchronization issues, use-after-free, or memory leaks) are covered by KASAN and standard kernel debuggers. Therefore, a dedicated KMSAN fuzzing session is not needed.",
"NeedsKMSAN": false
}Results: {
"KMSANReasoning": "The patch modifies how ethernet frame handlers (such as CFM and MRP) are registered in the bridge module. Instead of using static global `struct br_frame_type` variables, it dynamically allocates `struct br_frame_type` using `kmalloc_obj` and protects its removal with `kfree_rcu`.\n\nAll fields (`type`, `frame_handler`, and `list`) accessed by `br_process_frame_type` and list traversal functions are explicitly initialized before insertion into `br-\u003eframe_type_list`. None of these structures are exposed or copied to user space, nor are any uninitialized variables used in conditional branching or calculations. Any potential bugs (such as RCU synchronization issues, use-after-free, or memory leaks) are covered by KASAN and standard kernel debuggers. Therefore, a dedicated KMSAN fuzzing session is not needed.",
"NeedsKMSAN": false
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|