| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/04 08:20 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": [
"BRIDGE",
"BRIDGE_CFM",
"BRIDGE_MRP"
],
"FocusSymbols": [
"br_process_frame_type",
"br_cfm_frame_rx",
"br_mrp_process",
"br_cfm_mep_create",
"br_cfm_mep_delete",
"br_mrp_add",
"br_mrp_del"
],
"KMSANReasoning": "The patch refactors Ethernet frame handler dispatching for CFM (Connectivity Fault Management) and MRP (Media Redundancy Protocol) in the bridge driver. It replaces the dynamically allocated/registered `frame_type_list` and `struct br_frame_type` with bridge option flags (`BROPT_CFM_ENABLED`, `BROPT_MRP_ENABLED`) and direct function calls in `br_process_frame_type()`.\n\nThis refactoring does not introduce or modify:\n1. Kernel data structures or info-leaks copied to user space.\n2. Uninitialized variables, struct fields, or padding.\n3. Length calculations or buffer bounds that could expose uninitialized memory.\n\nAll options flags are stored within the zero-initialized `struct net_bridge` and manipulated via bitwise operations (`br_opt_toggle`, `br_opt_get`). Any potential bugs in this change (such as concurrency issues or invalid pointer dereferences) are covered by standard KASAN/LOCKDEP detectors. Thus, a dedicated KMSAN fuzzing session is not warranted.",
"NeedsKMSAN": false,
"Reasoning": "The patch refactors the bridge frame RX processing logic for CFM (Connectivity Fault Management) and MRP (Media Redundancy Protocol) frames. Instead of maintaining a dynamic frame_type_list with RCU traversal, it directly tests bridge option bitmasks and invokes br_cfm_frame_rx and br_mrp_process. It also modifies MEP and MRP add/delete state toggling. This touches reachable core networking code easily configured and fuzzed via netlink and virtual bridge network devices.",
"WorthFuzzing": true
} |
| 1/1 | 2026/09/04 08:20 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 583f171d64e2f1efef88a35165ec28e54df17d26\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Fri Sep 4 08:20:43 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..9dcc97d63a6fc 100644\n--- a/net/bridge/br_cfm.c\n+++ b/net/bridge/br_cfm.c\n@@ -367,7 +367,7 @@ static u32 ccm_tlv_extract(struct sk_buff *skb, u32 index,\n }\n \n /* note: already called with rcu_read_lock */\n-static int br_cfm_frame_rx(struct net_bridge_port *port, struct sk_buff *skb)\n+int br_cfm_frame_rx(struct net_bridge_port *port, struct sk_buff *skb)\n {\n \tu32 mdlevel, interval, size, index, max;\n \tconst struct br_cfm_common_hdr *hdr;\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@@ -559,7 +554,7 @@ int br_cfm_mep_create(struct net_bridge *br,\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+\t\tbr_opt_toggle(br, BROPT_CFM_ENABLED, true);\n \n \thlist_add_tail_rcu(\u0026mep-\u003ehead, \u0026br-\u003emep_list);\n \n@@ -588,7 +583,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_opt_toggle(br, BROPT_CFM_ENABLED, false);\n }\n \n int br_cfm_mep_delete(struct net_bridge *br,\ndiff --git a/net/bridge/br_device.c b/net/bridge/br_device.c\nindex ff55dab736326..e01c44a90d84b 100644\n--- a/net/bridge/br_device.c\n+++ b/net/bridge/br_device.c\n@@ -503,7 +503,6 @@ void br_dev_setup(struct net_device *dev)\n \tspin_lock_init(\u0026br-\u003elock);\n \tINIT_LIST_HEAD(\u0026br-\u003eport_list);\n \tINIT_HLIST_HEAD(\u0026br-\u003efdb_list);\n-\tINIT_HLIST_HEAD(\u0026br-\u003eframe_type_list);\n #if IS_ENABLED(CONFIG_BRIDGE_MRP)\n \tINIT_HLIST_HEAD(\u0026br-\u003emrp_list);\n #endif\ndiff --git a/net/bridge/br_input.c b/net/bridge/br_input.c\nindex d87a5f9fa92b7..8bed72baf1615 100644\n--- a/net/bridge/br_input.c\n+++ b/net/bridge/br_input.c\n@@ -317,17 +317,25 @@ static int nf_hook_bridge_pre(struct sk_buff *skb, struct sk_buff **pskb)\n \treturn RX_HANDLER_CONSUMED;\n }\n \n+#define BR_CFM_MRP_OPTS \\\n+\t((IS_ENABLED(CONFIG_BRIDGE_CFM) ? BIT(BROPT_CFM_ENABLED) : 0UL) | \\\n+\t (IS_ENABLED(CONFIG_BRIDGE_MRP) ? BIT(BROPT_MRP_ENABLED) : 0UL))\n+\n /* Return 0 if the frame was not processed otherwise 1\n * note: already called with rcu_read_lock\n */\n static int br_process_frame_type(struct net_bridge_port *p,\n \t\t\t\t struct sk_buff *skb)\n {\n-\tstruct br_frame_type *tmp;\n+\tstruct net_bridge *br = p-\u003ebr;\n+\n+\tif (skb-\u003eprotocol == htons(ETH_P_CFM) \u0026\u0026\n+\t br_opt_get(br, BROPT_CFM_ENABLED))\n+\t\treturn br_cfm_frame_rx(p, skb);\n \n-\thlist_for_each_entry_rcu(tmp, \u0026p-\u003ebr-\u003eframe_type_list, list)\n-\t\tif (unlikely(tmp-\u003etype == skb-\u003eprotocol))\n-\t\t\treturn tmp-\u003eframe_handler(p, skb);\n+\tif (skb-\u003eprotocol == htons(ETH_P_MRP) \u0026\u0026\n+\t br_opt_get(br, BROPT_MRP_ENABLED))\n+\t\treturn br_mrp_process(p, skb);\n \n \treturn 0;\n }\n@@ -425,7 +433,8 @@ static rx_handler_result_t br_handle_frame(struct sk_buff **pskb)\n \t\t}\n \t}\n \n-\tif (unlikely(br_process_frame_type(p, skb)))\n+\tif (unlikely((READ_ONCE(p-\u003ebr-\u003eoptions) \u0026 BR_CFM_MRP_OPTS) \u0026\u0026\n+\t\t br_process_frame_type(p, skb)))\n \t\treturn RX_HANDLER_PASS;\n \n forward:\n@@ -467,19 +476,3 @@ rx_handler_func_t *br_get_rx_handler(const struct net_device *dev)\n \n \treturn br_handle_frame;\n }\n-\n-void br_add_frame(struct net_bridge *br, struct br_frame_type *ft)\n-{\n-\thlist_add_head_rcu(\u0026ft-\u003elist, \u0026br-\u003eframe_type_list);\n-}\n-\n-void br_del_frame(struct net_bridge *br, struct br_frame_type *ft)\n-{\n-\tstruct br_frame_type *tmp;\n-\n-\thlist_for_each_entry(tmp, \u0026br-\u003eframe_type_list, list)\n-\t\tif (ft == tmp) {\n-\t\t\thlist_del_rcu(\u0026ft-\u003elist);\n-\t\t\treturn;\n-\t\t}\n-}\ndiff --git a/net/bridge/br_mrp.c b/net/bridge/br_mrp.c\nindex ef16d07039241..dce6efa96c4c6 100644\n--- a/net/bridge/br_mrp.c\n+++ b/net/bridge/br_mrp.c\n@@ -6,13 +6,6 @@\n static const u8 mrp_test_dmac[ETH_ALEN] = { 0x1, 0x15, 0x4e, 0x0, 0x0, 0x1 };\n 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 +479,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_opt_toggle(br, BROPT_MRP_ENABLED, false);\n }\n \n /* Adds a new MRP instance.\n@@ -536,7 +529,7 @@ int br_mrp_add(struct net_bridge *br, struct br_mrp_instance *instance)\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+\t\tbr_opt_toggle(br, BROPT_MRP_ENABLED, true);\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@@ -1241,7 +1234,7 @@ static int br_mrp_rcv(struct net_bridge_port *p,\n * normal forwarding.\n * note: already called with rcu_read_lock\n */\n-static int br_mrp_process(struct net_bridge_port *p, struct sk_buff *skb)\n+int br_mrp_process(struct net_bridge_port *p, struct sk_buff *skb)\n {\n \t/* If there is no MRP instance do normal forwarding */\n \tif (likely(!test_bit(BR_MRP_AWARE_BIT, \u0026p-\u003eflags)))\ndiff --git a/net/bridge/br_private.h b/net/bridge/br_private.h\nindex d337b1cfb980d..b01997ea95089 100644\n--- a/net/bridge/br_private.h\n+++ b/net/bridge/br_private.h\n@@ -495,12 +495,13 @@ enum net_bridge_opts {\n \tBROPT_MST_ENABLED,\n \tBROPT_MDB_OFFLOAD_FAIL_NOTIFICATION,\n \tBROPT_FDB_LOCAL_VLAN_0,\n+\tBROPT_CFM_ENABLED,\n+\tBROPT_MRP_ENABLED,\n };\n \n struct net_bridge {\n \tspinlock_t\t\t\tlock;\n \tspinlock_t\t\t\thash_lock;\n-\tstruct hlist_head\t\tframe_type_list;\n \tstruct net_device\t\t*dev;\n \tunsigned long\t\t\toptions;\n \t/* These fields are accessed on each packet */\n@@ -932,16 +933,6 @@ int nbp_backup_change(struct net_bridge_port *p, struct net_device *backup_dev);\n int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb);\n rx_handler_func_t *br_get_rx_handler(const struct net_device *dev);\n \n-struct br_frame_type {\n-\t__be16\t\t\ttype;\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-};\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-\n static inline bool br_rx_handler_check_rcu(const struct net_device *dev)\n {\n \treturn rcu_dereference(dev-\u003erx_handler) == br_get_rx_handler(dev);\n@@ -2080,6 +2071,7 @@ int br_mrp_parse(struct net_bridge *br, struct net_bridge_port *p,\n bool br_mrp_enabled(struct net_bridge *br);\n void br_mrp_port_del(struct net_bridge *br, struct net_bridge_port *p);\n int br_mrp_fill_info(struct sk_buff *skb, struct net_bridge *br);\n+int br_mrp_process(struct net_bridge_port *p, struct sk_buff *skb);\n #else\n static inline int br_mrp_parse(struct net_bridge *br, struct net_bridge_port *p,\n \t\t\t struct nlattr *attr, int cmd,\n@@ -2103,6 +2095,11 @@ static inline int br_mrp_fill_info(struct sk_buff *skb, struct net_bridge *br)\n \treturn 0;\n }\n \n+static inline int br_mrp_process(struct net_bridge_port *p, struct sk_buff *skb)\n+{\n+\treturn 0;\n+}\n+\n #endif\n \n /* br_cfm.c */\n@@ -2111,6 +2108,7 @@ int br_cfm_parse(struct net_bridge *br, struct net_bridge_port *p,\n \t\t struct nlattr *attr, int cmd, struct netlink_ext_ack *extack);\n bool br_cfm_created(struct net_bridge *br);\n void br_cfm_port_del(struct net_bridge *br, struct net_bridge_port *p);\n+int br_cfm_frame_rx(struct net_bridge_port *port, struct sk_buff *skb);\n int br_cfm_config_fill_info(struct sk_buff *skb, struct net_bridge *br);\n int br_cfm_status_fill_info(struct sk_buff *skb,\n \t\t\t struct net_bridge *br,\n@@ -2135,6 +2133,12 @@ static inline void br_cfm_port_del(struct net_bridge *br,\n {\n }\n \n+static inline int br_cfm_frame_rx(struct net_bridge_port *port,\n+\t\t\t\t struct sk_buff *skb)\n+{\n+\treturn 0;\n+}\n+\n static inline int br_cfm_config_fill_info(struct sk_buff *skb, struct net_bridge *br)\n {\n \treturn -EOPNOTSUPP;\n"
} |
| 2/1 | 2026/09/04 08:20 | agent | patch-evaluator |
0mModel:core Args: null Results: {
"EnableConfigs": [
"BRIDGE",
"BRIDGE_CFM",
"BRIDGE_MRP"
],
"FocusSymbols": [
"br_process_frame_type",
"br_cfm_frame_rx",
"br_mrp_process",
"br_cfm_mep_create",
"br_cfm_mep_delete",
"br_mrp_add",
"br_mrp_del"
],
"Reasoning": "The patch refactors the bridge frame RX processing logic for CFM (Connectivity Fault Management) and MRP (Media Redundancy Protocol) frames. Instead of maintaining a dynamic frame_type_list with RCU traversal, it directly tests bridge option bitmasks and invokes br_cfm_frame_rx and br_mrp_process. It also modifies MEP and MRP add/delete state toggling. This touches reachable core networking code easily configured and fuzzed via netlink and virtual bridge network devices.",
"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 583f171d64e2f1efef88a35165ec28e54df17d26
Author: syz-cluster <triage@syzkaller.com>
Date: Fri Sep 4 08:20:43 2026 +0000
syz-cluster: applied patch under review
diff --git a/net/bridge/br_cfm.c b/net/bridge/br_cfm.c
index dea56fffa1c19..9dcc97d63a6fc 100644
--- a/net/bridge/br_cfm.c
+++ b/net/bridge/br_cfm.c
@@ -367,7 +367,7 @@ static u32 ccm_tlv_extract(struct sk_buff *skb, u32 index,
}
/* note: already called with rcu_read_lock */
-static int br_cfm_frame_rx(struct net_bridge_port *port, struct sk_buff *skb)
+int br_cfm_frame_rx(struct net_bridge_port *port, struct sk_buff *skb)
{
u32 mdlevel, interval, size, index, max;
const struct br_cfm_common_hdr *hdr;
@@ -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,
@@ -559,7 +554,7 @@ int br_cfm_mep_create(struct net_bridge *br,
INIT_DELAYED_WORK(&mep->ccm_tx_dwork, ccm_tx_work_expired);
if (hlist_empty(&br->mep_list))
- br_add_frame(br, &cfm_frame_type);
+ br_opt_toggle(br, BROPT_CFM_ENABLED, true);
hlist_add_tail_rcu(&mep->head, &br->mep_list);
@@ -588,7 +583,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_opt_toggle(br, BROPT_CFM_ENABLED, false);
}
int br_cfm_mep_delete(struct net_bridge *br,
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index ff55dab736326..e01c44a90d84b 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -503,7 +503,6 @@ void br_dev_setup(struct net_device *dev)
spin_lock_init(&br->lock);
INIT_LIST_HEAD(&br->port_list);
INIT_HLIST_HEAD(&br->fdb_list);
- INIT_HLIST_HEAD(&br->frame_type_list);
#if IS_ENABLED(CONFIG_BRIDGE_MRP)
INIT_HLIST_HEAD(&br->mrp_list);
#endif
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index d87a5f9fa92b7..8bed72baf1615 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -317,17 +317,25 @@ static int nf_hook_bridge_pre(struct sk_buff *skb, struct sk_buff **pskb)
return RX_HANDLER_CONSUMED;
}
+#define BR_CFM_MRP_OPTS \
+ ((IS_ENABLED(CONFIG_BRIDGE_CFM) ? BIT(BROPT_CFM_ENABLED) : 0UL) | \
+ (IS_ENABLED(CONFIG_BRIDGE_MRP) ? BIT(BROPT_MRP_ENABLED) : 0UL))
+
/* Return 0 if the frame was not processed otherwise 1
* note: already called with rcu_read_lock
*/
static int br_process_frame_type(struct net_bridge_port *p,
struct sk_buff *skb)
{
- struct br_frame_type *tmp;
+ struct net_bridge *br = p->br;
+
+ if (skb->protocol == htons(ETH_P_CFM) &&
+ br_opt_get(br, BROPT_CFM_ENABLED))
+ return br_cfm_frame_rx(p, skb);
- hlist_for_each_entry_rcu(tmp, &p->br->frame_type_list, list)
- if (unlikely(tmp->type == skb->protocol))
- return tmp->frame_handler(p, skb);
+ if (skb->protocol == htons(ETH_P_MRP) &&
+ br_opt_get(br, BROPT_MRP_ENABLED))
+ return br_mrp_process(p, skb);
return 0;
}
@@ -425,7 +433,8 @@ static rx_handler_result_t br_handle_frame(struct sk_buff **pskb)
}
}
- if (unlikely(br_process_frame_type(p, skb)))
+ if (unlikely((READ_ONCE(p->br->options) & BR_CFM_MRP_OPTS) &&
+ br_process_frame_type(p, skb)))
return RX_HANDLER_PASS;
forward:
@@ -467,19 +476,3 @@ 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)
-{
- hlist_add_head_rcu(&ft->list, &br->frame_type_list);
-}
-
-void br_del_frame(struct net_bridge *br, struct br_frame_type *ft)
-{
- struct br_frame_type *tmp;
-
- hlist_for_each_entry(tmp, &br->frame_type_list, list)
- if (ft == tmp) {
- hlist_del_rcu(&ft->list);
- return;
- }
-}
diff --git a/net/bridge/br_mrp.c b/net/bridge/br_mrp.c
index ef16d07039241..dce6efa96c4c6 100644
--- a/net/bridge/br_mrp.c
+++ b/net/bridge/br_mrp.c
@@ -6,13 +6,6 @@
static const u8 mrp_test_dmac[ETH_ALEN] = { 0x1, 0x15, 0x4e, 0x0, 0x0, 0x1 };
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 +479,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_opt_toggle(br, BROPT_MRP_ENABLED, false);
}
/* Adds a new MRP instance.
@@ -536,7 +529,7 @@ int br_mrp_add(struct net_bridge *br, struct br_mrp_instance *instance)
rcu_assign_pointer(mrp->s_port, p);
if (hlist_empty(&br->mrp_list))
- br_add_frame(br, &mrp_frame_type);
+ br_opt_toggle(br, BROPT_MRP_ENABLED, true);
INIT_DELAYED_WORK(&mrp->test_work, br_mrp_test_work_expired);
INIT_DELAYED_WORK(&mrp->in_test_work, br_mrp_in_test_work_expired);
@@ -1241,7 +1234,7 @@ static int br_mrp_rcv(struct net_bridge_port *p,
* normal forwarding.
* note: already called with rcu_read_lock
*/
-static int br_mrp_process(struct net_bridge_port *p, struct sk_buff *skb)
+int br_mrp_process(struct net_bridge_port *p, struct sk_buff *skb)
{
/* If there is no MRP instance do normal forwarding */
if (likely(!test_bit(BR_MRP_AWARE_BIT, &p->flags)))
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index d337b1cfb980d..b01997ea95089 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -495,12 +495,13 @@ enum net_bridge_opts {
BROPT_MST_ENABLED,
BROPT_MDB_OFFLOAD_FAIL_NOTIFICATION,
BROPT_FDB_LOCAL_VLAN_0,
+ BROPT_CFM_ENABLED,
+ BROPT_MRP_ENABLED,
};
struct net_bridge {
spinlock_t lock;
spinlock_t hash_lock;
- struct hlist_head frame_type_list;
struct net_device *dev;
unsigned long options;
/* These fields are accessed on each packet */
@@ -932,16 +933,6 @@ int nbp_backup_change(struct net_bridge_port *p, struct net_device *backup_dev);
int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
rx_handler_func_t *br_get_rx_handler(const struct net_device *dev);
-struct br_frame_type {
- __be16 type;
- int (*frame_handler)(struct net_bridge_port *port,
- struct sk_buff *skb);
- struct hlist_node list;
-};
-
-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);
-
static inline bool br_rx_handler_check_rcu(const struct net_device *dev)
{
return rcu_dereference(dev->rx_handler) == br_get_rx_handler(dev);
@@ -2080,6 +2071,7 @@ int br_mrp_parse(struct net_bridge *br, struct net_bridge_port *p,
bool br_mrp_enabled(struct net_bridge *br);
void br_mrp_port_del(struct net_bridge *br, struct net_bridge_port *p);
int br_mrp_fill_info(struct sk_buff *skb, struct net_bridge *br);
+int br_mrp_process(struct net_bridge_port *p, struct sk_buff *skb);
#else
static inline int br_mrp_parse(struct net_bridge *br, struct net_bridge_port *p,
struct nlattr *attr, int cmd,
@@ -2103,6 +2095,11 @@ static inline int br_mrp_fill_info(struct sk_buff *skb, struct net_bridge *br)
return 0;
}
+static inline int br_mrp_process(struct net_bridge_port *p, struct sk_buff *skb)
+{
+ return 0;
+}
+
#endif
/* br_cfm.c */
@@ -2111,6 +2108,7 @@ int br_cfm_parse(struct net_bridge *br, struct net_bridge_port *p,
struct nlattr *attr, int cmd, struct netlink_ext_ack *extack);
bool br_cfm_created(struct net_bridge *br);
void br_cfm_port_del(struct net_bridge *br, struct net_bridge_port *p);
+int br_cfm_frame_rx(struct net_bridge_port *port, struct sk_buff *skb);
int br_cfm_config_fill_info(struct sk_buff *skb, struct net_bridge *br);
int br_cfm_status_fill_info(struct sk_buff *skb,
struct net_bridge *br,
@@ -2135,6 +2133,12 @@ static inline void br_cfm_port_del(struct net_bridge *br,
{
}
+static inline int br_cfm_frame_rx(struct net_bridge_port *port,
+ struct sk_buff *skb)
+{
+ return 0;
+}
+
static inline int br_cfm_config_fill_info(struct sk_buff *skb, struct net_bridge *br)
{
return -EOPNOTSUPP;
|
| 3/2 | 2026/09/04 08:20 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 6321 output: 28 thoughts: 512 Thoughts: **Kernel Patch Evaluation for Syzkaller Fuzzing** Okay, here's what I'm thinking. The task is to evaluate this kernel patch series and determine if it's worth fuzzing with syzkaller. Sounds like a standard day in triage. I’ve got to analyze the changes and assess the potential risk and reward of fuzzing. First, I see the patch touches `net/bridge/br_cfm.c`, `net/bridge/br_device.c`, `net/bridge/br_input.c`, `net/bridge/br_mrp.c`, and `net/bridge/br_private.h`. That's all within the networking bridge code, so it warrants a closer look. The task itself is benign, focusing on Linux kernel maintenance and testing. No exploits or offensive tooling here, just standard defensive measures. Now, looking at the patch details, it seems like they are replacing dynamic registration of `br_frame_type` with static options checks and direct calls. This involves `BROPT_CFM_ENABLED`, `BROPT_MRP_ENABLED`, `br_cfm_frame_rx`, and `br_mrp_process` calls in `br_input.c`. I need to remember, this is core bridge code, and `br_handle_frame` and `br_process_frame_type` are definitely reachable in virtualized environments like QEMU or GCE. This is a critical point. The million-dollar question: is this worth fuzzing? Let's consult the guidelines. They clearly state that `WorthFuzzing` should be `true` whenever the patch touches *reachable* executable code, especially within core subsystems like networking. Any modification, especially a refactoring of reachable data structures, helper abstractions, or algorithm flows, means fuzzing is required. I'm not just blindly trusting claims of "no functional change" or "refactoring." If reachable executable code is modified or refactored, it *must* be fuzzed, according to the instructions. So, this looks like a clear case for `WorthFuzzing = true`. Just to be thorough, I'll need to double-check the Kconfig options. Let's see if BRIDGE, BRIDGE_CFM, and BRIDGE_MRP are enabled using codesearch or grep. Checking the Kconfig requirements, checking FocusSymbols, is the last step. |
| 4/2 | 2026/09/04 08:20 | tool | grepper |
0mArgs:{
"Expression": "config BRIDGE_CFM",
"PathPrefix": "net/bridge"
}Results: {
"Output": "net/bridge/Kconfig=64=config BRIDGE_MRP\n--\nnet/bridge/Kconfig-75-\nnet/bridge/Kconfig:76:config BRIDGE_CFM\nnet/bridge/Kconfig-77-\tbool \"CFM protocol\"\n"
} |
| 5/2 | 2026/09/04 08:20 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 7443 output: 33 thoughts: 21 Thoughts: Here's my summary, as though I'm reading and processing the provided text: **Diving into the Bridge Configuration** Okay, let's pull up the `net/bridge/Kconfig` file and take a look at what's happening around lines 60 to 90. I'm guessing this section likely deals with the core configuration options for the Linux bridge module. Given the Kconfig context, I'm expecting to see definitions for feature toggles, maybe some configurable parameters with default values, and potentially some dependencies on other kernel subsystems. I'll be looking for clues on how the bridge module's behavior is exposed to the user – what knobs can be turned, what choices are offered. I need to understand how the bridge is configured to determine if it will meet my needs. I'll be paying close attention to any dependencies listed here, because those have implications for module loading and overall system setup. Let's see what gems are hidden in this section. |
| 6/2 | 2026/09/04 08:21 | tool | read-file |
0mArgs:{
"File": "net/bridge/Kconfig",
"FirstLine": 55,
"LineCount": 45
}Results: {
"Contents": " 55:\t\thelp\n 56:\t\t If you say Y here, then the Ethernet bridge will be able selectively\n 57:\t\t receive and forward traffic based on VLAN information in the packet\n 58:\t\t any VLAN information configured on the bridge port or bridge device.\n 59:\t\n 60:\t\t Say N to exclude this support and reduce the binary size.\n 61:\t\n 62:\t\t If unsure, say Y.\n 63:\t\n 64:\tconfig BRIDGE_MRP\n 65:\t\tbool \"MRP protocol\"\n 66:\t\tdepends on BRIDGE\n 67:\t\tdefault n\n 68:\t\thelp\n 69:\t\t If you say Y here, then the Ethernet bridge will be able to run MRP\n 70:\t\t protocol to detect loops\n 71:\t\n 72:\t\t Say N to exclude this support and reduce the binary size.\n 73:\t\n 74:\t\t If unsure, say N.\n 75:\t\n 76:\tconfig BRIDGE_CFM\n 77:\t\tbool \"CFM protocol\"\n 78:\t\tdepends on BRIDGE\n 79:\t\thelp\n 80:\t\t If you say Y here, then the Ethernet bridge will be able to run CFM\n 81:\t\t protocol according to 802.1Q section 12.14\n 82:\t\n 83:\t\t Say N to exclude this support and reduce the binary size.\n 84:\t\n 85:\t\t If unsure, say N.\n"
} |
| 7/2 | 2026/09/04 08:21 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 8090 output: 32 thoughts: 26 Thoughts: Okay, let's dive into this. Here's my thought process on this: **Investigating Bridge Configuration Dependencies** Alright, before I go any further down this rabbit hole, I need to figure out the pre-requisites for the bridge configuration. Best place to start is always the Kconfig file, so I'm thinking, "Let's check the top of `net/bridge/Kconfig`". My initial plan is to quickly scan that file to see if `CONFIG_BRIDGE` has any dependencies. I need to understand if it relies on other options or features being enabled first. I'm hoping I can get a clear picture right away about whether I need to enable any other configurations before I can even start working on this. I'm expecting this dependency structure to be reasonably straightforward, but you never know. I know the Kconfig files usually describe the dependencies clearly, so this should be a quick check. |
| 8/2 | 2026/09/04 08:21 | tool | read-file |
0mArgs:{
"File": "net/bridge/Kconfig",
"FirstLine": 1,
"LineCount": 40
}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 31:\t\t To compile this code as a module, choose M here: the module\n 32:\t\t will be called bridge.\n 33:\t\n 34:\t\t If unsure, say N.\n 35:\t\n 36:\tconfig BRIDGE_IGMP_SNOOPING\n 37:\t\tbool \"IGMP/MLD snooping\"\n 38:\t\tdepends on BRIDGE\n 39:\t\tdepends on INET\n 40:\t\tdefault y\n"
} |
| 9/2 | 2026/09/04 08:21 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 8913 output: 29 thoughts: 17 Thoughts: Here's my take on the thought process: **Diving into the Kernel Configuration Landscape** Okay, so I need to figure out the dependencies for the `BRIDGE` functionality within the kernel configuration. My initial instinct is to head straight to `net/Kconfig`. That's where all the network-related configuration options are typically defined, and where I'd expect to find the dependencies for something as fundamental as the bridging module. Time to open that file and see what `BRIDGE`'s Kconfig entries reveal. That should give me the lowdown on any prerequisite options or hardware requirements. |
| 10/2 | 2026/09/04 08:21 | tool | grepper |
0mArgs:{
"Expression": "source.*net/bridge/Kconfig",
"PathPrefix": "net"
}Results: {
"Output": "net/Kconfig=259=source \"net/802/Kconfig\"\nnet/Kconfig:260:source \"net/bridge/Kconfig\"\nnet/Kconfig-261-source \"net/dsa/Kconfig\"\n"
} |
| 11/2 | 2026/09/04 08:21 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 9155 output: 37 thoughts: 654 Thoughts: **Analyzing the Bridge CFM/MRP Patch** Okay, so I'm looking at this patch related to Bridge CFM and MRP, and the first thing I notice is the dependency structure within `net/Kconfig`: `BRIDGE` is standard, located under `net`, and both `BRIDGE_CFM` and `BRIDGE_MRP` rely on it. Seems logical. Next, I'm digging into the function changes. In `net/bridge/br_cfm.c`, I see `br_cfm_frame_rx` is now non-static, suggesting it's being exposed, probably to `br_process_frame_type`. Then, `br_cfm_mep_create` and `mep_delete_implementation` are modified to enable or disable CFM via `br_opt_toggle`, which makes sense. Over in `net/bridge/br_mrp.c`, the pattern continues: `br_mrp_process` goes non-static and gets called by `br_process_frame_type`. `br_mrp_del_impl` and `br_mrp_add` also toggle MRP enablement. Now, the really interesting part: `net/bridge/br_input.c`. Here, `br_process_frame_type` is modified to check the `BROPT_CFM_ENABLED` and `BROPT_MRP_ENABLED` flags, directly invoking the appropriate handlers. I also see that `br_handle_frame` is modified to check `(READ_ONCE(p->br->options) & BR_CFM_MRP_OPTS) && br_process_frame_type(p, skb)`. Interestingly, the patch removes `br_add_frame` and `br_del_frame`. My immediate question is about the scope of `br_handle_frame`. I'm going to determine if it is specific to CFM/MRP or handles every frame. It looks like `br_handle_frame` *is* called for every frame on the bridge, but the functions like `br_process_frame_type`, `br_cfm_frame_rx`, `br_mrp_process`, `br_cfm_mep_create`, and `br_mrp_add` are the feature entry points. So, for symbol analysis I'm thinking the following: `br_process_frame_type`, `br_cfm_frame_rx`, `br_mrp_process`, `br_cfm_mep_create`, and `br_mrp_add` are crucial. I need to confirm if `br_handle_frame` is *too* broad to be useful in this context, or if it is a central function that also requires attention. It's the bridge's RX handler, but `br_process_frame_type` seems like the more specific function within `br_input.c`. I need to verify that `br_process_frame_type` is *not* inlined. I need to check `br_input.c` for that. |
| 12/2 | 2026/09/04 08:21 | tool | read-file |
0mArgs:{
"File": "net/bridge/br_input.c",
"FirstLine": 315,
"LineCount": 45
}Results: {
"Contents": " 315:\t\tbr_handle_frame_finish(dev_net(skb-\u003edev), NULL, skb);\n 316:\t#endif\n 317:\t\treturn RX_HANDLER_CONSUMED;\n 318:\t}\n 319:\t\n 320:\t#define BR_CFM_MRP_OPTS \\\n 321:\t\t((IS_ENABLED(CONFIG_BRIDGE_CFM) ? BIT(BROPT_CFM_ENABLED) : 0UL) | \\\n 322:\t\t (IS_ENABLED(CONFIG_BRIDGE_MRP) ? BIT(BROPT_MRP_ENABLED) : 0UL))\n 323:\t\n 324:\t/* Return 0 if the frame was not processed otherwise 1\n 325:\t * note: already called with rcu_read_lock\n 326:\t */\n 327:\tstatic int br_process_frame_type(struct net_bridge_port *p,\n 328:\t\t\t\t\t struct sk_buff *skb)\n 329:\t{\n 330:\t\tstruct net_bridge *br = p-\u003ebr;\n 331:\t\n 332:\t\tif (skb-\u003eprotocol == htons(ETH_P_CFM) \u0026\u0026\n 333:\t\t br_opt_get(br, BROPT_CFM_ENABLED))\n 334:\t\t\treturn br_cfm_frame_rx(p, skb);\n 335:\t\n 336:\t\tif (skb-\u003eprotocol == htons(ETH_P_MRP) \u0026\u0026\n 337:\t\t br_opt_get(br, BROPT_MRP_ENABLED))\n 338:\t\t\treturn br_mrp_process(p, skb);\n 339:\t\n 340:\t\treturn 0;\n 341:\t}\n 342:\t\n 343:\t/*\n 344:\t * Return NULL if skb is handled\n 345:\t * note: already called with rcu_read_lock\n 346:\t */\n 347:\tstatic rx_handler_result_t br_handle_frame(struct sk_buff **pskb)\n 348:\t{\n 349:\t\tenum skb_drop_reason reason = SKB_DROP_REASON_NOT_SPECIFIED;\n 350:\t\tstruct net_bridge_port *p;\n 351:\t\tstruct sk_buff *skb = *pskb;\n 352:\t\tconst unsigned char *dest = eth_hdr(skb)-\u003eh_dest;\n 353:\t\n 354:\t\tif (unlikely(skb-\u003epkt_type == PACKET_LOOPBACK))\n 355:\t\t\treturn RX_HANDLER_PASS;\n 356:\t\n 357:\t\tif (!is_valid_ether_addr(eth_hdr(skb)-\u003eh_source)) {\n 358:\t\t\treason = SKB_DROP_REASON_MAC_INVALID_SOURCE;\n 359:\t\t\tgoto drop;\n"
} |
| 13/2 | 2026/09/04 08:21 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 11265 output: 29 thoughts: 166 Thoughts: **Analyzing Bridge Protocol Code** Okay, here's what I'm seeing in this network bridge code. I've got my eye on `br_cfm_frame_rx` and `br_mrp_process`, both non-static symbols, and they look like they're in the critical path in `br_cfm.c` and `br_mrp.c`, respectively. I need to understand how these handle incoming traffic. Then there's `br_cfm_mep_create` and `br_mrp_add`; these are likely the registration points for new MEPS or MRP listeners. They're also non-static entry points, so they're designed to be called from elsewhere. Similarly, I'm noting `br_cfm_mep_delete` and `br_mrp_del` (and also `br_mrp_del_impl` which looks like it does the actual work). These are, obviously, the cleanup methods. The key to all of this, I believe, lies in `br_mrp_del`. I need to track down exactly who calls `br_mrp_del` and any other callers in both `br_mrp.c` and `br_cfm.c`. Understanding how these deletion routines are triggered is crucial for understanding the complete picture of how the bridge's MRP/CFM protocol state is managed, and where potential race conditions or resource leaks might be. I'll start digging into the call graphs now. |
| 14/2 | 2026/09/04 08:21 | tool | grepper |
0mArgs:{
"Expression": "br_mrp_del",
"PathPrefix": "net/bridge"
}Results: {
"Output": "net/bridge/br_mrp.c=343=static void br_mrp_in_test_work_expired(struct work_struct *work)\n--\nnet/bridge/br_mrp.c-418- */\nnet/bridge/br_mrp.c:419:static void br_mrp_del_impl(struct net_bridge *br, struct br_mrp *mrp)\nnet/bridge/br_mrp.c-420-{\n--\nnet/bridge/br_mrp.c=488=int br_mrp_add(struct net_bridge *br, struct br_mrp_instance *instance)\n--\nnet/bridge/br_mrp.c-544-delete_mrp:\nnet/bridge/br_mrp.c:545:\tbr_mrp_del_impl(br, mrp);\nnet/bridge/br_mrp.c-546-\n--\nnet/bridge/br_mrp.c=553=void br_mrp_port_del(struct net_bridge *br, struct net_bridge_port *p)\n--\nnet/bridge/br_mrp.c-560-\nnet/bridge/br_mrp.c:561:\tbr_mrp_del_impl(br, mrp);\nnet/bridge/br_mrp.c-562-}\n--\nnet/bridge/br_mrp.c-566- */\nnet/bridge/br_mrp.c:567:int br_mrp_del(struct net_bridge *br, struct br_mrp_instance *instance)\nnet/bridge/br_mrp.c-568-{\n--\nnet/bridge/br_mrp.c-573-\nnet/bridge/br_mrp.c:574:\tbr_mrp_del_impl(br, mrp);\nnet/bridge/br_mrp.c-575-\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_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"
} |
| 15/2 | 2026/09/04 08:21 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 12511 output: 31 thoughts: 17 Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience: **Checking a Related Function** Okay, so we're looking at a deletion function, likely within a system related to MEP (Mechanical, Electrical, and Plumbing) or CFM (presumably Cubic Feet per Minute, or something similar, context is key). The fact that I'm immediately thinking to check `br_cfm_mep_delete` suggests a few things: 1. **Dependency Awareness:** I'm assuming there's likely a relationship or dependency between the main function we're analyzing (implied by the original context, which I don't have but assume I am aware of) and this `br_cfm_mep_delete` function. Perhaps data is shared, or cascading deletes are intended. 2. **Completeness/Thoroughness:** My first thought is to ensure a comprehensive view. Deletion functions are often touchy; incomplete deletions can lead to orphans, data integrity issues, or unexpected behavior. Thinking about the 'related' delete immediately signals a desire to be complete and not introduce any potential problems through an incomplete process. 3. **Potential for Side Effects:** I'm proactively considering the potential *side effects* of this deletion operation. Is it correctly handled and fully tested? A missing check on the dependencies of this deletion could have far-reaching consequences in this context. 4. **Best practice is in place**: This implies that data is related, and that a delete of one set may have implications for another set (and, therefore, the need for this deletion operation). |
| 16/2 | 2026/09/04 08:21 | tool | grepper |
0mArgs:{
"Expression": "br_cfm_mep_delete",
"PathPrefix": "net/bridge"
}Results: {
"Output": "net/bridge/br_cfm.c=564=static void mep_delete_implementation(struct net_bridge *br,\n--\nnet/bridge/br_cfm.c-588-\nnet/bridge/br_cfm.c:589:int br_cfm_mep_delete(struct net_bridge *br,\nnet/bridge/br_cfm.c-590-\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_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"
} |
| 17/2 | 2026/09/04 08:21 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 13611 output: 216 thoughts: 250 Thoughts: **Fuzzing Target Assessment - Bridge Networking Code** Okay, let's break this down. First, I need to confirm the relevant configuration options that are in play here. I see we have `EnableConfigs` set to: BRIDGE, BRIDGE_CFM, and BRIDGE_MRP. Good, that establishes the context – these are critical functionalities within the bridge. Now, let's dig into the key symbols that are directly involved. We have a list of `FocusSymbols`: `br_cfm_frame_rx`, `br_mrp_process`, `br_process_frame_type`, `br_cfm_mep_create`, `br_cfm_mep_delete`, `br_mrp_add`, and `br_mrp_del`. This gives me a concrete list of entry points and functions. Excellent, these are specific functions in the code I want to look at. Now, the crucial question: Is this worthy of fuzzing? Based on my understanding, `WorthFuzzing` should be `true` here, and here's why: This patch directly impacts core networking code within `net/bridge/`, which is a key area of the system. I also see that this refactors how bridge packet reception handles protocol-specific frame types (CFM and MRP). Instead of dynamically iterating through linked lists, it's replacing it with bitflag checks on `options` and direct function calls. This is a significant change in how packets are processed. Furthermore, it alters the activation/deactivation logic (`br_opt_toggle`) during MRP instance creation/deletion and CFM MEP creation/deletion. This makes me suspect there may be a potential for subtle control-flow issues or unexpected behavior that could be exposed by fuzzing. And, to top it off, it's reachable via virtual devices (bridge interfaces) and netlink configuration, meaning a fuzzer can easily hit this from outside. With that confirmation, it looks like it's time to call `set-results`. I have all the parameters I need, and the rationale is solid. Let's move forward. |
| 18/2 | 2026/09/04 08:21 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"BRIDGE",
"BRIDGE_CFM",
"BRIDGE_MRP"
],
"FocusSymbols": [
"br_process_frame_type",
"br_cfm_frame_rx",
"br_mrp_process",
"br_cfm_mep_create",
"br_cfm_mep_delete",
"br_mrp_add",
"br_mrp_del"
],
"Reasoning": "The patch refactors the bridge frame RX processing logic for CFM (Connectivity Fault Management) and MRP (Media Redundancy Protocol) frames. Instead of maintaining a dynamic frame_type_list with RCU traversal, it directly tests bridge option bitmasks and invokes br_cfm_frame_rx and br_mrp_process. It also modifies MEP and MRP add/delete state toggling. This touches reachable core networking code easily configured and fuzzed via netlink and virtual bridge network devices.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"BRIDGE",
"BRIDGE_CFM",
"BRIDGE_MRP"
],
"FocusSymbols": [
"br_process_frame_type",
"br_cfm_frame_rx",
"br_mrp_process",
"br_cfm_mep_create",
"br_cfm_mep_delete",
"br_mrp_add",
"br_mrp_del"
],
"Reasoning": "The patch refactors the bridge frame RX processing logic for CFM (Connectivity Fault Management) and MRP (Media Redundancy Protocol) frames. Instead of maintaining a dynamic frame_type_list with RCU traversal, it directly tests bridge option bitmasks and invokes br_cfm_frame_rx and br_mrp_process. It also modifies MEP and MRP add/delete state toggling. This touches reachable core networking code easily configured and fuzzed via netlink and virtual bridge network devices.",
"WorthFuzzing": true
} |
| 19/1 | 2026/09/04 08:21 | action | If |
0mArgs:{
"WorthFuzzing": true
}Results: null |
| 20/2 | 2026/09/04 08:21 | agent | kmsan-evaluator |
0mModel:core Args: null Results: {
"KMSANReasoning": "The patch refactors Ethernet frame handler dispatching for CFM (Connectivity Fault Management) and MRP (Media Redundancy Protocol) in the bridge driver. It replaces the dynamically allocated/registered `frame_type_list` and `struct br_frame_type` with bridge option flags (`BROPT_CFM_ENABLED`, `BROPT_MRP_ENABLED`) and direct function calls in `br_process_frame_type()`.\n\nThis refactoring does not introduce or modify:\n1. Kernel data structures or info-leaks copied to user space.\n2. Uninitialized variables, struct fields, or padding.\n3. Length calculations or buffer bounds that could expose uninitialized memory.\n\nAll options flags are stored within the zero-initialized `struct net_bridge` and manipulated via bitwise operations (`br_opt_toggle`, `br_opt_get`). Any potential bugs in this change (such as concurrency issues or invalid pointer dereferences) are covered by standard KASAN/LOCKDEP detectors. Thus, a dedicated KMSAN fuzzing session is not warranted.",
"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 583f171d64e2f1efef88a35165ec28e54df17d26
Author: syz-cluster <triage@syzkaller.com>
Date: Fri Sep 4 08:20:43 2026 +0000
syz-cluster: applied patch under review
diff --git a/net/bridge/br_cfm.c b/net/bridge/br_cfm.c
index dea56fffa1c19..9dcc97d63a6fc 100644
--- a/net/bridge/br_cfm.c
+++ b/net/bridge/br_cfm.c
@@ -367,7 +367,7 @@ static u32 ccm_tlv_extract(struct sk_buff *skb, u32 index,
}
/* note: already called with rcu_read_lock */
-static int br_cfm_frame_rx(struct net_bridge_port *port, struct sk_buff *skb)
+int br_cfm_frame_rx(struct net_bridge_port *port, struct sk_buff *skb)
{
u32 mdlevel, interval, size, index, max;
const struct br_cfm_common_hdr *hdr;
@@ -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,
@@ -559,7 +554,7 @@ int br_cfm_mep_create(struct net_bridge *br,
INIT_DELAYED_WORK(&mep->ccm_tx_dwork, ccm_tx_work_expired);
if (hlist_empty(&br->mep_list))
- br_add_frame(br, &cfm_frame_type);
+ br_opt_toggle(br, BROPT_CFM_ENABLED, true);
hlist_add_tail_rcu(&mep->head, &br->mep_list);
@@ -588,7 +583,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_opt_toggle(br, BROPT_CFM_ENABLED, false);
}
int br_cfm_mep_delete(struct net_bridge *br,
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index ff55dab736326..e01c44a90d84b 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -503,7 +503,6 @@ void br_dev_setup(struct net_device *dev)
spin_lock_init(&br->lock);
INIT_LIST_HEAD(&br->port_list);
INIT_HLIST_HEAD(&br->fdb_list);
- INIT_HLIST_HEAD(&br->frame_type_list);
#if IS_ENABLED(CONFIG_BRIDGE_MRP)
INIT_HLIST_HEAD(&br->mrp_list);
#endif
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index d87a5f9fa92b7..8bed72baf1615 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -317,17 +317,25 @@ static int nf_hook_bridge_pre(struct sk_buff *skb, struct sk_buff **pskb)
return RX_HANDLER_CONSUMED;
}
+#define BR_CFM_MRP_OPTS \
+ ((IS_ENABLED(CONFIG_BRIDGE_CFM) ? BIT(BROPT_CFM_ENABLED) : 0UL) | \
+ (IS_ENABLED(CONFIG_BRIDGE_MRP) ? BIT(BROPT_MRP_ENABLED) : 0UL))
+
/* Return 0 if the frame was not processed otherwise 1
* note: already called with rcu_read_lock
*/
static int br_process_frame_type(struct net_bridge_port *p,
struct sk_buff *skb)
{
- struct br_frame_type *tmp;
+ struct net_bridge *br = p->br;
+
+ if (skb->protocol == htons(ETH_P_CFM) &&
+ br_opt_get(br, BROPT_CFM_ENABLED))
+ return br_cfm_frame_rx(p, skb);
- hlist_for_each_entry_rcu(tmp, &p->br->frame_type_list, list)
- if (unlikely(tmp->type == skb->protocol))
- return tmp->frame_handler(p, skb);
+ if (skb->protocol == htons(ETH_P_MRP) &&
+ br_opt_get(br, BROPT_MRP_ENABLED))
+ return br_mrp_process(p, skb);
return 0;
}
@@ -425,7 +433,8 @@ static rx_handler_result_t br_handle_frame(struct sk_buff **pskb)
}
}
- if (unlikely(br_process_frame_type(p, skb)))
+ if (unlikely((READ_ONCE(p->br->options) & BR_CFM_MRP_OPTS) &&
+ br_process_frame_type(p, skb)))
return RX_HANDLER_PASS;
forward:
@@ -467,19 +476,3 @@ 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)
-{
- hlist_add_head_rcu(&ft->list, &br->frame_type_list);
-}
-
-void br_del_frame(struct net_bridge *br, struct br_frame_type *ft)
-{
- struct br_frame_type *tmp;
-
- hlist_for_each_entry(tmp, &br->frame_type_list, list)
- if (ft == tmp) {
- hlist_del_rcu(&ft->list);
- return;
- }
-}
diff --git a/net/bridge/br_mrp.c b/net/bridge/br_mrp.c
index ef16d07039241..dce6efa96c4c6 100644
--- a/net/bridge/br_mrp.c
+++ b/net/bridge/br_mrp.c
@@ -6,13 +6,6 @@
static const u8 mrp_test_dmac[ETH_ALEN] = { 0x1, 0x15, 0x4e, 0x0, 0x0, 0x1 };
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 +479,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_opt_toggle(br, BROPT_MRP_ENABLED, false);
}
/* Adds a new MRP instance.
@@ -536,7 +529,7 @@ int br_mrp_add(struct net_bridge *br, struct br_mrp_instance *instance)
rcu_assign_pointer(mrp->s_port, p);
if (hlist_empty(&br->mrp_list))
- br_add_frame(br, &mrp_frame_type);
+ br_opt_toggle(br, BROPT_MRP_ENABLED, true);
INIT_DELAYED_WORK(&mrp->test_work, br_mrp_test_work_expired);
INIT_DELAYED_WORK(&mrp->in_test_work, br_mrp_in_test_work_expired);
@@ -1241,7 +1234,7 @@ static int br_mrp_rcv(struct net_bridge_port *p,
* normal forwarding.
* note: already called with rcu_read_lock
*/
-static int br_mrp_process(struct net_bridge_port *p, struct sk_buff *skb)
+int br_mrp_process(struct net_bridge_port *p, struct sk_buff *skb)
{
/* If there is no MRP instance do normal forwarding */
if (likely(!test_bit(BR_MRP_AWARE_BIT, &p->flags)))
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index d337b1cfb980d..b01997ea95089 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -495,12 +495,13 @@ enum net_bridge_opts {
BROPT_MST_ENABLED,
BROPT_MDB_OFFLOAD_FAIL_NOTIFICATION,
BROPT_FDB_LOCAL_VLAN_0,
+ BROPT_CFM_ENABLED,
+ BROPT_MRP_ENABLED,
};
struct net_bridge {
spinlock_t lock;
spinlock_t hash_lock;
- struct hlist_head frame_type_list;
struct net_device *dev;
unsigned long options;
/* These fields are accessed on each packet */
@@ -932,16 +933,6 @@ int nbp_backup_change(struct net_bridge_port *p, struct net_device *backup_dev);
int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
rx_handler_func_t *br_get_rx_handler(const struct net_device *dev);
-struct br_frame_type {
- __be16 type;
- int (*frame_handler)(struct net_bridge_port *port,
- struct sk_buff *skb);
- struct hlist_node list;
-};
-
-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);
-
static inline bool br_rx_handler_check_rcu(const struct net_device *dev)
{
return rcu_dereference(dev->rx_handler) == br_get_rx_handler(dev);
@@ -2080,6 +2071,7 @@ int br_mrp_parse(struct net_bridge *br, struct net_bridge_port *p,
bool br_mrp_enabled(struct net_bridge *br);
void br_mrp_port_del(struct net_bridge *br, struct net_bridge_port *p);
int br_mrp_fill_info(struct sk_buff *skb, struct net_bridge *br);
+int br_mrp_process(struct net_bridge_port *p, struct sk_buff *skb);
#else
static inline int br_mrp_parse(struct net_bridge *br, struct net_bridge_port *p,
struct nlattr *attr, int cmd,
@@ -2103,6 +2095,11 @@ static inline int br_mrp_fill_info(struct sk_buff *skb, struct net_bridge *br)
return 0;
}
+static inline int br_mrp_process(struct net_bridge_port *p, struct sk_buff *skb)
+{
+ return 0;
+}
+
#endif
/* br_cfm.c */
@@ -2111,6 +2108,7 @@ int br_cfm_parse(struct net_bridge *br, struct net_bridge_port *p,
struct nlattr *attr, int cmd, struct netlink_ext_ack *extack);
bool br_cfm_created(struct net_bridge *br);
void br_cfm_port_del(struct net_bridge *br, struct net_bridge_port *p);
+int br_cfm_frame_rx(struct net_bridge_port *port, struct sk_buff *skb);
int br_cfm_config_fill_info(struct sk_buff *skb, struct net_bridge *br);
int br_cfm_status_fill_info(struct sk_buff *skb,
struct net_bridge *br,
@@ -2135,6 +2133,12 @@ static inline void br_cfm_port_del(struct net_bridge *br,
{
}
+static inline int br_cfm_frame_rx(struct net_bridge_port *port,
+ struct sk_buff *skb)
+{
+ return 0;
+}
+
static inline int br_cfm_config_fill_info(struct sk_buff *skb, struct net_bridge *br)
{
return -EOPNOTSUPP;
|
| 21/3 | 2026/09/04 08:21 | llm | kmsan-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 5533 output: 28 thoughts: 1042 Thoughts: **Patch Analysis: Bridging CFM and MRP Frame Handling** Okay, let's break this down. My initial assessment is that this patch represents a significant refactoring of how CFM (Connectivity Fault Management) and MRP (Multiple Registration Protocol) frame handling is implemented within the Linux bridging code. I see a shift away from using a dedicated linked list (`frame_type_list`) and associated functions (`br_add_frame`, `br_del_frame`) to a more direct, option-based approach. Specifically, I observe these key changes: * **CFM Frame Handling:** The `br_cfm_frame_rx` function is no longer static. It appears to be made global. The patch replaces the use of `cfm_frame_type` struct, and the functions `br_add_frame` and `br_del_frame` with calls to `br_opt_toggle` with `BROPT_CFM_ENABLED` to enable or disable CFM processing, respectively. * **MRP Frame Handling:** Similarly, `br_mrp_process` is made non-static, `mrp_frame_type` is removed, and the addition/removal of MRP processing is now controlled using `br_opt_toggle` and `BROPT_MRP_ENABLED`. * **Bridging Core Changes:** The `frame_type_list` is removed from `struct net_bridge` and all related handling is deleted. The code now checks directly within `br_process_frame_type` (and subsequently, in `br_handle_frame`) whether CFM or MRP is enabled via `br_opt_get`. It then calls `br_cfm_frame_rx` or `br_mrp_process` directly if the corresponding option bit is set and the packet protocol matches `ETH_P_CFM` or `ETH_P_MRP` respectively. Now, let's critically evaluate the implications, focusing on memory safety. I need to make sure this doesn't introduce any new vulnerabilities. 1. **Kernel Structures to User Space:** No, this patch doesn't seem to modify or introduce any new kernel structures passed to user space. It primarily deals with internal bridging logic. 2. **Uninitialized Variables/Fields:** The code appears to be sound. `p->br->options` in `br_handle_frame` is initialized upon `struct net_bridge` allocation (zero-initialized with `kzalloc`), and `BROPT_CFM_ENABLED` and `BROPT_MRP_ENABLED` are controlled via `br_opt_toggle`, and `skb->protocol` is properly initialized with packet data. No apparent issues there. 3. **Complex Data Structures:** By removing `frame_type_list` and the `struct br_frame_type`, this simplifies the data structures and reduces the potential for uninitialized field reads. A plus. 4. **Bounds Checks/Uninitialized Bytes:** The patch simplifies rather than complicates the data flow here. I see no potential problems related to uninitialized byte access through bounds checks or length calculations. To be extra cautious, I will do a quick code dive to verify how `br_opt_toggle` and `br_opt_get` are implemented and ensure that they function correctly. I'll need to double-check their internal logic, but based on what I see here, the overall design shift seems positive. The code becomes cleaner, more direct, and less reliant on maintaining a separate linked list, which potentially reduces complexity and, therefore, potential sources of errors. |
| 22/3 | 2026/09/04 08:21 | tool | grepper |
0mArgs:{
"Expression": "br_opt_toggle",
"PathPrefix": "net/bridge"
}Results: {
"Output": "net/bridge/br.c=268=br_toggle_fdb_local_vlan_0(struct net_bridge *br, bool on,\n--\nnet/bridge/br.c-279-\nnet/bridge/br.c:280:\tbr_opt_toggle(br, BROPT_FDB_LOCAL_VLAN_0, on);\nnet/bridge/br.c-281-\treturn 0;\n--\nnet/bridge/br.c=294=int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id opt, bool on,\n--\nnet/bridge/br.c-300-\tcase BR_BOOLOPT_NO_LL_LEARN:\nnet/bridge/br.c:301:\t\tbr_opt_toggle(br, BROPT_NO_LL_LEARN, on);\nnet/bridge/br.c-302-\t\tbreak;\n--\nnet/bridge/br.c-309-\tcase BR_BOOLOPT_MDB_OFFLOAD_FAIL_NOTIFICATION:\nnet/bridge/br.c:310:\t\tbr_opt_toggle(br, BROPT_MDB_OFFLOAD_FAIL_NOTIFICATION, on);\nnet/bridge/br.c-311-\t\tbreak;\n--\nnet/bridge/br.c=375=void br_boolopt_multi_get(const struct net_bridge *br,\n--\nnet/bridge/br.c-388-/* private bridge options, controlled by the kernel */\nnet/bridge/br.c:389:void br_opt_toggle(struct net_bridge *br, enum net_bridge_opts opt, bool on)\nnet/bridge/br.c-390-{\n--\nnet/bridge/br_arp_nd_proxy.c=27=void br_recalculate_neigh_suppress_enabled(struct net_bridge *br)\n--\nnet/bridge/br_arp_nd_proxy.c-38-\nnet/bridge/br_arp_nd_proxy.c:39:\tbr_opt_toggle(br, BROPT_NEIGH_SUPPRESS_ENABLED, neigh_suppress);\nnet/bridge/br_arp_nd_proxy.c-40-}\n--\nnet/bridge/br_cfm.c=492=int br_cfm_mep_create(struct net_bridge *br,\n--\nnet/bridge/br_cfm.c-556-\tif (hlist_empty(\u0026br-\u003emep_list))\nnet/bridge/br_cfm.c:557:\t\tbr_opt_toggle(br, BROPT_CFM_ENABLED, true);\nnet/bridge/br_cfm.c-558-\n--\nnet/bridge/br_cfm.c=564=static void mep_delete_implementation(struct net_bridge *br,\n--\nnet/bridge/br_cfm.c-585-\tif (hlist_empty(\u0026br-\u003emep_list))\nnet/bridge/br_cfm.c:586:\t\tbr_opt_toggle(br, BROPT_CFM_ENABLED, false);\nnet/bridge/br_cfm.c-587-}\n--\nnet/bridge/br_device.c=204=static int br_change_mtu(struct net_device *dev, int new_mtu)\n--\nnet/bridge/br_device.c-210-\t/* this flag will be cleared if the MTU was automatically adjusted */\nnet/bridge/br_device.c:211:\tbr_opt_toggle(br, BROPT_MTU_SET_BY_USER, true);\nnet/bridge/br_device.c-212-#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)\n--\nnet/bridge/br_if.c=520=void br_mtu_auto_adjust(struct net_bridge *br)\n--\nnet/bridge/br_if.c-531-\tdev_set_mtu(br-\u003edev, br_mtu_min(br));\nnet/bridge/br_if.c:532:\tbr_opt_toggle(br, BROPT_MTU_SET_BY_USER, false);\nnet/bridge/br_if.c-533-}\n--\nnet/bridge/br_mrp.c=419=static void br_mrp_del_impl(struct net_bridge *br, struct br_mrp *mrp)\n--\nnet/bridge/br_mrp.c-481-\tif (hlist_empty(\u0026br-\u003emrp_list))\nnet/bridge/br_mrp.c:482:\t\tbr_opt_toggle(br, BROPT_MRP_ENABLED, false);\nnet/bridge/br_mrp.c-483-}\n--\nnet/bridge/br_mrp.c=488=int br_mrp_add(struct net_bridge *br, struct br_mrp_instance *instance)\n--\nnet/bridge/br_mrp.c-531-\tif (hlist_empty(\u0026br-\u003emrp_list))\nnet/bridge/br_mrp.c:532:\t\tbr_opt_toggle(br, BROPT_MRP_ENABLED, true);\nnet/bridge/br_mrp.c-533-\n--\nnet/bridge/br_mst.c=203=int br_mst_set_enabled(struct net_bridge *br, bool on,\n--\nnet/bridge/br_mst.c-237-\nnet/bridge/br_mst.c:238:\tbr_opt_toggle(br, BROPT_MST_ENABLED, on);\nnet/bridge/br_mst.c-239-\treturn 0;\n--\nnet/bridge/br_multicast.c=1079=static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge_mcast *brmctx,\n--\nnet/bridge/br_multicast.c-1154-\t\tkfree_skb(skb);\nnet/bridge/br_multicast.c:1155:\t\tbr_opt_toggle(brmctx-\u003ebr, BROPT_HAS_IPV6_ADDR, false);\nnet/bridge/br_multicast.c-1156-\t\treturn NULL;\n--\nnet/bridge/br_multicast.c-1158-\nnet/bridge/br_multicast.c:1159:\tbr_opt_toggle(brmctx-\u003ebr, BROPT_HAS_IPV6_ADDR, true);\nnet/bridge/br_multicast.c-1160-\tipv6_eth_mc_map(\u0026ip6h-\u003edaddr, eth-\u003eh_dest);\n--\nnet/bridge/br_multicast.c=1280=struct net_bridge_mdb_entry *br_multicast_new_group(struct net_bridge *br,\n--\nnet/bridge/br_multicast.c-1292-\t\tbr_mc_disabled_update(br-\u003edev, false, NULL);\nnet/bridge/br_multicast.c:1293:\t\tbr_opt_toggle(br, BROPT_MULTICAST_ENABLED, false);\nnet/bridge/br_multicast.c-1294-\t\treturn ERR_PTR(-E2BIG);\n--\nnet/bridge/br_multicast.c=4217=void br_multicast_init(struct net_bridge *br)\n--\nnet/bridge/br_multicast.c-4222-\nnet/bridge/br_multicast.c:4223:\tbr_opt_toggle(br, BROPT_MULTICAST_ENABLED, true);\nnet/bridge/br_multicast.c:4224:\tbr_opt_toggle(br, BROPT_HAS_IPV6_ADDR, true);\nnet/bridge/br_multicast.c-4225-\n--\nnet/bridge/br_multicast.c=4442=int br_multicast_toggle_vlan_snooping(struct net_bridge *br, bool on,\n--\nnet/bridge/br_multicast.c-4460-\nnet/bridge/br_multicast.c:4461:\tbr_opt_toggle(br, BROPT_MCAST_VLAN_SNOOPING_ENABLED, on);\nnet/bridge/br_multicast.c-4462-\n--\nnet/bridge/br_multicast.c=4741=int br_multicast_toggle(struct net_bridge *br, unsigned long val,\n--\nnet/bridge/br_multicast.c-4756-\nnet/bridge/br_multicast.c:4757:\tbr_opt_toggle(br, BROPT_MULTICAST_ENABLED, !!val);\nnet/bridge/br_multicast.c-4758-\tif (!br_opt_get(br, BROPT_MULTICAST_ENABLED)) {\n--\nnet/bridge/br_netlink.c=1295=static int br_changelink(struct net_device *brdev, struct nlattr *tb[],\n--\nnet/bridge/br_netlink.c-1424-\t\tspin_unlock_bh(\u0026br-\u003elock);\nnet/bridge/br_netlink.c:1425:\t\tbr_opt_toggle(br, BROPT_GROUP_ADDR_SET, true);\nnet/bridge/br_netlink.c-1426-\t\tbr_recalculate_fwd_mask(br);\n--\nnet/bridge/br_netlink.c-1458-\t\tval = nla_get_u8(data[IFLA_BR_MCAST_QUERY_USE_IFADDR]);\nnet/bridge/br_netlink.c:1459:\t\tbr_opt_toggle(br, BROPT_MULTICAST_QUERY_USE_IFADDR, !!val);\nnet/bridge/br_netlink.c-1460-\t}\n--\nnet/bridge/br_netlink.c-1529-\t\tmcast_stats = nla_get_u8(data[IFLA_BR_MCAST_STATS_ENABLED]);\nnet/bridge/br_netlink.c:1530:\t\tbr_opt_toggle(br, BROPT_MULTICAST_STATS_ENABLED, !!mcast_stats);\nnet/bridge/br_netlink.c-1531-\t}\n--\nnet/bridge/br_netlink.c-1558-\nnet/bridge/br_netlink.c:1559:\t\tbr_opt_toggle(br, BROPT_NF_CALL_IPTABLES, !!val);\nnet/bridge/br_netlink.c-1560-\t}\n--\nnet/bridge/br_netlink.c-1564-\nnet/bridge/br_netlink.c:1565:\t\tbr_opt_toggle(br, BROPT_NF_CALL_IP6TABLES, !!val);\nnet/bridge/br_netlink.c-1566-\t}\n--\nnet/bridge/br_netlink.c-1570-\nnet/bridge/br_netlink.c:1571:\t\tbr_opt_toggle(br, BROPT_NF_CALL_ARPTABLES, !!val);\nnet/bridge/br_netlink.c-1572-\t}\n--\nnet/bridge/br_private.h=781=void br_boolopt_multi_get(const struct net_bridge *br,\nnet/bridge/br_private.h-782-\t\t\t struct br_boolopt_multi *bm);\nnet/bridge/br_private.h:783:void br_opt_toggle(struct net_bridge *br, enum net_bridge_opts opt, bool on);\nnet/bridge/br_private.h-784-\n--\nnet/bridge/br_sysfs_br.c=306=static ssize_t group_addr_store(struct device *d,\n--\nnet/bridge/br_sysfs_br.c-333-\nnet/bridge/br_sysfs_br.c:334:\tbr_opt_toggle(br, BROPT_GROUP_ADDR_SET, true);\nnet/bridge/br_sysfs_br.c-335-\tbr_recalculate_fwd_mask(br);\n--\nnet/bridge/br_sysfs_br.c=433=static int set_query_use_ifaddr(struct net_bridge *br, unsigned long val,\n--\nnet/bridge/br_sysfs_br.c-435-{\nnet/bridge/br_sysfs_br.c:436:\tbr_opt_toggle(br, BROPT_MULTICAST_QUERY_USE_IFADDR, !!val);\nnet/bridge/br_sysfs_br.c-437-\treturn 0;\n--\nnet/bridge/br_sysfs_br.c=733=static int set_stats_enabled(struct net_bridge *br, unsigned long val,\n--\nnet/bridge/br_sysfs_br.c-735-{\nnet/bridge/br_sysfs_br.c:736:\tbr_opt_toggle(br, BROPT_MULTICAST_STATS_ENABLED, !!val);\nnet/bridge/br_sysfs_br.c-737-\treturn 0;\n--\nnet/bridge/br_sysfs_br.c=782=static int set_nf_call_iptables(struct net_bridge *br, unsigned long val,\n--\nnet/bridge/br_sysfs_br.c-784-{\nnet/bridge/br_sysfs_br.c:785:\tbr_opt_toggle(br, BROPT_NF_CALL_IPTABLES, !!val);\nnet/bridge/br_sysfs_br.c-786-\treturn 0;\n--\nnet/bridge/br_sysfs_br.c=804=static int set_nf_call_ip6tables(struct net_bridge *br, unsigned long val,\n--\nnet/bridge/br_sysfs_br.c-806-{\nnet/bridge/br_sysfs_br.c:807:\tbr_opt_toggle(br, BROPT_NF_CALL_IP6TABLES, !!val);\nnet/bridge/br_sysfs_br.c-808-\treturn 0;\n--\nnet/bridge/br_sysfs_br.c=826=static int set_nf_call_arptables(struct net_bridge *br, unsigned long val,\n--\nnet/bridge/br_sysfs_br.c-828-{\nnet/bridge/br_sysfs_br.c:829:\tbr_opt_toggle(br, BROPT_NF_CALL_ARPTABLES, !!val);\nnet/bridge/br_sysfs_br.c-830-\treturn 0;\n--\nnet/bridge/br_vlan.c=894=int br_vlan_filter_toggle(struct net_bridge *br, unsigned long val,\n--\nnet/bridge/br_vlan.c-907-\nnet/bridge/br_vlan.c:908:\tbr_opt_toggle(br, BROPT_VLAN_ENABLED, !!val);\nnet/bridge/br_vlan.c-909-\n--\nnet/bridge/br_vlan.c-911-\tif (err \u0026\u0026 err != -EOPNOTSUPP) {\nnet/bridge/br_vlan.c:912:\t\tbr_opt_toggle(br, BROPT_VLAN_ENABLED, !val);\nnet/bridge/br_vlan.c-913-\t\treturn err;\n--\nnet/bridge/br_vlan.c=1027=int br_vlan_set_stats(struct net_bridge *br, unsigned long val)\n--\nnet/bridge/br_vlan.c-1031-\tcase 1:\nnet/bridge/br_vlan.c:1032:\t\tbr_opt_toggle(br, BROPT_VLAN_STATS_ENABLED, !!val);\nnet/bridge/br_vlan.c-1033-\t\tbreak;\n--\nnet/bridge/br_vlan.c=1041=int br_vlan_set_stats_per_port(struct net_bridge *br, unsigned long val)\n--\nnet/bridge/br_vlan.c-1055-\tcase 1:\nnet/bridge/br_vlan.c:1056:\t\tbr_opt_toggle(br, BROPT_VLAN_STATS_PER_PORT, !!val);\nnet/bridge/br_vlan.c-1057-\t\tbreak;\n--\nnet/bridge/br_vlan.c=1676=static void br_vlan_toggle_bridge_binding(struct net_device *br_dev,\n--\nnet/bridge/br_vlan.c-1681-\tif (enable)\nnet/bridge/br_vlan.c:1682:\t\tbr_opt_toggle(br, BROPT_VLAN_BRIDGE_BINDING, true);\nnet/bridge/br_vlan.c-1683-\telse\nnet/bridge/br_vlan.c:1684:\t\tbr_opt_toggle(br, BROPT_VLAN_BRIDGE_BINDING,\nnet/bridge/br_vlan.c-1685-\t\t\t br_vlan_has_upper_bind_vlan_dev(br_dev));\n"
} |
| 23/3 | 2026/09/04 08:21 | llm | kmsan-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 11659 output: 248 thoughts: 429 Thoughts: **My Assessment of the Bridge Frame Handling Patch** Okay, let's break this down. From what I see, this patch is a refactoring of how CFM (Connectivity Fault Management) and MRP (Multiple Registration Protocol) frame handling is implemented within the bridge code. Essentially, the code has been streamlined, and I believe this is a sensible move. First, the patch is removing the dynamic registration approach using a linked list (`frame_type_list`) with RCU (Read-Copy Update) iteration. That's good; RCU can add some overhead, and this change replaces it with direct checks within `br_process_frame_type` gated by the `BROPT_CFM_ENABLED` and `BROPT_MRP_ENABLED` options stored in the `br->options` field. This seems much cleaner and should be more performant than iterating a linked list, especially under load. So, the linked list and associated functions are gone: `struct br_frame_type`, `frame_type_list`, `br_add_frame`, and `br_del_frame` are all removed. Good riddance; less complexity is always a win if it doesn't sacrifice flexibility. Looking at `br_handle_frame`, I see the critical change. Now, instead of that list iteration, the code directly checks the `BR_CFM_MRP_OPTS` bitmask against `p->br->options`. If the relevant options are enabled, `br_process_frame_type` is called. This direct check is going to be significantly faster, especially as the number of supported frame types grows. The `unlikely()` macro is a good optimization here; these are potentially less common paths, so it's a good performance hint to the compiler. Finally, the patch exposes `br_cfm_frame_rx` and `br_mrp_process` for direct invocation. This allows more direct use in the system without relying on the frame handling path. Now, from a memory safety perspective, let's consider the KMSAN (Kernel Memory Sanitizer) implications. I've taken a look at all the changes, and I'm confident that we don't need KMSAN to flag potential memory issues in this patch. There are no new memory allocations introduced. No exposed uninitialized struct fields, padding, or buffers copied to userspace. No branches that rely on uninitialized data because the `br->options` field is guaranteed to be zeroed upon allocation of the `net_bridge` struct. The existing locking and concurrency concerns and the RCU usage were already being addressed by KASAN/LOCKDEP, and they remain the same. There's nothing in this patch that introduces any new risks that aren't already covered by existing safety checks. No reading of uninitialized memory. Therefore, I'm going to set `NeedsKMSAN` to `false`. I can state with confidence that this change doesn't introduce any new memory-safety vulnerabilities. |
| 24/3 | 2026/09/04 08:21 | tool | set-results |
0mArgs:{
"KMSANReasoning": "The patch refactors Ethernet frame handler dispatching for CFM (Connectivity Fault Management) and MRP (Media Redundancy Protocol) in the bridge driver. It replaces the dynamically allocated/registered `frame_type_list` and `struct br_frame_type` with bridge option flags (`BROPT_CFM_ENABLED`, `BROPT_MRP_ENABLED`) and direct function calls in `br_process_frame_type()`.\n\nThis refactoring does not introduce or modify:\n1. Kernel data structures or info-leaks copied to user space.\n2. Uninitialized variables, struct fields, or padding.\n3. Length calculations or buffer bounds that could expose uninitialized memory.\n\nAll options flags are stored within the zero-initialized `struct net_bridge` and manipulated via bitwise operations (`br_opt_toggle`, `br_opt_get`). Any potential bugs in this change (such as concurrency issues or invalid pointer dereferences) are covered by standard KASAN/LOCKDEP detectors. Thus, a dedicated KMSAN fuzzing session is not warranted.",
"NeedsKMSAN": false
}Results: {
"KMSANReasoning": "The patch refactors Ethernet frame handler dispatching for CFM (Connectivity Fault Management) and MRP (Media Redundancy Protocol) in the bridge driver. It replaces the dynamically allocated/registered `frame_type_list` and `struct br_frame_type` with bridge option flags (`BROPT_CFM_ENABLED`, `BROPT_MRP_ENABLED`) and direct function calls in `br_process_frame_type()`.\n\nThis refactoring does not introduce or modify:\n1. Kernel data structures or info-leaks copied to user space.\n2. Uninitialized variables, struct fields, or padding.\n3. Length calculations or buffer bounds that could expose uninitialized memory.\n\nAll options flags are stored within the zero-initialized `struct net_bridge` and manipulated via bitwise operations (`br_opt_toggle`, `br_opt_get`). Any potential bugs in this change (such as concurrency issues or invalid pointer dereferences) are covered by standard KASAN/LOCKDEP detectors. Thus, a dedicated KMSAN fuzzing session is not warranted.",
"NeedsKMSAN": false
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|