AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/09/24 17:03 flow patch-triage
34m Args:
null

Results:
{
  "EnableConfigs": [
    "FTRACE",
    "ENABLE_DEFAULT_TRACERS",
    "NET_DROP_MONITOR"
  ],
  "FocusSymbols": [
    "show_print_fmt",
    "show_sym_list",
    "trace_print_sym_seq",
    "trace_sym_lookup",
    "trace_sym_show",
    "drop_reason_lookup",
    "drop_reason_show",
    "net_dm_packet_report_fill"
  ],
  "KMSANReasoning": "The patch refactors ftrace symbol resolution and printing (__print_sym) for tracepoints, notably skb drop reasons and timer tick dependencies. It introduces compile-time generated symbol definition tables (struct trace_sym_def and struct trace_sym_entry), adds lookup/show helpers (drop_reason_lookup, drop_reason_show, trace_print_sym_seq), and replaces inline symbolic strings in print_fmt with a parser (show_print_fmt) that generates them on demand for userspace seq_file reads.\n\nKMSAN is not needed here because:\n1. No uninitialized memory is allocated or read: all newly introduced symbol structures are static and initialized at compile time via macros, and all lookup functions operate on integers passed by value and return pointers to static constant string literals.\n2. The netlink attribute formatting in net_dm_packet_report_fill passes static string literals to nla_put_string, without copying uninitialized struct padding or fields to userspace.\n3. Any potential bugs in this patch involve pointer arithmetic and string traversal (e.g. parsing call-\u003eprint_fmt in show_print_fmt or iterating sym_defs array), out-of-bounds reads, or RCU locking semantics (e.g. drop_reasons_by_subsys dereferencing). These classes of bugs are thoroughly covered by standard KASAN and LOCKDEP / PROVE_RCU detectors.\n\nHence, a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false,
  "Reasoning": "The patch introduces a new dynamic symbol lookup and formatting subsystem (__print_sym, TRACE_DEFINE_SYM_FNS, TRACE_DEFINE_SYM_LIST) in ftrace, replacing static symbol mapping for events such as kfree_skb and timer tick_stop. It introduces custom print format parsing in show_print_fmt and show_sym_list when userspace reads event format files from tracefs, dynamic symbol sequence formatting in trace_print_sym_seq, module section handling for ftrace symbols, and skb drop reason resolution helpers in net/core/skbuff.c used by drop_monitor netlink reporting. These changes alter reachable executable logic in core tracing and networking subsystems, warranting fuzzing.",
  "WorthFuzzing": true
}

1/1 2026/09/24 17:03 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit 17080a6ac7f5b2b473c2114f50bbff927278e9a6\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Thu Sep 24 17:03:19 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h\nindex b2988aa12f664..632eafd0f496a 100644\n--- a/include/asm-generic/vmlinux.lds.h\n+++ b/include/asm-generic/vmlinux.lds.h\n@@ -275,9 +275,12 @@\n #define FTRACE_EVENTS()\t\t\t\t\t\t\t\\\n \t. = ALIGN(8);\t\t\t\t\t\t\t\\\n \tBOUNDED_SECTION(_ftrace_events)\t\t\t\t\t\\\n+\t. = ALIGN(8);\t\t\t\t\t\t\t\\\n \tBOUNDED_SECTION_BY(_ftrace_eval_map, _ftrace_eval_maps)\n+#define FTRACE_SYM_DEFS()\tBOUNDED_SECTION(_ftrace_sym_defs)\n #else\n #define FTRACE_EVENTS()\n+#define FTRACE_SYM_DEFS()\n #endif\n \n #ifdef CONFIG_TRACING\n@@ -391,6 +394,7 @@\n \tTRACE_PRINTKS()\t\t\t\t\t\t\t\\\n \tBPF_RAW_TP()\t\t\t\t\t\t\t\\\n \tTRACEPOINT_STR()\t\t\t\t\t\t\\\n+\tFTRACE_SYM_DEFS()\t\t\t\t\t\t\\\n \tKUNIT_TABLE()\n \n /*\ndiff --git a/include/linux/module.h b/include/linux/module.h\nindex 96cc98568eea5..a02833ac421bd 100644\n--- a/include/linux/module.h\n+++ b/include/linux/module.h\n@@ -516,6 +516,8 @@ struct module {\n \tunsigned int num_trace_events;\n \tstruct trace_eval_map **trace_evals;\n \tunsigned int num_trace_evals;\n+\tstruct trace_sym_def **trace_sym_defs;\n+\tunsigned int num_trace_sym_defs;\n #endif\n #ifdef CONFIG_DYNAMIC_FTRACE\n \tunsigned int num_ftrace_callsites;\ndiff --git a/include/linux/trace_events.h b/include/linux/trace_events.h\nindex 5cbd09c8be8d5..80c34ef89feb1 100644\n--- a/include/linux/trace_events.h\n+++ b/include/linux/trace_events.h\n@@ -29,6 +29,13 @@ const char *trace_print_symbols_seq(struct trace_seq *p, unsigned long val,\n \t\t\t\t    const struct trace_print_flags *symbol_array,\n \t\t\t\t    size_t symbol_array_size);\n \n+const char *trace_print_sym_seq(struct trace_seq *p, unsigned long long val,\n+\t\t\t\tconst char *(*lookup)(unsigned long long val));\n+const char *trace_sym_lookup(const struct trace_sym_entry *list,\n+\t\t\t     size_t len, unsigned long long value);\n+void trace_sym_show(struct seq_file *m,\n+\t\t    const struct trace_sym_entry *list, size_t len);\n+\n #if BITS_PER_LONG == 32\n const char *trace_print_flags_seq_u64(struct trace_seq *p, const char *delim,\n \t\t      unsigned long long flags,\ndiff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h\nindex e0d838c9ce938..05c45a72756c3 100644\n--- a/include/linux/tracepoint.h\n+++ b/include/linux/tracepoint.h\n@@ -32,6 +32,24 @@ struct trace_eval_map {\n \tunsigned long\t\teval_value;\n };\n \n+struct trace_sym_def {\n+\tconst char\t\t*system;\n+\tconst char\t\t*symbol_id;\n+\t/* may return NULL, called under rcu_read_lock() */\n+\tconst char *\t\t(*lookup)(unsigned long long);\n+\t/*\n+\t * Must print the list: ', { val, \"name\"}, ...'\n+\t * with no trailing comma, but with the leading ', '\n+\t * to simplify things:\n+\t */\n+\tvoid \t\t\t(*show)(struct seq_file *);\n+};\n+\n+struct trace_sym_entry {\n+\tunsigned long long\tvalue;\n+\tconst char\t\t*name;\n+};\n+\n #define TRACEPOINT_DEFAULT_PRIO\t10\n \n extern int\n@@ -163,6 +181,8 @@ extern void syscall_unregfunc(void);\n \n #define TRACE_DEFINE_ENUM(x)\n #define TRACE_DEFINE_SIZEOF(x)\n+#define TRACE_DEFINE_SYM_FNS(...)\n+#define TRACE_DEFINE_SYM_LIST(...)\n \n #ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS\n static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)\ndiff --git a/include/net/dropreason.h b/include/net/dropreason.h\nindex 1df60645fb278..537428c726424 100644\n--- a/include/net/dropreason.h\n+++ b/include/net/dropreason.h\n@@ -38,9 +38,11 @@ struct drop_reason_list {\n \tsize_t n_reasons;\n };\n \n-/* Note: due to dynamic registrations, access must be under RCU */\n-extern const struct drop_reason_list __rcu *\n-drop_reasons_by_subsys[SKB_DROP_REASON_SUBSYS_NUM];\n+const char *drop_reason_lookup(unsigned long long value);\n+\n+#ifdef CONFIG_TRACEPOINTS\n+void drop_reason_show(struct seq_file *m);\n+#endif\n \n void drop_reasons_register_subsys(enum skb_drop_reason_subsys subsys,\n \t\t\t\t  const struct drop_reason_list *list);\ndiff --git a/include/trace/events/skb.h b/include/trace/events/skb.h\nindex 2945aa7fe9a7d..991bf172a6ea1 100644\n--- a/include/trace/events/skb.h\n+++ b/include/trace/events/skb.h\n@@ -8,15 +8,9 @@\n #include \u003clinux/skbuff.h\u003e\n #include \u003clinux/netdevice.h\u003e\n #include \u003clinux/tracepoint.h\u003e\n+#include \u003cnet/dropreason.h\u003e\n \n-#undef FN\n-#define FN(reason)\tTRACE_DEFINE_ENUM(SKB_DROP_REASON_##reason);\n-DEFINE_DROP_REASON(FN, FN)\n-\n-#undef FN\n-#undef FNe\n-#define FN(reason)\t{ SKB_DROP_REASON_##reason, #reason },\n-#define FNe(reason)\t{ SKB_DROP_REASON_##reason, #reason }\n+TRACE_DEFINE_SYM_FNS(drop_reason, drop_reason_lookup, drop_reason_show);\n \n /*\n  * Tracepoint for free an sk_buff:\n@@ -47,8 +41,7 @@ TRACE_EVENT(kfree_skb,\n \tTP_printk(\"skbaddr=%p rx_sk=%p protocol=%u location=%pS reason: %s\",\n \t\t  __entry-\u003eskbaddr, __entry-\u003erx_sk, __entry-\u003eprotocol,\n \t\t  __entry-\u003elocation,\n-\t\t  __print_symbolic(__entry-\u003ereason,\n-\t\t\t\t   DEFINE_DROP_REASON(FN, FNe)))\n+\t\t  __print_sym(__entry-\u003ereason, drop_reason))\n );\n \n #undef FN\ndiff --git a/include/trace/events/timer.h b/include/trace/events/timer.h\nindex 3aa0608c63611..d45259d960695 100644\n--- a/include/trace/events/timer.h\n+++ b/include/trace/events/timer.h\n@@ -441,26 +441,18 @@ TRACE_EVENT(itimer_expire,\n #undef tick_dep_mask_name\n #undef tick_dep_name_end\n \n-/* The MASK will convert to their bits and they need to be processed too */\n-#define tick_dep_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \\\n-\tTRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);\n-#define tick_dep_name_end(sdep)  TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \\\n-\tTRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);\n-/* NONE only has a mask defined for it */\n-#define tick_dep_mask_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);\n+#define tick_dep_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },\n+#define tick_dep_mask_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },\n+#define tick_dep_name_end(sdep) { TICK_DEP_MASK_##sdep, #sdep }\n \n-TICK_DEP_NAMES\n+TRACE_DEFINE_SYM_LIST(tick_dep_names, TICK_DEP_NAMES);\n \n #undef tick_dep_name\n #undef tick_dep_mask_name\n #undef tick_dep_name_end\n \n-#define tick_dep_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },\n-#define tick_dep_mask_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },\n-#define tick_dep_name_end(sdep) { TICK_DEP_MASK_##sdep, #sdep }\n-\n #define show_tick_dep_name(val)\t\t\t\t\\\n-\t__print_symbolic(val, TICK_DEP_NAMES)\n+\t__print_sym(val, tick_dep_names)\n \n TRACE_EVENT(tick_stop,\n \ndiff --git a/include/trace/stages/init.h b/include/trace/stages/init.h\nindex 000bcfc8dd2e7..6285a03a52b2d 100644\n--- a/include/trace/stages/init.h\n+++ b/include/trace/stages/init.h\n@@ -23,6 +23,61 @@ TRACE_MAKE_SYSTEM_STR();\n \t__section(\"_ftrace_eval_map\")\t\t\t\\\n \t*TRACE_SYSTEM##_##a = \u0026__##TRACE_SYSTEM##_##a\n \n+/*\n+ * Define a symbol for __print_sym by giving lookup and\n+ * show functions. See \u0026struct trace_sym_def.\n+ */\n+#undef TRACE_DEFINE_SYM_FNS\n+#define TRACE_DEFINE_SYM_FNS(_symbol_id, _lookup, _show)\t\t\\\n+\t_TRACE_DEFINE_SYM_FNS(TRACE_SYSTEM, _symbol_id, _lookup, _show)\n+#define _TRACE_DEFINE_SYM_FNS(_system, _symbol_id, _lookup, _show)\t\\\n+\t__TRACE_DEFINE_SYM_FNS(_system, _symbol_id, _lookup, _show)\n+#define __TRACE_DEFINE_SYM_FNS(_system, _symbol_id, _lookup, _show)\t\\\n+\t___TRACE_DEFINE_SYM_FNS(_system ## _ ## _symbol_id, _symbol_id,\t\\\n+\t\t\t\t_lookup, _show)\n+#define ___TRACE_DEFINE_SYM_FNS(_name, _symbol_id, _lookup, _show)\t\\\n+\tstatic struct trace_sym_def\t\t\t\t\t\\\n+\t__trace_sym_def_ ## _name = {\t\t\t\t\t\\\n+\t\t.system = TRACE_SYSTEM_STRING,\t\t\t\t\\\n+\t\t.symbol_id = #_symbol_id,\t\t\t\t\\\n+\t\t.lookup = _lookup,\t\t\t\t\t\\\n+\t\t.show = _show,\t\t\t\t\t\t\\\n+\t};\t\t\t\t\t\t\t\t\\\n+\tstatic struct trace_sym_def __used\t\t\t\t\\\n+\t__section(\"_ftrace_sym_defs\")\t\t\t\t\t\\\n+\t*__trace_sym_def_p_ ## _name = \u0026__trace_sym_def_ ## _name\n+\n+/*\n+ * Define a symbol for __print_sym by giving lookup and\n+ * show functions. See \u0026struct trace_sym_def.\n+ */\n+#undef TRACE_DEFINE_SYM_LIST\n+#define TRACE_DEFINE_SYM_LIST(_symbol_id, ...)\t\t\t\t\\\n+\t_TRACE_DEFINE_SYM_LIST(TRACE_SYSTEM, _symbol_id, __VA_ARGS__)\n+#define _TRACE_DEFINE_SYM_LIST(_system, _symbol_id, ...)\t\t\\\n+\t__TRACE_DEFINE_SYM_LIST(_system, _symbol_id, __VA_ARGS__)\n+#define __TRACE_DEFINE_SYM_LIST(_system, _symbol_id, ...)\t\t\\\n+\t___TRACE_DEFINE_SYM_LIST(_system ## _ ## _symbol_id, _symbol_id,\\\n+\t\t\t\t __VA_ARGS__)\n+#define ___TRACE_DEFINE_SYM_LIST(_name, _symbol_id, ...)\t\t\\\n+\tstatic struct trace_sym_entry\t\t\t\t\t\\\n+\t__trace_sym_list_ ## _name[] = { __VA_ARGS__ };\t\t\t\\\n+\tstatic const char *\t\t\t\t\t\t\\\n+\t__trace_sym_lookup_ ## _name(unsigned long long value)\t\t\\\n+\t{\t\t\t\t\t\t\t\t\\\n+\t\treturn trace_sym_lookup(__trace_sym_list_ ## _name,\t\\\n+\t\t\tARRAY_SIZE(__trace_sym_list_ ## _name), value);\t\\\n+\t}\t\t\t\t\t\t\t\t\\\n+\tstatic void\t\t\t\t\t\t\t\\\n+\t__trace_sym_show_ ## _name(struct seq_file *m)\t\t\t\\\n+\t{\t\t\t\t\t\t\t\t\\\n+\t\ttrace_sym_show(m, __trace_sym_list_ ## _name,\t\t\\\n+\t\t\t       ARRAY_SIZE(__trace_sym_list_ ## _name));\t\\\n+\t}\t\t\t\t\t\t\t\t\\\n+\t___TRACE_DEFINE_SYM_FNS(_name, _symbol_id,\t\t\t\\\n+\t\t\t\t__trace_sym_lookup_ ## _name,\t\t\\\n+\t\t\t\t__trace_sym_show_ ## _name)\n+\n #undef TRACE_DEFINE_SIZEOF\n #define TRACE_DEFINE_SIZEOF(a)\t\t\t\t\\\n \tstatic struct trace_eval_map __used __initdata\t\\\ndiff --git a/include/trace/stages/stage2_data_offsets.h b/include/trace/stages/stage2_data_offsets.h\nindex 8b0cff06d3463..5afd9de7deb3b 100644\n--- a/include/trace/stages/stage2_data_offsets.h\n+++ b/include/trace/stages/stage2_data_offsets.h\n@@ -5,6 +5,12 @@\n #undef TRACE_DEFINE_ENUM\n #define TRACE_DEFINE_ENUM(a)\n \n+#undef TRACE_DEFINE_SYM_FNS\n+#define TRACE_DEFINE_SYM_FNS(_symbol_id, _lookup, _show)\n+\n+#undef TRACE_DEFINE_SYM_LIST\n+#define TRACE_DEFINE_SYM_LIST(_symbol_id, ...)\n+\n #undef TRACE_DEFINE_SIZEOF\n #define TRACE_DEFINE_SIZEOF(a)\n \ndiff --git a/include/trace/stages/stage3_trace_output.h b/include/trace/stages/stage3_trace_output.h\nindex 181b813357812..09304259a8c1d 100644\n--- a/include/trace/stages/stage3_trace_output.h\n+++ b/include/trace/stages/stage3_trace_output.h\n@@ -79,6 +79,15 @@\n \t\ttrace_print_symbols_seq(p, value, symbols, ARRAY_SIZE(symbols));\t\\\n \t})\n \n+#undef __print_sym\n+#define __print_sym(value, symbol_id)\t\t\t\t\t\\\n+\t___print_sym(TRACE_SYSTEM, value, symbol_id)\n+#define ___print_sym(sys, value, symbol_id)\t\t\t\t\\\n+\t____print_sym(sys, value, symbol_id)\n+#define ____print_sym(sys, value, symbol_id)\t\t\t\t\\\n+\ttrace_print_sym_seq(p, value,\t\t\t\t\t\\\n+\t\t__trace_sym_def_p_ ## sys ## _ ## symbol_id-\u003elookup)\n+\n #undef __print_flags_u64\n #undef __print_symbolic_u64\n #if BITS_PER_LONG == 32\ndiff --git a/include/trace/stages/stage7_class_define.h b/include/trace/stages/stage7_class_define.h\nindex 47008897a7956..936b9fa08ceaf 100644\n--- a/include/trace/stages/stage7_class_define.h\n+++ b/include/trace/stages/stage7_class_define.h\n@@ -45,6 +45,9 @@\n #define __event_in_softirq()\t(REC-\u003ecommon_flags \u0026 0x10)\n #define __event_in_irq()\t(REC-\u003ecommon_flags \u0026 0x18)\n \n+#undef __print_sym\n+#define __print_sym(value, symbol_id)\t__print_sym(value:symbol_id)\n+\n /*\n  * The below is not executed in the kernel. It is only what is\n  * displayed in the print format for userspace to parse.\ndiff --git a/kernel/module/main.c b/kernel/module/main.c\nindex d0e1e0bd2ad06..8ab386a373768 100644\n--- a/kernel/module/main.c\n+++ b/kernel/module/main.c\n@@ -2735,6 +2735,9 @@ static int find_module_sections(struct module *mod, struct load_info *info)\n \tmod-\u003etrace_evals = section_objs(info, \"_ftrace_eval_map\",\n \t\t\t\t\tsizeof(*mod-\u003etrace_evals),\n \t\t\t\t\t\u0026mod-\u003enum_trace_evals);\n+\tmod-\u003etrace_sym_defs = section_objs(info, \"_ftrace_sym_defs\",\n+\t\t\t\t\t   sizeof(*mod-\u003etrace_sym_defs),\n+\t\t\t\t\t   \u0026mod-\u003enum_trace_sym_defs);\n #endif\n #ifdef CONFIG_TRACING\n \tmod-\u003etrace_bprintk_fmt_start = section_objs(info, \"__trace_printk_fmt\",\ndiff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c\nindex 30c0ddf90887f..53849baae2916 100644\n--- a/kernel/trace/trace_events.c\n+++ b/kernel/trace/trace_events.c\n@@ -2111,6 +2111,102 @@ static void *f_next(struct seq_file *m, void *v, loff_t *pos)\n \t\treturn node;\n }\n \n+extern struct trace_sym_def *__start_ftrace_sym_defs[];\n+extern struct trace_sym_def *__stop_ftrace_sym_defs[];\n+\n+/* note: @name is not NUL-terminated */\n+static void show_sym_list(struct seq_file *m, struct trace_event_call *call,\n+\t\t\t  const char *name, unsigned int name_len)\n+{\n+\tstruct trace_sym_def **sym_defs;\n+\tunsigned int n_sym_defs, i;\n+\n+\tif ((call-\u003eflags \u0026 TRACE_EVENT_FL_DYNAMIC) || !call-\u003emodule) {\n+\t\tsym_defs = __start_ftrace_sym_defs;\n+\t\tn_sym_defs = __stop_ftrace_sym_defs - __start_ftrace_sym_defs;\n+\t} else {\n+#ifdef CONFIG_MODULES\n+\t\tstruct module *mod = call-\u003emodule;\n+\n+\t\tsym_defs = mod-\u003etrace_sym_defs;\n+\t\tn_sym_defs = mod-\u003enum_trace_sym_defs;\n+#else\n+\t\treturn;\n+#endif /* CONFIG_MODULES */\n+\t}\n+\n+\tfor (i = 0; i \u003c n_sym_defs; i++) {\n+\t\tunsigned int sym_len;\n+\n+\t\tif (!sym_defs[i])\n+\t\t\tcontinue;\n+\t\tif (sym_defs[i]-\u003esystem != call-\u003eclass-\u003esystem)\n+\t\t\tcontinue;\n+\t\tsym_len = strlen(sym_defs[i]-\u003esymbol_id);\n+\t\tif (name_len != sym_len)\n+\t\t\tcontinue;\n+\t\tif (strncmp(sym_defs[i]-\u003esymbol_id, name, sym_len))\n+\t\t\tcontinue;\n+\t\tif (sym_defs[i]-\u003eshow)\n+\t\t\tsym_defs[i]-\u003eshow(m);\n+\t\tbreak;\n+\t}\n+}\n+\n+static void show_print_fmt(struct seq_file *m, struct trace_event_call *call)\n+{\n+\tchar *ptr = call-\u003eprint_fmt;\n+\tbool in_print_sym = false;\n+\tint quote = 0;\n+\n+\tseq_puts(m, \"\\nprint fmt: \");\n+\twhile (*ptr) {\n+\t\tif (*ptr == '\\\\') {\n+\t\t\tseq_putc(m, *ptr);\n+\t\t\tptr++;\n+\t\t\t/* paranoid */\n+\t\t\tif (!*ptr)\n+\t\t\t\tbreak;\n+\t\t\tgoto next;\n+\t\t}\n+\t\tif (*ptr == '\"') {\n+\t\t\tquote ^= 1;\n+\t\t\tgoto next;\n+\t\t}\n+\t\tif (quote)\n+\t\t\tgoto next;\n+\n+\t\tif (in_print_sym \u0026\u0026 *ptr != ':')\n+\t\t\tgoto next;\n+\n+\t\tif (in_print_sym \u0026\u0026 *ptr == ':') {\n+\t\t\tconst char *name;\n+\n+\t\t\tptr++;\n+\t\t\tname = ptr;\n+\t\t\t/* skip the name */\n+\t\t\twhile (*ptr \u0026\u0026 *ptr != ')')\n+\t\t\t\tptr++;\n+\t\t\t/* and show the actual list inline now */\n+\t\t\tshow_sym_list(m, call, name, ptr - name);\n+\t\t\tin_print_sym = false;\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\tif (strncmp(ptr, \"__print_sym(\", 12) == 0) {\n+\t\t\tptr += 12;\n+\t\t\tseq_puts(m, \"__print_symbolic(\");\n+\t\t\tin_print_sym = true;\n+\t\t\tcontinue;\n+\t\t}\n+next:\n+\t\tseq_putc(m, *ptr);\n+\t\tptr++;\n+\t}\n+\n+\tseq_putc(m, '\\n');\n+}\n+\n static int f_show(struct seq_file *m, void *v)\n {\n \tstruct trace_event_file *file = event_file_data(m-\u003eprivate);\n@@ -2130,8 +2226,7 @@ static int f_show(struct seq_file *m, void *v)\n \t\treturn 0;\n \n \tcase FORMAT_PRINTFMT:\n-\t\tseq_printf(m, \"\\nprint fmt: %s\\n\",\n-\t\t\t   call-\u003eprint_fmt);\n+\t\tshow_print_fmt(m, call);\n \t\treturn 0;\n \t}\n \ndiff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c\nindex a5ad76175d10d..0850b3ad57075 100644\n--- a/kernel/trace/trace_output.c\n+++ b/kernel/trace/trace_output.c\n@@ -131,6 +131,51 @@ trace_print_symbols_seq(struct trace_seq *p, unsigned long val,\n }\n EXPORT_SYMBOL(trace_print_symbols_seq);\n \n+const char *trace_sym_lookup(const struct trace_sym_entry *list,\n+\t\t\t     size_t len, unsigned long long value)\n+{\n+\tsize_t i;\n+\n+\tfor (i = 0; i \u003c len; i++) {\n+\t\tif (list[i].value == value)\n+\t\t\treturn list[i].name;\n+\t}\n+\treturn NULL;\n+}\n+EXPORT_SYMBOL(trace_sym_lookup);\n+\n+void trace_sym_show(struct seq_file *m,\n+\t\t    const struct trace_sym_entry *list, size_t len)\n+{\n+\tsize_t i;\n+\n+\tfor (i = 0; i \u003c len; i++)\n+\t\tseq_printf(m, \", { %lld, \\\"%s\\\" }\",\n+\t\t\t   list[i].value, list[i].name);\n+}\n+EXPORT_SYMBOL(trace_sym_show);\n+\n+const char *\n+trace_print_sym_seq(struct trace_seq *p, unsigned long long val,\n+\t\t    const char *(*lookup)(unsigned long long val))\n+{\n+\tconst char *ret = trace_seq_buffer_ptr(p);\n+\tconst char *name;\n+\n+\trcu_read_lock();\n+\tname = lookup(val);\n+\tif (name)\n+\t\ttrace_seq_puts(p, name);\n+\telse\n+\t\ttrace_seq_printf(p, \"0x%llx\", val);\n+\trcu_read_unlock();\n+\n+\ttrace_seq_putc(p, 0);\n+\n+\treturn ret;\n+}\n+EXPORT_SYMBOL(trace_print_sym_seq);\n+\n #if BITS_PER_LONG == 32\n const char *\n trace_print_flags_seq_u64(struct trace_seq *p, const char *delim,\ndiff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c\nindex edc660778408e..5aa7692c5df27 100644\n--- a/net/core/drop_monitor.c\n+++ b/net/core/drop_monitor.c\n@@ -611,9 +611,8 @@ static int net_dm_packet_report_fill(struct sk_buff *msg, struct sk_buff *skb,\n \t\t\t\t     size_t payload_len)\n {\n \tstruct net_dm_skb_cb *cb = NET_DM_SKB_CB(skb);\n-\tconst struct drop_reason_list *list = NULL;\n-\tunsigned int subsys, subsys_reason;\n \tchar buf[NET_DM_MAX_SYMBOL_LEN];\n+\tconst char *reason_str;\n \tstruct nlattr *attr;\n \tvoid *hdr;\n \tint rc;\n@@ -631,19 +630,10 @@ static int net_dm_packet_report_fill(struct sk_buff *msg, struct sk_buff *skb,\n \t\tgoto nla_put_failure;\n \n \trcu_read_lock();\n-\tsubsys = u32_get_bits(cb-\u003ereason, SKB_DROP_REASON_SUBSYS_MASK);\n-\tif (subsys \u003c SKB_DROP_REASON_SUBSYS_NUM)\n-\t\tlist = rcu_dereference(drop_reasons_by_subsys[subsys]);\n-\tsubsys_reason = cb-\u003ereason \u0026 ~SKB_DROP_REASON_SUBSYS_MASK;\n-\tif (!list ||\n-\t    subsys_reason \u003e= list-\u003en_reasons ||\n-\t    !list-\u003ereasons[subsys_reason] ||\n-\t    strlen(list-\u003ereasons[subsys_reason]) \u003e NET_DM_MAX_REASON_LEN) {\n-\t\tlist = rcu_dereference(drop_reasons_by_subsys[SKB_DROP_REASON_SUBSYS_CORE]);\n-\t\tsubsys_reason = SKB_DROP_REASON_NOT_SPECIFIED;\n-\t}\n-\tif (nla_put_string(msg, NET_DM_ATTR_REASON,\n-\t\t\t   list-\u003ereasons[subsys_reason])) {\n+\treason_str = drop_reason_lookup(cb-\u003ereason);\n+\tif (unlikely(!reason_str))\n+\t\treason_str = drop_reason_lookup(SKB_DROP_REASON_NOT_SPECIFIED);\n+\tif (nla_put_string(msg, NET_DM_ATTR_REASON, reason_str)) {\n \t\trcu_read_unlock();\n \t\tgoto nla_put_failure;\n \t}\ndiff --git a/net/core/skbuff.c b/net/core/skbuff.c\nindex dbbe10277d51d..c675d33309374 100644\n--- a/net/core/skbuff.c\n+++ b/net/core/skbuff.c\n@@ -148,11 +148,54 @@ static const struct drop_reason_list drop_reasons_core = {\n \t.n_reasons = ARRAY_SIZE(drop_reasons),\n };\n \n-const struct drop_reason_list __rcu *\n+static const struct drop_reason_list __rcu *\n drop_reasons_by_subsys[SKB_DROP_REASON_SUBSYS_NUM] = {\n \t[SKB_DROP_REASON_SUBSYS_CORE] = RCU_INITIALIZER(\u0026drop_reasons_core),\n };\n-EXPORT_SYMBOL(drop_reasons_by_subsys);\n+\n+const char *drop_reason_lookup(unsigned long long value)\n+{\n+\tunsigned long long subsys_id = value \u003e\u003e SKB_DROP_REASON_SUBSYS_SHIFT;\n+\tu32 reason = value \u0026 ~SKB_DROP_REASON_SUBSYS_MASK;\n+\tconst struct drop_reason_list *subsys;\n+\n+\tif (subsys_id \u003e= SKB_DROP_REASON_SUBSYS_NUM)\n+\t\treturn NULL;\n+\n+\tsubsys = rcu_dereference(drop_reasons_by_subsys[subsys_id]);\n+\tif (!subsys)\n+\t\treturn NULL;\n+\tif (reason \u003e= subsys-\u003en_reasons)\n+\t\treturn NULL;\n+\treturn subsys-\u003ereasons[reason];\n+}\n+EXPORT_SYMBOL(drop_reason_lookup);\n+\n+#ifdef CONFIG_TRACEPOINTS\n+void drop_reason_show(struct seq_file *m)\n+{\n+\tu32 subsys_id;\n+\n+\trcu_read_lock();\n+\tfor (subsys_id = 0; subsys_id \u003c SKB_DROP_REASON_SUBSYS_NUM; subsys_id++) {\n+\t\tconst struct drop_reason_list *subsys;\n+\t\tu32 i;\n+\n+\t\tsubsys = rcu_dereference(drop_reasons_by_subsys[subsys_id]);\n+\t\tif (!subsys)\n+\t\t\tcontinue;\n+\n+\t\tfor (i = 0; i \u003c subsys-\u003en_reasons; i++) {\n+\t\t\tif (!subsys-\u003ereasons[i])\n+\t\t\t\tcontinue;\n+\t\t\tseq_printf(m, \", { %u, \\\"%s\\\" }\",\n+\t\t\t\t   (subsys_id \u003c\u003c SKB_DROP_REASON_SUBSYS_SHIFT) | i,\n+\t\t\t\t   subsys-\u003ereasons[i]);\n+\t\t}\n+\t}\n+\trcu_read_unlock();\n+}\n+#endif\n \n /**\n  * drop_reasons_register_subsys - register another drop reason subsystem\ndiff --git a/tools/testing/selftests/net/openvswitch/openvswitch.sh b/tools/testing/selftests/net/openvswitch/openvswitch.sh\nindex a31f7fb6882dc..9b8edfcd2d1a8 100755\n--- a/tools/testing/selftests/net/openvswitch/openvswitch.sh\n+++ b/tools/testing/selftests/net/openvswitch/openvswitch.sh\n@@ -234,7 +234,7 @@ ovs_drop_reason_count()\n \tlocal reason=$1\n \n \tlocal perf_output=`perf script -i ${ovs_dir}/perf.data -F trace:event,trace`\n-\tlocal pattern=\"skb:kfree_skb:.*reason: $reason\"\n+\tlocal pattern=\"skb:kfree_skb:.*reason: $reason$\"\n \n \treturn `echo \"$perf_output\" | grep \"$pattern\" | wc -l`\n }\n@@ -790,15 +790,6 @@ test_psample() {\n # - drop packets and verify the right drop reason is reported\n test_drop_reason() {\n \twhich perf \u003e/dev/null 2\u003e\u00261 || return $ksft_skip\n-\twhich pahole \u003e/dev/null 2\u003e\u00261 || return $ksft_skip\n-\n-\tovs_drop_subsys=$(pahole -C skb_drop_reason_subsys |\n-\t\t\t      awk '/OPENVSWITCH/ { print $3; }' |\n-\t\t\t      tr -d ,)\n-\tif [ -z \"$ovs_drop_subsys\" ]; then\n-\t\tinfo \"failed to get OVS drop subsys ID\"\n-\t\treturn $ksft_skip\n-\tfi\n \n \tsbx_add \"test_drop_reason\" || return $?\n \n@@ -842,7 +833,7 @@ test_drop_reason() {\n \t\t\"in_port(2),eth(),eth_type(0x0800),ipv4(src=172.31.110.20,proto=1),icmp()\" 'drop'\n \n \tovs_drop_record_and_run \"test_drop_reason\" ip netns exec client ping -c 2 172.31.110.20\n-\tovs_drop_reason_count 0x${ovs_drop_subsys}0001 # OVS_DROP_FLOW_ACTION\n+\tovs_drop_reason_count OVS_DROP_LAST_ACTION\n \tif [[ \"$?\" -ne \"2\" ]]; then\n \t\tinfo \"Did not detect expected drops: $?\"\n \t\treturn 1\n@@ -859,7 +850,7 @@ test_drop_reason() {\n \n \tovs_drop_record_and_run \\\n             \"test_drop_reason\" ip netns exec client nc -i 1 -zuv 172.31.110.20 6000\n-\tovs_drop_reason_count 0x${ovs_drop_subsys}0004 # OVS_DROP_EXPLICIT_ACTION_ERROR\n+\tovs_drop_reason_count OVS_DROP_EXPLICIT_WITH_ERROR\n \tif [[ \"$?\" -ne \"1\" ]]; then\n \t\tinfo \"Did not detect expected explicit error drops: $?\"\n \t\treturn 1\n@@ -867,7 +858,7 @@ test_drop_reason() {\n \n \tovs_drop_record_and_run \\\n             \"test_drop_reason\" ip netns exec client nc -i 1 -zuv 172.31.110.20 7000\n-\tovs_drop_reason_count 0x${ovs_drop_subsys}0003 # OVS_DROP_EXPLICIT_ACTION\n+\tovs_drop_reason_count OVS_DROP_EXPLICIT\n \tif [[ \"$?\" -ne \"1\" ]]; then\n \t\tinfo \"Did not detect expected explicit drops: $?\"\n \t\treturn 1\n"
}

2/1 2026/09/24 17:03 agent patch-evaluator
10m Model:
core

Args:
null

Results:
{
  "EnableConfigs": [
    "FTRACE",
    "ENABLE_DEFAULT_TRACERS",
    "NET_DROP_MONITOR"
  ],
  "FocusSymbols": [
    "show_print_fmt",
    "show_sym_list",
    "trace_print_sym_seq",
    "trace_sym_lookup",
    "trace_sym_show",
    "drop_reason_lookup",
    "drop_reason_show",
    "net_dm_packet_report_fill"
  ],
  "Reasoning": "The patch introduces a new dynamic symbol lookup and formatting subsystem (__print_sym, TRACE_DEFINE_SYM_FNS, TRACE_DEFINE_SYM_LIST) in ftrace, replacing static symbol mapping for events such as kfree_skb and timer tick_stop. It introduces custom print format parsing in show_print_fmt and show_sym_list when userspace reads event format files from tracefs, dynamic symbol sequence formatting in trace_print_sym_seq, module section handling for ftrace symbols, and skb drop reason resolution helpers in net/core/skbuff.c used by drop_monitor netlink reporting. These changes alter reachable executable logic in core tracing and networking subsystems, warranting fuzzing.",
  "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 17080a6ac7f5b2b473c2114f50bbff927278e9a6
Author: syz-cluster <triage@syzkaller.com>
Date:   Thu Sep 24 17:03:19 2026 +0000

    syz-cluster: applied patch under review

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index b2988aa12f664..632eafd0f496a 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -275,9 +275,12 @@
 #define FTRACE_EVENTS()							\
 	. = ALIGN(8);							\
 	BOUNDED_SECTION(_ftrace_events)					\
+	. = ALIGN(8);							\
 	BOUNDED_SECTION_BY(_ftrace_eval_map, _ftrace_eval_maps)
+#define FTRACE_SYM_DEFS()	BOUNDED_SECTION(_ftrace_sym_defs)
 #else
 #define FTRACE_EVENTS()
+#define FTRACE_SYM_DEFS()
 #endif
 
 #ifdef CONFIG_TRACING
@@ -391,6 +394,7 @@
 	TRACE_PRINTKS()							\
 	BPF_RAW_TP()							\
 	TRACEPOINT_STR()						\
+	FTRACE_SYM_DEFS()						\
 	KUNIT_TABLE()
 
 /*
diff --git a/include/linux/module.h b/include/linux/module.h
index 96cc98568eea5..a02833ac421bd 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -516,6 +516,8 @@ struct module {
 	unsigned int num_trace_events;
 	struct trace_eval_map **trace_evals;
 	unsigned int num_trace_evals;
+	struct trace_sym_def **trace_sym_defs;
+	unsigned int num_trace_sym_defs;
 #endif
 #ifdef CONFIG_DYNAMIC_FTRACE
 	unsigned int num_ftrace_callsites;
diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
index 5cbd09c8be8d5..80c34ef89feb1 100644
--- a/include/linux/trace_events.h
+++ b/include/linux/trace_events.h
@@ -29,6 +29,13 @@ const char *trace_print_symbols_seq(struct trace_seq *p, unsigned long val,
 				    const struct trace_print_flags *symbol_array,
 				    size_t symbol_array_size);
 
+const char *trace_print_sym_seq(struct trace_seq *p, unsigned long long val,
+				const char *(*lookup)(unsigned long long val));
+const char *trace_sym_lookup(const struct trace_sym_entry *list,
+			     size_t len, unsigned long long value);
+void trace_sym_show(struct seq_file *m,
+		    const struct trace_sym_entry *list, size_t len);
+
 #if BITS_PER_LONG == 32
 const char *trace_print_flags_seq_u64(struct trace_seq *p, const char *delim,
 		      unsigned long long flags,
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index e0d838c9ce938..05c45a72756c3 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -32,6 +32,24 @@ struct trace_eval_map {
 	unsigned long		eval_value;
 };
 
+struct trace_sym_def {
+	const char		*system;
+	const char		*symbol_id;
+	/* may return NULL, called under rcu_read_lock() */
+	const char *		(*lookup)(unsigned long long);
+	/*
+	 * Must print the list: ', { val, "name"}, ...'
+	 * with no trailing comma, but with the leading ', '
+	 * to simplify things:
+	 */
+	void 			(*show)(struct seq_file *);
+};
+
+struct trace_sym_entry {
+	unsigned long long	value;
+	const char		*name;
+};
+
 #define TRACEPOINT_DEFAULT_PRIO	10
 
 extern int
@@ -163,6 +181,8 @@ extern void syscall_unregfunc(void);
 
 #define TRACE_DEFINE_ENUM(x)
 #define TRACE_DEFINE_SIZEOF(x)
+#define TRACE_DEFINE_SYM_FNS(...)
+#define TRACE_DEFINE_SYM_LIST(...)
 
 #ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS
 static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
diff --git a/include/net/dropreason.h b/include/net/dropreason.h
index 1df60645fb278..537428c726424 100644
--- a/include/net/dropreason.h
+++ b/include/net/dropreason.h
@@ -38,9 +38,11 @@ struct drop_reason_list {
 	size_t n_reasons;
 };
 
-/* Note: due to dynamic registrations, access must be under RCU */
-extern const struct drop_reason_list __rcu *
-drop_reasons_by_subsys[SKB_DROP_REASON_SUBSYS_NUM];
+const char *drop_reason_lookup(unsigned long long value);
+
+#ifdef CONFIG_TRACEPOINTS
+void drop_reason_show(struct seq_file *m);
+#endif
 
 void drop_reasons_register_subsys(enum skb_drop_reason_subsys subsys,
 				  const struct drop_reason_list *list);
diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h
index 2945aa7fe9a7d..991bf172a6ea1 100644
--- a/include/trace/events/skb.h
+++ b/include/trace/events/skb.h
@@ -8,15 +8,9 @@
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
 #include <linux/tracepoint.h>
+#include <net/dropreason.h>
 
-#undef FN
-#define FN(reason)	TRACE_DEFINE_ENUM(SKB_DROP_REASON_##reason);
-DEFINE_DROP_REASON(FN, FN)
-
-#undef FN
-#undef FNe
-#define FN(reason)	{ SKB_DROP_REASON_##reason, #reason },
-#define FNe(reason)	{ SKB_DROP_REASON_##reason, #reason }
+TRACE_DEFINE_SYM_FNS(drop_reason, drop_reason_lookup, drop_reason_show);
 
 /*
  * Tracepoint for free an sk_buff:
@@ -47,8 +41,7 @@ TRACE_EVENT(kfree_skb,
 	TP_printk("skbaddr=%p rx_sk=%p protocol=%u location=%pS reason: %s",
 		  __entry->skbaddr, __entry->rx_sk, __entry->protocol,
 		  __entry->location,
-		  __print_symbolic(__entry->reason,
-				   DEFINE_DROP_REASON(FN, FNe)))
+		  __print_sym(__entry->reason, drop_reason))
 );
 
 #undef FN
diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h
index 3aa0608c63611..d45259d960695 100644
--- a/include/trace/events/timer.h
+++ b/include/trace/events/timer.h
@@ -441,26 +441,18 @@ TRACE_EVENT(itimer_expire,
 #undef tick_dep_mask_name
 #undef tick_dep_name_end
 
-/* The MASK will convert to their bits and they need to be processed too */
-#define tick_dep_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \
-	TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
-#define tick_dep_name_end(sdep)  TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \
-	TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
-/* NONE only has a mask defined for it */
-#define tick_dep_mask_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
+#define tick_dep_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
+#define tick_dep_mask_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
+#define tick_dep_name_end(sdep) { TICK_DEP_MASK_##sdep, #sdep }
 
-TICK_DEP_NAMES
+TRACE_DEFINE_SYM_LIST(tick_dep_names, TICK_DEP_NAMES);
 
 #undef tick_dep_name
 #undef tick_dep_mask_name
 #undef tick_dep_name_end
 
-#define tick_dep_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
-#define tick_dep_mask_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
-#define tick_dep_name_end(sdep) { TICK_DEP_MASK_##sdep, #sdep }
-
 #define show_tick_dep_name(val)				\
-	__print_symbolic(val, TICK_DEP_NAMES)
+	__print_sym(val, tick_dep_names)
 
 TRACE_EVENT(tick_stop,
 
diff --git a/include/trace/stages/init.h b/include/trace/stages/init.h
index 000bcfc8dd2e7..6285a03a52b2d 100644
--- a/include/trace/stages/init.h
+++ b/include/trace/stages/init.h
@@ -23,6 +23,61 @@ TRACE_MAKE_SYSTEM_STR();
 	__section("_ftrace_eval_map")			\
 	*TRACE_SYSTEM##_##a = &__##TRACE_SYSTEM##_##a
 
+/*
+ * Define a symbol for __print_sym by giving lookup and
+ * show functions. See &struct trace_sym_def.
+ */
+#undef TRACE_DEFINE_SYM_FNS
+#define TRACE_DEFINE_SYM_FNS(_symbol_id, _lookup, _show)		\
+	_TRACE_DEFINE_SYM_FNS(TRACE_SYSTEM, _symbol_id, _lookup, _show)
+#define _TRACE_DEFINE_SYM_FNS(_system, _symbol_id, _lookup, _show)	\
+	__TRACE_DEFINE_SYM_FNS(_system, _symbol_id, _lookup, _show)
+#define __TRACE_DEFINE_SYM_FNS(_system, _symbol_id, _lookup, _show)	\
+	___TRACE_DEFINE_SYM_FNS(_system ## _ ## _symbol_id, _symbol_id,	\
+				_lookup, _show)
+#define ___TRACE_DEFINE_SYM_FNS(_name, _symbol_id, _lookup, _show)	\
+	static struct trace_sym_def					\
+	__trace_sym_def_ ## _name = {					\
+		.system = TRACE_SYSTEM_STRING,				\
+		.symbol_id = #_symbol_id,				\
+		.lookup = _lookup,					\
+		.show = _show,						\
+	};								\
+	static struct trace_sym_def __used				\
+	__section("_ftrace_sym_defs")					\
+	*__trace_sym_def_p_ ## _name = &__trace_sym_def_ ## _name
+
+/*
+ * Define a symbol for __print_sym by giving lookup and
+ * show functions. See &struct trace_sym_def.
+ */
+#undef TRACE_DEFINE_SYM_LIST
+#define TRACE_DEFINE_SYM_LIST(_symbol_id, ...)				\
+	_TRACE_DEFINE_SYM_LIST(TRACE_SYSTEM, _symbol_id, __VA_ARGS__)
+#define _TRACE_DEFINE_SYM_LIST(_system, _symbol_id, ...)		\
+	__TRACE_DEFINE_SYM_LIST(_system, _symbol_id, __VA_ARGS__)
+#define __TRACE_DEFINE_SYM_LIST(_system, _symbol_id, ...)		\
+	___TRACE_DEFINE_SYM_LIST(_system ## _ ## _symbol_id, _symbol_id,\
+				 __VA_ARGS__)
+#define ___TRACE_DEFINE_SYM_LIST(_name, _symbol_id, ...)		\
+	static struct trace_sym_entry					\
+	__trace_sym_list_ ## _name[] = { __VA_ARGS__ };			\
+	static const char *						\
+	__trace_sym_lookup_ ## _name(unsigned long long value)		\
+	{								\
+		return trace_sym_lookup(__trace_sym_list_ ## _name,	\
+			ARRAY_SIZE(__trace_sym_list_ ## _name), value);	\
+	}								\
+	static void							\
+	__trace_sym_show_ ## _name(struct seq_file *m)			\
+	{								\
+		trace_sym_show(m, __trace_sym_list_ ## _name,		\
+			       ARRAY_SIZE(__trace_sym_list_ ## _name));	\
+	}								\
+	___TRACE_DEFINE_SYM_FNS(_name, _symbol_id,			\
+				__trace_sym_lookup_ ## _name,		\
+				__trace_sym_show_ ## _name)
+
 #undef TRACE_DEFINE_SIZEOF
 #define TRACE_DEFINE_SIZEOF(a)				\
 	static struct trace_eval_map __used __initdata	\
diff --git a/include/trace/stages/stage2_data_offsets.h b/include/trace/stages/stage2_data_offsets.h
index 8b0cff06d3463..5afd9de7deb3b 100644
--- a/include/trace/stages/stage2_data_offsets.h
+++ b/include/trace/stages/stage2_data_offsets.h
@@ -5,6 +5,12 @@
 #undef TRACE_DEFINE_ENUM
 #define TRACE_DEFINE_ENUM(a)
 
+#undef TRACE_DEFINE_SYM_FNS
+#define TRACE_DEFINE_SYM_FNS(_symbol_id, _lookup, _show)
+
+#undef TRACE_DEFINE_SYM_LIST
+#define TRACE_DEFINE_SYM_LIST(_symbol_id, ...)
+
 #undef TRACE_DEFINE_SIZEOF
 #define TRACE_DEFINE_SIZEOF(a)
 
diff --git a/include/trace/stages/stage3_trace_output.h b/include/trace/stages/stage3_trace_output.h
index 181b813357812..09304259a8c1d 100644
--- a/include/trace/stages/stage3_trace_output.h
+++ b/include/trace/stages/stage3_trace_output.h
@@ -79,6 +79,15 @@
 		trace_print_symbols_seq(p, value, symbols, ARRAY_SIZE(symbols));	\
 	})
 
+#undef __print_sym
+#define __print_sym(value, symbol_id)					\
+	___print_sym(TRACE_SYSTEM, value, symbol_id)
+#define ___print_sym(sys, value, symbol_id)				\
+	____print_sym(sys, value, symbol_id)
+#define ____print_sym(sys, value, symbol_id)				\
+	trace_print_sym_seq(p, value,					\
+		__trace_sym_def_p_ ## sys ## _ ## symbol_id->lookup)
+
 #undef __print_flags_u64
 #undef __print_symbolic_u64
 #if BITS_PER_LONG == 32
diff --git a/include/trace/stages/stage7_class_define.h b/include/trace/stages/stage7_class_define.h
index 47008897a7956..936b9fa08ceaf 100644
--- a/include/trace/stages/stage7_class_define.h
+++ b/include/trace/stages/stage7_class_define.h
@@ -45,6 +45,9 @@
 #define __event_in_softirq()	(REC->common_flags & 0x10)
 #define __event_in_irq()	(REC->common_flags & 0x18)
 
+#undef __print_sym
+#define __print_sym(value, symbol_id)	__print_sym(value:symbol_id)
+
 /*
  * The below is not executed in the kernel. It is only what is
  * displayed in the print format for userspace to parse.
diff --git a/kernel/module/main.c b/kernel/module/main.c
index d0e1e0bd2ad06..8ab386a373768 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -2735,6 +2735,9 @@ static int find_module_sections(struct module *mod, struct load_info *info)
 	mod->trace_evals = section_objs(info, "_ftrace_eval_map",
 					sizeof(*mod->trace_evals),
 					&mod->num_trace_evals);
+	mod->trace_sym_defs = section_objs(info, "_ftrace_sym_defs",
+					   sizeof(*mod->trace_sym_defs),
+					   &mod->num_trace_sym_defs);
 #endif
 #ifdef CONFIG_TRACING
 	mod->trace_bprintk_fmt_start = section_objs(info, "__trace_printk_fmt",
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 30c0ddf90887f..53849baae2916 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -2111,6 +2111,102 @@ static void *f_next(struct seq_file *m, void *v, loff_t *pos)
 		return node;
 }
 
+extern struct trace_sym_def *__start_ftrace_sym_defs[];
+extern struct trace_sym_def *__stop_ftrace_sym_defs[];
+
+/* note: @name is not NUL-terminated */
+static void show_sym_list(struct seq_file *m, struct trace_event_call *call,
+			  const char *name, unsigned int name_len)
+{
+	struct trace_sym_def **sym_defs;
+	unsigned int n_sym_defs, i;
+
+	if ((call->flags & TRACE_EVENT_FL_DYNAMIC) || !call->module) {
+		sym_defs = __start_ftrace_sym_defs;
+		n_sym_defs = __stop_ftrace_sym_defs - __start_ftrace_sym_defs;
+	} else {
+#ifdef CONFIG_MODULES
+		struct module *mod = call->module;
+
+		sym_defs = mod->trace_sym_defs;
+		n_sym_defs = mod->num_trace_sym_defs;
+#else
+		return;
+#endif /* CONFIG_MODULES */
+	}
+
+	for (i = 0; i < n_sym_defs; i++) {
+		unsigned int sym_len;
+
+		if (!sym_defs[i])
+			continue;
+		if (sym_defs[i]->system != call->class->system)
+			continue;
+		sym_len = strlen(sym_defs[i]->symbol_id);
+		if (name_len != sym_len)
+			continue;
+		if (strncmp(sym_defs[i]->symbol_id, name, sym_len))
+			continue;
+		if (sym_defs[i]->show)
+			sym_defs[i]->show(m);
+		break;
+	}
+}
+
+static void show_print_fmt(struct seq_file *m, struct trace_event_call *call)
+{
+	char *ptr = call->print_fmt;
+	bool in_print_sym = false;
+	int quote = 0;
+
+	seq_puts(m, "\nprint fmt: ");
+	while (*ptr) {
+		if (*ptr == '\\') {
+			seq_putc(m, *ptr);
+			ptr++;
+			/* paranoid */
+			if (!*ptr)
+				break;
+			goto next;
+		}
+		if (*ptr == '"') {
+			quote ^= 1;
+			goto next;
+		}
+		if (quote)
+			goto next;
+
+		if (in_print_sym && *ptr != ':')
+			goto next;
+
+		if (in_print_sym && *ptr == ':') {
+			const char *name;
+
+			ptr++;
+			name = ptr;
+			/* skip the name */
+			while (*ptr && *ptr != ')')
+				ptr++;
+			/* and show the actual list inline now */
+			show_sym_list(m, call, name, ptr - name);
+			in_print_sym = false;
+			continue;
+		}
+
+		if (strncmp(ptr, "__print_sym(", 12) == 0) {
+			ptr += 12;
+			seq_puts(m, "__print_symbolic(");
+			in_print_sym = true;
+			continue;
+		}
+next:
+		seq_putc(m, *ptr);
+		ptr++;
+	}
+
+	seq_putc(m, '\n');
+}
+
 static int f_show(struct seq_file *m, void *v)
 {
 	struct trace_event_file *file = event_file_data(m->private);
@@ -2130,8 +2226,7 @@ static int f_show(struct seq_file *m, void *v)
 		return 0;
 
 	case FORMAT_PRINTFMT:
-		seq_printf(m, "\nprint fmt: %s\n",
-			   call->print_fmt);
+		show_print_fmt(m, call);
 		return 0;
 	}
 
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index a5ad76175d10d..0850b3ad57075 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -131,6 +131,51 @@ trace_print_symbols_seq(struct trace_seq *p, unsigned long val,
 }
 EXPORT_SYMBOL(trace_print_symbols_seq);
 
+const char *trace_sym_lookup(const struct trace_sym_entry *list,
+			     size_t len, unsigned long long value)
+{
+	size_t i;
+
+	for (i = 0; i < len; i++) {
+		if (list[i].value == value)
+			return list[i].name;
+	}
+	return NULL;
+}
+EXPORT_SYMBOL(trace_sym_lookup);
+
+void trace_sym_show(struct seq_file *m,
+		    const struct trace_sym_entry *list, size_t len)
+{
+	size_t i;
+
+	for (i = 0; i < len; i++)
+		seq_printf(m, ", { %lld, \"%s\" }",
+			   list[i].value, list[i].name);
+}
+EXPORT_SYMBOL(trace_sym_show);
+
+const char *
+trace_print_sym_seq(struct trace_seq *p, unsigned long long val,
+		    const char *(*lookup)(unsigned long long val))
+{
+	const char *ret = trace_seq_buffer_ptr(p);
+	const char *name;
+
+	rcu_read_lock();
+	name = lookup(val);
+	if (name)
+		trace_seq_puts(p, name);
+	else
+		trace_seq_printf(p, "0x%llx", val);
+	rcu_read_unlock();
+
+	trace_seq_putc(p, 0);
+
+	return ret;
+}
+EXPORT_SYMBOL(trace_print_sym_seq);
+
 #if BITS_PER_LONG == 32
 const char *
 trace_print_flags_seq_u64(struct trace_seq *p, const char *delim,
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index edc660778408e..5aa7692c5df27 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -611,9 +611,8 @@ static int net_dm_packet_report_fill(struct sk_buff *msg, struct sk_buff *skb,
 				     size_t payload_len)
 {
 	struct net_dm_skb_cb *cb = NET_DM_SKB_CB(skb);
-	const struct drop_reason_list *list = NULL;
-	unsigned int subsys, subsys_reason;
 	char buf[NET_DM_MAX_SYMBOL_LEN];
+	const char *reason_str;
 	struct nlattr *attr;
 	void *hdr;
 	int rc;
@@ -631,19 +630,10 @@ static int net_dm_packet_report_fill(struct sk_buff *msg, struct sk_buff *skb,
 		goto nla_put_failure;
 
 	rcu_read_lock();
-	subsys = u32_get_bits(cb->reason, SKB_DROP_REASON_SUBSYS_MASK);
-	if (subsys < SKB_DROP_REASON_SUBSYS_NUM)
-		list = rcu_dereference(drop_reasons_by_subsys[subsys]);
-	subsys_reason = cb->reason & ~SKB_DROP_REASON_SUBSYS_MASK;
-	if (!list ||
-	    subsys_reason >= list->n_reasons ||
-	    !list->reasons[subsys_reason] ||
-	    strlen(list->reasons[subsys_reason]) > NET_DM_MAX_REASON_LEN) {
-		list = rcu_dereference(drop_reasons_by_subsys[SKB_DROP_REASON_SUBSYS_CORE]);
-		subsys_reason = SKB_DROP_REASON_NOT_SPECIFIED;
-	}
-	if (nla_put_string(msg, NET_DM_ATTR_REASON,
-			   list->reasons[subsys_reason])) {
+	reason_str = drop_reason_lookup(cb->reason);
+	if (unlikely(!reason_str))
+		reason_str = drop_reason_lookup(SKB_DROP_REASON_NOT_SPECIFIED);
+	if (nla_put_string(msg, NET_DM_ATTR_REASON, reason_str)) {
 		rcu_read_unlock();
 		goto nla_put_failure;
 	}
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index dbbe10277d51d..c675d33309374 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -148,11 +148,54 @@ static const struct drop_reason_list drop_reasons_core = {
 	.n_reasons = ARRAY_SIZE(drop_reasons),
 };
 
-const struct drop_reason_list __rcu *
+static const struct drop_reason_list __rcu *
 drop_reasons_by_subsys[SKB_DROP_REASON_SUBSYS_NUM] = {
 	[SKB_DROP_REASON_SUBSYS_CORE] = RCU_INITIALIZER(&drop_reasons_core),
 };
-EXPORT_SYMBOL(drop_reasons_by_subsys);
+
+const char *drop_reason_lookup(unsigned long long value)
+{
+	unsigned long long subsys_id = value >> SKB_DROP_REASON_SUBSYS_SHIFT;
+	u32 reason = value & ~SKB_DROP_REASON_SUBSYS_MASK;
+	const struct drop_reason_list *subsys;
+
+	if (subsys_id >= SKB_DROP_REASON_SUBSYS_NUM)
+		return NULL;
+
+	subsys = rcu_dereference(drop_reasons_by_subsys[subsys_id]);
+	if (!subsys)
+		return NULL;
+	if (reason >= subsys->n_reasons)
+		return NULL;
+	return subsys->reasons[reason];
+}
+EXPORT_SYMBOL(drop_reason_lookup);
+
+#ifdef CONFIG_TRACEPOINTS
+void drop_reason_show(struct seq_file *m)
+{
+	u32 subsys_id;
+
+	rcu_read_lock();
+	for (subsys_id = 0; subsys_id < SKB_DROP_REASON_SUBSYS_NUM; subsys_id++) {
+		const struct drop_reason_list *subsys;
+		u32 i;
+
+		subsys = rcu_dereference(drop_reasons_by_subsys[subsys_id]);
+		if (!subsys)
+			continue;
+
+		for (i = 0; i < subsys->n_reasons; i++) {
+			if (!subsys->reasons[i])
+				continue;
+			seq_printf(m, ", { %u, \"%s\" }",
+				   (subsys_id << SKB_DROP_REASON_SUBSYS_SHIFT) | i,
+				   subsys->reasons[i]);
+		}
+	}
+	rcu_read_unlock();
+}
+#endif
 
 /**
  * drop_reasons_register_subsys - register another drop reason subsystem
diff --git a/tools/testing/selftests/net/openvswitch/openvswitch.sh b/tools/testing/selftests/net/openvswitch/openvswitch.sh
index a31f7fb6882dc..9b8edfcd2d1a8 100755
--- a/tools/testing/selftests/net/openvswitch/openvswitch.sh
+++ b/tools/testing/selftests/net/openvswitch/openvswitch.sh
@@ -234,7 +234,7 @@ ovs_drop_reason_count()
 	local reason=$1
 
 	local perf_output=`perf script -i ${ovs_dir}/perf.data -F trace:event,trace`
-	local pattern="skb:kfree_skb:.*reason: $reason"
+	local pattern="skb:kfree_skb:.*reason: $reason$"
 
 	return `echo "$perf_output" | grep "$pattern" | wc -l`
 }
@@ -790,15 +790,6 @@ test_psample() {
 # - drop packets and verify the right drop reason is reported
 test_drop_reason() {
 	which perf >/dev/null 2>&1 || return $ksft_skip
-	which pahole >/dev/null 2>&1 || return $ksft_skip
-
-	ovs_drop_subsys=$(pahole -C skb_drop_reason_subsys |
-			      awk '/OPENVSWITCH/ { print $3; }' |
-			      tr -d ,)
-	if [ -z "$ovs_drop_subsys" ]; then
-		info "failed to get OVS drop subsys ID"
-		return $ksft_skip
-	fi
 
 	sbx_add "test_drop_reason" || return $?
 
@@ -842,7 +833,7 @@ test_drop_reason() {
 		"in_port(2),eth(),eth_type(0x0800),ipv4(src=172.31.110.20,proto=1),icmp()" 'drop'
 
 	ovs_drop_record_and_run "test_drop_reason" ip netns exec client ping -c 2 172.31.110.20
-	ovs_drop_reason_count 0x${ovs_drop_subsys}0001 # OVS_DROP_FLOW_ACTION
+	ovs_drop_reason_count OVS_DROP_LAST_ACTION
 	if [[ "$?" -ne "2" ]]; then
 		info "Did not detect expected drops: $?"
 		return 1
@@ -859,7 +850,7 @@ test_drop_reason() {
 
 	ovs_drop_record_and_run \
             "test_drop_reason" ip netns exec client nc -i 1 -zuv 172.31.110.20 6000
-	ovs_drop_reason_count 0x${ovs_drop_subsys}0004 # OVS_DROP_EXPLICIT_ACTION_ERROR
+	ovs_drop_reason_count OVS_DROP_EXPLICIT_WITH_ERROR
 	if [[ "$?" -ne "1" ]]; then
 		info "Did not detect expected explicit error drops: $?"
 		return 1
@@ -867,7 +858,7 @@ test_drop_reason() {
 
 	ovs_drop_record_and_run \
             "test_drop_reason" ip netns exec client nc -i 1 -zuv 172.31.110.20 7000
-	ovs_drop_reason_count 0x${ovs_drop_subsys}0003 # OVS_DROP_EXPLICIT_ACTION
+	ovs_drop_reason_count OVS_DROP_EXPLICIT
 	if [[ "$?" -ne "1" ]]; then
 		info "Did not detect expected explicit drops: $?"
 		return 1

3/2 2026/09/24 17:03 llm patch-evaluator
6m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 11530
							output: 22
							thoughts: 2565
						

Thoughts:
**Fuzzing Evaluation: Potentially Interesting Areas**

Okay, let's break this down. My goal is to determine if this patch series warrants syzkaller fuzzing. First, I'm noting the files touched - a wide range, spanning from core kernel headers and modules to network components and tracing infrastructure, plus some selftests. This suggests a potentially broad impact, which increases the likelihood of interesting fuzzing targets.

Specifically, I'm focusing on the `drop_reason_lookup()` function added to `net/core/skbuff.c` and its use in `net/core/drop_monitor.c`. This lookup seems crucial for mapping numeric drop reasons to human-readable strings, likely for debugging and reporting. The implementation uses RCU reads and indexing, raising questions.

The `trace_events.c` code is also of high importance. It involves a string parsing vulnerability in `show_print_fmt()`, which is called when reading `<debugfs/tracefs>/tracing/events/<system>/<event>/format`. There is a potential vulnerability in how format strings in trace events are handled and interpreted. The parsing logic within `show_print_fmt()` iterates through format strings and displays values. This code potentially allows for format string injection/manipulation through the debugfs. Particularly the handling of escaped characters and the `__print_sym()` feature catches my attention, and I will be looking deeper into it.

The main concern in the new `drop_reason_lookup()` is the potential for returning NULL values when `subsys->reasons[reason]` is accessed, because it is RCU-protected. This can lead to unexpected behavior in `net_dm_packet_report_fill()` or in tracepoints, but the code in `drop_monitor.c` handles this case. However, that isn't the root of the problem. If `subsys->reasons[reason]` is NULL, then the string may not be populated correctly.

The use of `rcu_read_lock()` within `trace_print_sym_seq()` and the potential for a NULL `name` are worth closer inspection. What happens if a lookup fails? Does the code handle this gracefully or could it lead to a NULL dereference or incorrect output?

The patch modifies `drop_reason_lookup` is used in multiple places, especially the tracepoint events. This increased surface area means more likelihood for bugs and security vulnerabilities. This increases the potential for interesting fuzzing targets.

Finally, I'll need to look at the commit message and/or related Git history to fully understand the rationale behind these changes and identify any specific goals or potential risks the developers were aware of. Given the changes to the tracepoint functionality and string parsing, I lean toward the possibility of format string bugs. The network-related code also seems like a valid area of interest for standard fuzzing. The RCU-related issues and potential NULL pointer dereferences in the lookup code add another layer of complexity that could be exploited.



4/2 2026/09/24 17:10 tool grepper
0m Args:
{
  "Expression": "TRACE_DEFINE_SYM_FNS"
}

Results:
{
  "Output": "include/linux/tracepoint.h=175=extern void syscall_unregfunc(void);\n--\ninclude/linux/tracepoint.h-183-#define TRACE_DEFINE_SIZEOF(x)\ninclude/linux/tracepoint.h:184:#define TRACE_DEFINE_SYM_FNS(...)\ninclude/linux/tracepoint.h-185-#define TRACE_DEFINE_SYM_LIST(...)\n--\ninclude/trace/events/skb.h-12-\ninclude/trace/events/skb.h:13:TRACE_DEFINE_SYM_FNS(drop_reason, drop_reason_lookup, drop_reason_show);\ninclude/trace/events/skb.h-14-\n--\ninclude/trace/stages/init.h=11=TRACE_MAKE_SYSTEM_STR();\n--\ninclude/trace/stages/init.h-29- */\ninclude/trace/stages/init.h:30:#undef TRACE_DEFINE_SYM_FNS\ninclude/trace/stages/init.h:31:#define TRACE_DEFINE_SYM_FNS(_symbol_id, _lookup, _show)\t\t\\\ninclude/trace/stages/init.h:32:\t_TRACE_DEFINE_SYM_FNS(TRACE_SYSTEM, _symbol_id, _lookup, _show)\ninclude/trace/stages/init.h:33:#define _TRACE_DEFINE_SYM_FNS(_system, _symbol_id, _lookup, _show)\t\\\ninclude/trace/stages/init.h:34:\t__TRACE_DEFINE_SYM_FNS(_system, _symbol_id, _lookup, _show)\ninclude/trace/stages/init.h:35:#define __TRACE_DEFINE_SYM_FNS(_system, _symbol_id, _lookup, _show)\t\\\ninclude/trace/stages/init.h:36:\t___TRACE_DEFINE_SYM_FNS(_system ## _ ## _symbol_id, _symbol_id,\t\\\ninclude/trace/stages/init.h-37-\t\t\t\t_lookup, _show)\ninclude/trace/stages/init.h:38:#define ___TRACE_DEFINE_SYM_FNS(_name, _symbol_id, _lookup, _show)\t\\\ninclude/trace/stages/init.h-39-\tstatic struct trace_sym_def\t\t\t\t\t\\\n--\ninclude/trace/stages/init.h-76-\t}\t\t\t\t\t\t\t\t\\\ninclude/trace/stages/init.h:77:\t___TRACE_DEFINE_SYM_FNS(_name, _symbol_id,\t\t\t\\\ninclude/trace/stages/init.h-78-\t\t\t\t__trace_sym_lookup_ ## _name,\t\t\\\n--\ninclude/trace/stages/stage2_data_offsets.h-7-\ninclude/trace/stages/stage2_data_offsets.h:8:#undef TRACE_DEFINE_SYM_FNS\ninclude/trace/stages/stage2_data_offsets.h:9:#define TRACE_DEFINE_SYM_FNS(_symbol_id, _lookup, _show)\ninclude/trace/stages/stage2_data_offsets.h-10-\n"
}

5/2 2026/09/24 17:10 llm patch-evaluator
1m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 15504
							output: 39
							thoughts: 1085
						

Thoughts:
**Analyzing the Potential for Fuzzing with Dynamic Symbol Printing in Ftrace**

Okay, let's break this down. This commit introduces dynamic symbol printing (`__print_sym`) within ftrace, replacing the old static enum/symbolic mapping approach. Specifically, it affects trace events like those used by `kfree_skb` and timer functions. I need to understand the implications of this change for fuzzing.

First, let's look at `kfree_skb`. The key here is how `__print_sym` replaces the old `__print_symbolic`. It uses `drop_reason_lookup()` and the reading of the format file (`/sys/kernel/tracing/events/.../format`) triggers `show_print_fmt()`.

Okay, so when an event like `kfree_skb` fires and is written to the trace buffer, `trace_print_sym_seq` gets called. I need to trace back from `trace_print_sym_seq`. Ah, it's defined in `include/trace/stages/stage3_trace_output.h`. This shows that whenever an event with `__print_sym` is output in trace output (e.g. `trace`, `trace_pipe`, perf, etc.), it calls `trace_print_sym_seq` with `lookup`.

Now, is this code path even *reachable*? Yes! The code touches a number of files: `net/core/skbuff.c`, `net/core/drop_monitor.c`, `kernel/trace/trace_events.c`, `kernel/trace/trace_output.c`, and `kernel/module/main.c`. That's a definite check in the "reachable" box.

Now, for the big question: Does this patch warrant fuzzing? I need to analyze the criteria for returning `WorthFuzzing=false`. The relevant part is: "Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints that do not alter control flow or data structures."

Is this *just* decorative logging? Let's be precise. This isn't just a simple logging change; it added new ftrace infrastructure: `TRACE_DEFINE_SYM_FNS`, `TRACE_DEFINE_SYM_LIST`, and `__print_sym`. More importantly, it *modified* `kernel/trace/trace_events.c` to parse `__print_sym` in `show_print_fmt()`, calling `show_sym_list()`. Wait, let's look closer at `show_print_fmt()` in `kernel/trace/trace_events.c`. Specifically, let's inspect the code around line 2111.



6/2 2026/09/24 17:11 tool read-file
0m Args:
{
  "File": "kernel/trace/trace_events.c",
  "FirstLine": 2110,
  "LineCount": 100
}

Results:
{
  "Contents": "2110:\t\telse\n2111:\t\t\treturn node;\n2112:\t}\n2113:\t\n2114:\textern struct trace_sym_def *__start_ftrace_sym_defs[];\n2115:\textern struct trace_sym_def *__stop_ftrace_sym_defs[];\n2116:\t\n2117:\t/* note: @name is not NUL-terminated */\n2118:\tstatic void show_sym_list(struct seq_file *m, struct trace_event_call *call,\n2119:\t\t\t\t  const char *name, unsigned int name_len)\n2120:\t{\n2121:\t\tstruct trace_sym_def **sym_defs;\n2122:\t\tunsigned int n_sym_defs, i;\n2123:\t\n2124:\t\tif ((call-\u003eflags \u0026 TRACE_EVENT_FL_DYNAMIC) || !call-\u003emodule) {\n2125:\t\t\tsym_defs = __start_ftrace_sym_defs;\n2126:\t\t\tn_sym_defs = __stop_ftrace_sym_defs - __start_ftrace_sym_defs;\n2127:\t\t} else {\n2128:\t#ifdef CONFIG_MODULES\n2129:\t\t\tstruct module *mod = call-\u003emodule;\n2130:\t\n2131:\t\t\tsym_defs = mod-\u003etrace_sym_defs;\n2132:\t\t\tn_sym_defs = mod-\u003enum_trace_sym_defs;\n2133:\t#else\n2134:\t\t\treturn;\n2135:\t#endif /* CONFIG_MODULES */\n2136:\t\t}\n2137:\t\n2138:\t\tfor (i = 0; i \u003c n_sym_defs; i++) {\n2139:\t\t\tunsigned int sym_len;\n2140:\t\n2141:\t\t\tif (!sym_defs[i])\n2142:\t\t\t\tcontinue;\n2143:\t\t\tif (sym_defs[i]-\u003esystem != call-\u003eclass-\u003esystem)\n2144:\t\t\t\tcontinue;\n2145:\t\t\tsym_len = strlen(sym_defs[i]-\u003esymbol_id);\n2146:\t\t\tif (name_len != sym_len)\n2147:\t\t\t\tcontinue;\n2148:\t\t\tif (strncmp(sym_defs[i]-\u003esymbol_id, name, sym_len))\n2149:\t\t\t\tcontinue;\n2150:\t\t\tif (sym_defs[i]-\u003eshow)\n2151:\t\t\t\tsym_defs[i]-\u003eshow(m);\n2152:\t\t\tbreak;\n2153:\t\t}\n2154:\t}\n2155:\t\n2156:\tstatic void show_print_fmt(struct seq_file *m, struct trace_event_call *call)\n2157:\t{\n2158:\t\tchar *ptr = call-\u003eprint_fmt;\n2159:\t\tbool in_print_sym = false;\n2160:\t\tint quote = 0;\n2161:\t\n2162:\t\tseq_puts(m, \"\\nprint fmt: \");\n2163:\t\twhile (*ptr) {\n2164:\t\t\tif (*ptr == '\\\\') {\n2165:\t\t\t\tseq_putc(m, *ptr);\n2166:\t\t\t\tptr++;\n2167:\t\t\t\t/* paranoid */\n2168:\t\t\t\tif (!*ptr)\n2169:\t\t\t\t\tbreak;\n2170:\t\t\t\tgoto next;\n2171:\t\t\t}\n2172:\t\t\tif (*ptr == '\"') {\n2173:\t\t\t\tquote ^= 1;\n2174:\t\t\t\tgoto next;\n2175:\t\t\t}\n2176:\t\t\tif (quote)\n2177:\t\t\t\tgoto next;\n2178:\t\n2179:\t\t\tif (in_print_sym \u0026\u0026 *ptr != ':')\n2180:\t\t\t\tgoto next;\n2181:\t\n2182:\t\t\tif (in_print_sym \u0026\u0026 *ptr == ':') {\n2183:\t\t\t\tconst char *name;\n2184:\t\n2185:\t\t\t\tptr++;\n2186:\t\t\t\tname = ptr;\n2187:\t\t\t\t/* skip the name */\n2188:\t\t\t\twhile (*ptr \u0026\u0026 *ptr != ')')\n2189:\t\t\t\t\tptr++;\n2190:\t\t\t\t/* and show the actual list inline now */\n2191:\t\t\t\tshow_sym_list(m, call, name, ptr - name);\n2192:\t\t\t\tin_print_sym = false;\n2193:\t\t\t\tcontinue;\n2194:\t\t\t}\n2195:\t\n2196:\t\t\tif (strncmp(ptr, \"__print_sym(\", 12) == 0) {\n2197:\t\t\t\tptr += 12;\n2198:\t\t\t\tseq_puts(m, \"__print_symbolic(\");\n2199:\t\t\t\tin_print_sym = true;\n2200:\t\t\t\tcontinue;\n2201:\t\t\t}\n2202:\tnext:\n2203:\t\t\tseq_putc(m, *ptr);\n2204:\t\t\tptr++;\n2205:\t\t}\n2206:\t\n2207:\t\tseq_putc(m, '\\n');\n2208:\t}\n2209:\t\n"
}

7/2 2026/09/24 17:11 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 18584
							output: 38
							thoughts: 417
						

Thoughts:
**Analyzing this Kernel Patch**

Okay, here's what I'm seeing. This patch is fairly involved. At first glance, it appears to be focused on improving tracepoint functionality within the kernel. It’s adding custom parsing of `call->print_fmt` specifically for when userspace reads the tracefs format file, and includes associated lookup functions. There's also some work related to formatting "drop monitor" strings and a module section loading modification in `kernel/module/main.c`.

I need to confirm the scope of these changes. My initial thought is that these kinds of changes should fall under the purely decorative category. Adding a tracepoint like `trace_my_event(...)` seems harmless and doesn't inherently alter control flow or data structures. However, it's never that simple.

Now, let’s dig a bit deeper. I see it's modifying several key files:

1.  `kernel/trace/trace_events.c`: It's adding `show_print_fmt` and `show_sym_list`. That immediately flags something significant. It’s altering how the kernel *generates* trace event formats! This goes beyond mere decoration; it's messing with string parsing and pointer manipulation, which could have deeper implications.

2.  `kernel/trace/trace_output.c`: This adds functions like `trace_print_sym_seq`, `trace_sym_lookup`, and `trace_sym_show`. This makes me think it is adding new trace output features.

3.  `kernel/module/main.c`: Okay, so it’s handling the loading of the `_ftrace_sym_defs` section. This is related to module support, so probably fine, but needs more investigation.

4.  `net/core/skbuff.c`: It's exporting `drop_reason_lookup` and `drop_reason_show` and refactoring `drop_reasons_by_subsys`. Okay, that's moving things around.

5.  `net/core/drop_monitor.c`: This modifies `net_dm_packet_report_fill()` to call `drop_reason_lookup()`. This is a crucial link to analyze. It seems to make a change to network tracepoints.

My biggest concern is `net_dm_packet_report_fill()`. The fact that it calls `drop_reason_lookup()` means that a change is being made to the network tracepoints. I need to understand if `net_dm_packet_report_fill()` can be reached, and if so, how. I will check the `net/core/drop_monitor.c` file to trace the function calls.



8/2 2026/09/24 17:11 tool grepper
0m Args:
{
  "Expression": "net_dm_packet_report_fill",
  "PathPrefix": "net/core/drop_monitor.c"
}

Results:
{
  "Output": "net/core/drop_monitor.c=585=static int net_dm_packet_report_in_port_put(struct sk_buff *msg, int ifindex,\n--\nnet/core/drop_monitor.c-609-\nnet/core/drop_monitor.c:610:static int net_dm_packet_report_fill(struct sk_buff *msg, struct sk_buff *skb,\nnet/core/drop_monitor.c-611-\t\t\t\t     size_t payload_len)\n--\nnet/core/drop_monitor.c=679=static void net_dm_packet_report(struct sk_buff *skb)\n--\nnet/core/drop_monitor.c-699-\nnet/core/drop_monitor.c:700:\trc = net_dm_packet_report_fill(msg, skb, payload_len);\nnet/core/drop_monitor.c-701-\tif (rc) {\n"
}

9/2 2026/09/24 17:11 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 19863
							output: 36
							thoughts: 41
						

Thoughts:
Okay, here's my take on those thoughts, framed as a first-person expert summary:

**Digging into `net_dm_packet_report`**

Alright, so the drop monitor is triggering `net_dm_packet_report` when it sees packet drops, and we're monitoring that using generic netlink. That's good, that's what I'd expect. So, I need to understand how this is used and what's connected to it. I want to see how this function fits into the bigger picture. My next move is to identify the functions that are calling `net_dm_packet_report`. Time to break out the debugging tools and figure out the call graph for `net_dm_packet_report`. Let's see what's actually *using* that function and understand its connections. That’s where the action is.



10/2 2026/09/24 17:11 tool grepper
0m Args:
{
  "Expression": "net_dm_packet_report",
  "PathPrefix": "net/core/drop_monitor.c"
}

Results:
{
  "Output": "net/core/drop_monitor.c=545=static size_t net_dm_in_port_size(void)\n--\nnet/core/drop_monitor.c-557-\nnet/core/drop_monitor.c:558:static size_t net_dm_packet_report_size(size_t payload_len)\nnet/core/drop_monitor.c-559-{\n--\nnet/core/drop_monitor.c-584-\nnet/core/drop_monitor.c:585:static int net_dm_packet_report_in_port_put(struct sk_buff *msg, int ifindex,\nnet/core/drop_monitor.c-586-\t\t\t\t\t    const char *name)\n--\nnet/core/drop_monitor.c-609-\nnet/core/drop_monitor.c:610:static int net_dm_packet_report_fill(struct sk_buff *msg, struct sk_buff *skb,\nnet/core/drop_monitor.c-611-\t\t\t\t     size_t payload_len)\n--\nnet/core/drop_monitor.c-645-\nnet/core/drop_monitor.c:646:\trc = net_dm_packet_report_in_port_put(msg, skb-\u003eskb_iif, NULL);\nnet/core/drop_monitor.c-647-\tif (rc)\n--\nnet/core/drop_monitor.c-678-\nnet/core/drop_monitor.c:679:static void net_dm_packet_report(struct sk_buff *skb)\nnet/core/drop_monitor.c-680-{\n--\nnet/core/drop_monitor.c-695-\nnet/core/drop_monitor.c:696:\tmsg = nlmsg_new(net_dm_packet_report_size(payload_len), GFP_KERNEL);\nnet/core/drop_monitor.c-697-\tif (!msg)\n--\nnet/core/drop_monitor.c-699-\nnet/core/drop_monitor.c:700:\trc = net_dm_packet_report_fill(msg, skb, payload_len);\nnet/core/drop_monitor.c-701-\tif (rc) {\n--\nnet/core/drop_monitor.c=712=static void net_dm_packet_work(struct work_struct *work)\n--\nnet/core/drop_monitor.c-727-\twhile ((skb = __skb_dequeue(\u0026list)))\nnet/core/drop_monitor.c:728:\t\tnet_dm_packet_report(skb);\nnet/core/drop_monitor.c-729-}\n--\nnet/core/drop_monitor.c=767=static int net_dm_hw_packet_report_fill(struct sk_buff *msg,\n--\nnet/core/drop_monitor.c-795-\nnet/core/drop_monitor.c:796:\t\trc = net_dm_packet_report_in_port_put(msg, dev-\u003eifindex,\nnet/core/drop_monitor.c-797-\t\t\t\t\t\t      dev-\u003ename);\n"
}

11/2 2026/09/24 17:11 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 20922
							output: 27
							thoughts: 2276
						

Thoughts:
**Deep Dive into `trace_events` and Dynamic Tracepoints**

Okay, let's break this down. I was reviewing `net_dm_packet_report_fill` and immediately noticed the change from explicitly checking `NET_DM_MAX_REASON_LEN` to using `drop_reason_lookup`.  That removal caught my eye.  The concern is that a string returned by `drop_reason_lookup` could exceed this maximum length. That check used to be there, and now it's gone!  

But then I thought, where else does this `drop_reason_lookup` get used? It's time to follow the trail.

My next step? Look at how `drop_reason_show` and `show_print_fmt` are related.  The `format` files in tracefs are key.  I found the `f_show` function in `kernel/trace/trace_events.c` called by `FORMAT_PRINTFMT` to get the format string.

The magic happens in `show_print_fmt`.  It parses the `call->print_fmt` string, and I need to figure out how this `print_fmt` gets populated.  

Looking at the `kfree_skb` tracepoint, I see it uses `__print_sym(REC->reason:drop_reason)`.  This is where things get interesting, and potentially problematic. `show_print_fmt` is designed to parse this symbolic information. It identifies `__print_sym(` and does some work.  It then calls `show_sym_list`. This then searches the `__start_ftrace_sym_defs` to `__stop_ftrace_sym_defs` range looking for a match on `symbol_id`. If `symbol_id` is the name of a registered symbol it will find it. Then `drop_reason_show(m)` gets called, and it prints the list of available reasons. Great!

But here's the kicker: What happens if a module defines its *own* tracepoints with `__print_sym`? The code checks `call->module` and uses `mod->trace_sym_defs`! This could be a vulnerability, if the module does not properly construct these definitions.

Now I am thinking about edge cases and error handling. What if `mod->trace_sym_defs` is NULL, or contains invalid entries?  What happens if the `print_fmt` string is malformed?

I examined how `show_print_fmt` handles malformed format strings, especially the critical `*ptr == 0` case. If the `print_fmt` string ends unexpectedly after a `__print_sym` opening parenthesis, `in_print_sym` is set to false, and the parser advances to the next character as expected.

I also thought about escaped characters and quote handling. The `\\` escape sequence correctly renders a backslash. I looked at the handling of quotes and verified that it is not vulnerable to any parsing problems, because it's handling `"` as an escaped character.

Here I thought about the case where there is not colon in `__print_sym(...)`. In this case, there is a bug, because the string parsing advances without considering the colon and the closing parenthesis. The parser keeps printing all the characters till the end, leaving `in_print_sym` set.

This begs the question: Where does `call->print_fmt` *come* from?  It is generated at kernel compile time by the tracepoint macros! Specifically, in `include/trace/stages/stage7_class_define.h`.

Finally, what if userspace, eBPF, or a dynamic tracepoint uses `__print_sym`?  Can they create events, or define `print_fmt` themselves? This will be my next investigation. Are these mechanisms safe, or can they be manipulated to inject arbitrary code or data into the trace output?



12/2 2026/09/24 17:12 tool grepper
0m Args:
{
  "Expression": "print_fmt",
  "PathPrefix": "kernel/trace/"
}

Results:
{
  "Output": "kernel/trace/trace.c=3033=static enum print_line_t print_trace_fmt(struct trace_iterator *iter)\n--\nkernel/trace/trace.c-3060-\t\t/*\nkernel/trace/trace.c:3061:\t\t * For TRACE_EVENT() events, the print_fmt is not\nkernel/trace/trace.c-3062-\t\t * safe to use if the array has delta offsets\n--\nkernel/trace/trace_eprobe.c=839=static int __trace_eprobe_create(int argc, const char *argv[])\n--\nkernel/trace/trace_eprobe.c-950-\t}\nkernel/trace/trace_eprobe.c:951:\tret = traceprobe_set_print_fmt(\u0026ep-\u003etp, PROBE_PRINT_EVENT);\nkernel/trace/trace_eprobe.c-952-\tif (ret \u003c 0)\n--\nkernel/trace/trace_events.c=452=static void test_event_printk(struct trace_event_call *call)\n--\nkernel/trace/trace_events.c-463-\nkernel/trace/trace_events.c:464:\tfmt = call-\u003eprint_fmt;\nkernel/trace/trace_events.c-465-\n--\nkernel/trace/trace_events.c-640-\t\t\ttrace_event_name(call), arg);\nkernel/trace/trace_events.c:641:\t\tpr_warn(\"print_fmt: %s\\n\", fmt);\nkernel/trace/trace_events.c-642-\t}\n--\nkernel/trace/trace_events.c=2118=static void show_sym_list(struct seq_file *m, struct trace_event_call *call,\n--\nkernel/trace/trace_events.c-2155-\nkernel/trace/trace_events.c:2156:static void show_print_fmt(struct seq_file *m, struct trace_event_call *call)\nkernel/trace/trace_events.c-2157-{\nkernel/trace/trace_events.c:2158:\tchar *ptr = call-\u003eprint_fmt;\nkernel/trace/trace_events.c-2159-\tbool in_print_sym = false;\n--\nkernel/trace/trace_events.c=2210=static int f_show(struct seq_file *m, void *v)\n--\nkernel/trace/trace_events.c-2228-\tcase FORMAT_PRINTFMT:\nkernel/trace/trace_events.c:2229:\t\tshow_print_fmt(m, call);\nkernel/trace/trace_events.c-2230-\t\treturn 0;\n--\nkernel/trace/trace_events.c=3556=static void update_event_printk(struct trace_event_call *call,\n--\nkernel/trace/trace_events.c-3562-\nkernel/trace/trace_events.c:3563:\tfor (ptr = call-\u003eprint_fmt; *ptr; ptr++) {\nkernel/trace/trace_events.c-3564-\t\tif (*ptr == '\\\\') {\n--\nkernel/trace/trace_events_synth.c=321=static void print_synth_event_num_val(struct trace_seq *s,\nkernel/trace/trace_events_synth.c:322:\t\t\t\t      char *print_fmt, char *name,\nkernel/trace/trace_events_synth.c-323-\t\t\t\t      int size, union trace_synth_field *val, char *space)\n--\nkernel/trace/trace_events_synth.c-326-\tcase 1:\nkernel/trace/trace_events_synth.c:327:\t\ttrace_seq_printf(s, print_fmt, name, val-\u003eas_u8, space);\nkernel/trace/trace_events_synth.c-328-\t\tbreak;\n--\nkernel/trace/trace_events_synth.c-330-\tcase 2:\nkernel/trace/trace_events_synth.c:331:\t\ttrace_seq_printf(s, print_fmt, name, val-\u003eas_u16, space);\nkernel/trace/trace_events_synth.c-332-\t\tbreak;\n--\nkernel/trace/trace_events_synth.c-334-\tcase 4:\nkernel/trace/trace_events_synth.c:335:\t\ttrace_seq_printf(s, print_fmt, name, val-\u003eas_u32, space);\nkernel/trace/trace_events_synth.c-336-\t\tbreak;\n--\nkernel/trace/trace_events_synth.c-338-\tdefault:\nkernel/trace/trace_events_synth.c:339:\t\ttrace_seq_printf(s, print_fmt, name, val-\u003eas_u64, space);\nkernel/trace/trace_events_synth.c-340-\t\tbreak;\n--\nkernel/trace/trace_events_synth.c=344=static enum print_line_t print_synth_event(struct trace_iterator *iter,\n--\nkernel/trace/trace_events_synth.c-352-\tunsigned int i, j, n_u64;\nkernel/trace/trace_events_synth.c:353:\tchar print_fmt[32];\nkernel/trace/trace_events_synth.c-354-\tconst char *fmt;\n--\nkernel/trace/trace_events_synth.c-370-\nkernel/trace/trace_events_synth.c:371:\t\tsnprintf(print_fmt, sizeof(print_fmt), \"%%s=%s%%s\", fmt);\nkernel/trace/trace_events_synth.c-372-\n--\nkernel/trace/trace_events_synth.c-377-\nkernel/trace/trace_events_synth.c:378:\t\t\t\ttrace_seq_printf(s, print_fmt, se-\u003efields[i]-\u003ename,\nkernel/trace/trace_events_synth.c-379-\t\t\t\t\t\t (char *)entry + data-\u003eas_dynamic.offset,\n--\nkernel/trace/trace_events_synth.c-382-\t\t\t} else {\nkernel/trace/trace_events_synth.c:383:\t\t\t\ttrace_seq_printf(s, print_fmt, se-\u003efields[i]-\u003ename,\nkernel/trace/trace_events_synth.c-384-\t\t\t\t\t\t (char *)\u0026entry-\u003efields[n_u64].as_u64,\n--\nkernel/trace/trace_events_synth.c-400-\nkernel/trace/trace_events_synth.c:401:\t\t\tprint_synth_event_num_val(s, print_fmt,\nkernel/trace/trace_events_synth.c-402-\t\t\t\t\t\t  se-\u003efields[i]-\u003ename,\n--\nkernel/trace/trace_events_synth.c=619=static void perf_event_raw_event_synth(void *__data,\n--\nkernel/trace/trace_events_synth.c-657-\nkernel/trace/trace_events_synth.c:658:static void free_synth_event_print_fmt(struct trace_event_call *call)\nkernel/trace/trace_events_synth.c-659-{\nkernel/trace/trace_events_synth.c-660-\tif (call) {\nkernel/trace/trace_events_synth.c:661:\t\tkfree(call-\u003eprint_fmt);\nkernel/trace/trace_events_synth.c:662:\t\tcall-\u003eprint_fmt = NULL;\nkernel/trace/trace_events_synth.c-663-\t}\n--\nkernel/trace/trace_events_synth.c-665-\nkernel/trace/trace_events_synth.c:666:static int __set_synth_event_print_fmt(struct synth_event *event,\nkernel/trace/trace_events_synth.c-667-\t\t\t\t       char *buf, int len)\n--\nkernel/trace/trace_events_synth.c-699-\nkernel/trace/trace_events_synth.c:700:\t/* return the length of print_fmt */\nkernel/trace/trace_events_synth.c-701-\treturn pos;\n--\nkernel/trace/trace_events_synth.c-703-\nkernel/trace/trace_events_synth.c:704:static int set_synth_event_print_fmt(struct trace_event_call *call)\nkernel/trace/trace_events_synth.c-705-{\nkernel/trace/trace_events_synth.c-706-\tstruct synth_event *event = call-\u003edata;\nkernel/trace/trace_events_synth.c:707:\tchar *print_fmt;\nkernel/trace/trace_events_synth.c-708-\tint len;\n--\nkernel/trace/trace_events_synth.c-710-\t/* First: called with 0 length to calculate the needed length */\nkernel/trace/trace_events_synth.c:711:\tlen = __set_synth_event_print_fmt(event, NULL, 0);\nkernel/trace/trace_events_synth.c-712-\nkernel/trace/trace_events_synth.c:713:\tprint_fmt = kmalloc(len + 1, GFP_KERNEL);\nkernel/trace/trace_events_synth.c:714:\tif (!print_fmt)\nkernel/trace/trace_events_synth.c-715-\t\treturn -ENOMEM;\nkernel/trace/trace_events_synth.c-716-\nkernel/trace/trace_events_synth.c:717:\t/* Second: actually write the @print_fmt */\nkernel/trace/trace_events_synth.c:718:\t__set_synth_event_print_fmt(event, print_fmt, len + 1);\nkernel/trace/trace_events_synth.c:719:\tcall-\u003eprint_fmt = print_fmt;\nkernel/trace/trace_events_synth.c-720-\n--\nkernel/trace/trace_events_synth.c=955=static int register_synth_event(struct synth_event *event)\n--\nkernel/trace/trace_events_synth.c-998-\nkernel/trace/trace_events_synth.c:999:\tret = set_synth_event_print_fmt(call);\nkernel/trace/trace_events_synth.c-1000-\t/* unregister_trace_event() will be called inside */\n--\nkernel/trace/trace_events_synth.c=1020=static void free_synth_event(struct synth_event *event)\n--\nkernel/trace/trace_events_synth.c-1034-\tfree_synth_tracepoint(event-\u003etp);\nkernel/trace/trace_events_synth.c:1035:\tfree_synth_event_print_fmt(\u0026event-\u003ecall);\nkernel/trace/trace_events_synth.c-1036-\tkfree(event);\n--\nkernel/trace/trace_events_user.c=1395=static int user_field_set_string(struct ftrace_event_field *field,\n--\nkernel/trace/trace_events_user.c-1412-\nkernel/trace/trace_events_user.c:1413:static int user_event_set_print_fmt(struct user_event *user, char *buf, int len)\nkernel/trace/trace_events_user.c-1414-{\n--\nkernel/trace/trace_events_user.c-1446-\nkernel/trace/trace_events_user.c:1447:static int user_event_create_print_fmt(struct user_event *user)\nkernel/trace/trace_events_user.c-1448-{\nkernel/trace/trace_events_user.c:1449:\tchar *print_fmt;\nkernel/trace/trace_events_user.c-1450-\tint len;\nkernel/trace/trace_events_user.c-1451-\nkernel/trace/trace_events_user.c:1452:\tlen = user_event_set_print_fmt(user, NULL, 0);\nkernel/trace/trace_events_user.c-1453-\nkernel/trace/trace_events_user.c:1454:\tprint_fmt = kmalloc(len, GFP_KERNEL_ACCOUNT);\nkernel/trace/trace_events_user.c-1455-\nkernel/trace/trace_events_user.c:1456:\tif (!print_fmt)\nkernel/trace/trace_events_user.c-1457-\t\treturn -ENOMEM;\nkernel/trace/trace_events_user.c-1458-\nkernel/trace/trace_events_user.c:1459:\tuser_event_set_print_fmt(user, print_fmt, len);\nkernel/trace/trace_events_user.c-1460-\nkernel/trace/trace_events_user.c:1461:\tuser-\u003ecall.print_fmt = print_fmt;\nkernel/trace/trace_events_user.c-1462-\n--\nkernel/trace/trace_events_user.c=1502=static int destroy_user_event(struct user_event *user)\n--\nkernel/trace/trace_events_user.c-1539-\nkernel/trace/trace_events_user.c:1540:\tkfree(user-\u003ecall.print_fmt);\nkernel/trace/trace_events_user.c-1541-\tkfree(EVENT_NAME(user));\n--\nkernel/trace/trace_events_user.c=2103=static int user_event_parse(struct user_event_group *group, char *name,\n--\nkernel/trace/trace_events_user.c-2172-\nkernel/trace/trace_events_user.c:2173:\tret = user_event_create_print_fmt(user);\nkernel/trace/trace_events_user.c-2174-\n--\nkernel/trace/trace_events_user.c-2230-\tuser_event_destroy_validators(user);\nkernel/trace/trace_events_user.c:2231:\tkfree(user-\u003ecall.print_fmt);\nkernel/trace/trace_events_user.c-2232-\n--\nkernel/trace/trace_export.c=188=struct trace_event_call __used event_##call = {\t\t\t\t\\\n--\nkernel/trace/trace_export.c-193-\t.event.type\t\t= etype,\t\t\t\t\\\nkernel/trace/trace_export.c:194:\t.print_fmt\t\t= print,\t\t\t\t\\\nkernel/trace/trace_export.c-195-\t.flags\t\t\t= TRACE_EVENT_FL_IGNORE_ENABLE,\t\t\\\n--\nkernel/trace/trace_fprobe.c=1209=static int trace_fprobe_create_internal(int argc, const char *argv[],\n--\nkernel/trace/trace_fprobe.c-1373-\nkernel/trace/trace_fprobe.c:1374:\tret = traceprobe_set_print_fmt(\u0026tf-\u003etp,\nkernel/trace/trace_fprobe.c-1375-\t\t\tis_return ? PROBE_PRINT_RETURN : PROBE_PRINT_NORMAL);\n--\nkernel/trace/trace_kprobe.c=854=static int trace_kprobe_create_internal(int argc, const char *argv[],\n--\nkernel/trace/trace_kprobe.c-1072-\tptype = is_return ? PROBE_PRINT_RETURN : PROBE_PRINT_NORMAL;\nkernel/trace/trace_kprobe.c:1073:\tret = traceprobe_set_print_fmt(\u0026tk-\u003etp, ptype);\nkernel/trace/trace_kprobe.c-1074-\tif (ret \u003c 0)\n--\nkernel/trace/trace_kprobe.c=1933=create_local_trace_kprobe(char *func, void *addr, unsigned long offs,\n--\nkernel/trace/trace_kprobe.c-1967-\t\tPROBE_PRINT_RETURN : PROBE_PRINT_NORMAL;\nkernel/trace/trace_kprobe.c:1968:\tif (traceprobe_set_print_fmt(\u0026tk-\u003etp, ptype) \u003c 0)\nkernel/trace/trace_kprobe.c-1969-\t\treturn ERR_PTR(-ENOMEM);\n--\nkernel/trace/trace_probe.c=2428=int traceprobe_update_arg(struct probe_arg *arg)\n--\nkernel/trace/trace_probe.c-2463-#define LEN_OR_ZERO (len \u003e pos ? len - pos : 0)\nkernel/trace/trace_probe.c:2464:static int __set_print_fmt(struct trace_probe *tp, char *buf, int len,\nkernel/trace/trace_probe.c-2465-\t\t\t   enum probe_print_type ptype)\n--\nkernel/trace/trace_probe.c-2528-\nkernel/trace/trace_probe.c:2529:\t/* return the length of print_fmt */\nkernel/trace/trace_probe.c-2530-\treturn pos;\n--\nkernel/trace/trace_probe.c-2533-\nkernel/trace/trace_probe.c:2534:int traceprobe_set_print_fmt(struct trace_probe *tp, enum probe_print_type ptype)\nkernel/trace/trace_probe.c-2535-{\n--\nkernel/trace/trace_probe.c-2537-\tint len;\nkernel/trace/trace_probe.c:2538:\tchar *print_fmt;\nkernel/trace/trace_probe.c-2539-\nkernel/trace/trace_probe.c-2540-\t/* First: called with 0 length to calculate the needed length */\nkernel/trace/trace_probe.c:2541:\tlen = __set_print_fmt(tp, NULL, 0, ptype);\nkernel/trace/trace_probe.c:2542:\tprint_fmt = kmalloc(len + 1, GFP_KERNEL);\nkernel/trace/trace_probe.c:2543:\tif (!print_fmt)\nkernel/trace/trace_probe.c-2544-\t\treturn -ENOMEM;\nkernel/trace/trace_probe.c-2545-\nkernel/trace/trace_probe.c:2546:\t/* Second: actually write the @print_fmt */\nkernel/trace/trace_probe.c:2547:\t__set_print_fmt(tp, print_fmt, len + 1, ptype);\nkernel/trace/trace_probe.c:2548:\tcall-\u003eprint_fmt = print_fmt;\nkernel/trace/trace_probe.c-2549-\n--\nkernel/trace/trace_probe.c=2619=static void trace_probe_event_free(struct trace_probe_event *tpe)\n--\nkernel/trace/trace_probe.c-2627-\tkfree(tpe-\u003ecall.name);\nkernel/trace/trace_probe.c:2628:\tkfree(tpe-\u003ecall.print_fmt);\nkernel/trace/trace_probe.c-2629-\tkfree(tpe);\n--\nkernel/trace/trace_probe.h=519=enum probe_print_type {\n--\nkernel/trace/trace_probe.h-524-\nkernel/trace/trace_probe.h:525:extern int traceprobe_set_print_fmt(struct trace_probe *tp, enum probe_print_type ptype);\nkernel/trace/trace_probe.h-526-\n--\nkernel/trace/trace_remote.c=1088=static int remote_event_format_show(struct seq_file *s, void *unused)\n--\nkernel/trace/trace_remote.c-1110-\nkernel/trace/trace_remote.c:1111:\tseq_printf(s, \"print fmt: %s\\n\", evt-\u003eprint_fmt);\nkernel/trace/trace_remote.c-1112-\n--\nkernel/trace/trace_syscalls.c=387=static int __init\nkernel/trace/trace_syscalls.c:388:sys_enter_openat_print_fmt(struct syscall_metadata *entry, char *buf, int len)\nkernel/trace/trace_syscalls.c-389-{\n--\nkernel/trace/trace_syscalls.c=440=static int __init\nkernel/trace/trace_syscalls.c:441:__set_enter_print_fmt(struct syscall_metadata *entry, char *buf, int len)\nkernel/trace/trace_syscalls.c-442-{\n--\nkernel/trace/trace_syscalls.c-448-\tcase __NR_openat:\nkernel/trace/trace_syscalls.c:449:\t\treturn sys_enter_openat_print_fmt(entry, buf, len);\nkernel/trace/trace_syscalls.c-450-\tdefault:\n--\nkernel/trace/trace_syscalls.c-488-\nkernel/trace/trace_syscalls.c:489:\t/* return the length of print_fmt */\nkernel/trace/trace_syscalls.c-490-\treturn pos;\n--\nkernel/trace/trace_syscalls.c-492-\nkernel/trace/trace_syscalls.c:493:static int __init set_syscall_print_fmt(struct trace_event_call *call)\nkernel/trace/trace_syscalls.c-494-{\nkernel/trace/trace_syscalls.c:495:\tchar *print_fmt;\nkernel/trace/trace_syscalls.c-496-\tint len;\n--\nkernel/trace/trace_syscalls.c-499-\tif (entry-\u003eenter_event != call) {\nkernel/trace/trace_syscalls.c:500:\t\tcall-\u003eprint_fmt = \"\\\"0x%lx\\\", REC-\u003eret\";\nkernel/trace/trace_syscalls.c-501-\t\treturn 0;\n--\nkernel/trace/trace_syscalls.c-504-\t/* First: called with 0 length to calculate the needed length */\nkernel/trace/trace_syscalls.c:505:\tlen = __set_enter_print_fmt(entry, NULL, 0);\nkernel/trace/trace_syscalls.c-506-\nkernel/trace/trace_syscalls.c:507:\tprint_fmt = kmalloc(len + 1, GFP_KERNEL);\nkernel/trace/trace_syscalls.c:508:\tif (!print_fmt)\nkernel/trace/trace_syscalls.c-509-\t\treturn -ENOMEM;\nkernel/trace/trace_syscalls.c-510-\nkernel/trace/trace_syscalls.c:511:\t/* Second: actually write the @print_fmt */\nkernel/trace/trace_syscalls.c:512:\t__set_enter_print_fmt(entry, print_fmt, len + 1);\nkernel/trace/trace_syscalls.c:513:\tcall-\u003eprint_fmt = print_fmt;\nkernel/trace/trace_syscalls.c-514-\n--\nkernel/trace/trace_syscalls.c-517-\nkernel/trace/trace_syscalls.c:518:static void __init free_syscall_print_fmt(struct trace_event_call *call)\nkernel/trace/trace_syscalls.c-519-{\n--\nkernel/trace/trace_syscalls.c-522-\tif (entry-\u003eenter_event == call)\nkernel/trace/trace_syscalls.c:523:\t\tkfree(call-\u003eprint_fmt);\nkernel/trace/trace_syscalls.c-524-}\n--\nkernel/trace/trace_syscalls.c=1265=static int __init init_syscall_trace(struct trace_event_call *call)\n--\nkernel/trace/trace_syscalls.c-1278-\nkernel/trace/trace_syscalls.c:1279:\tif (set_syscall_print_fmt(call) \u003c 0)\nkernel/trace/trace_syscalls.c-1280-\t\treturn -ENOMEM;\n--\nkernel/trace/trace_syscalls.c-1284-\tif (id \u003c 0) {\nkernel/trace/trace_syscalls.c:1285:\t\tfree_syscall_print_fmt(call);\nkernel/trace/trace_syscalls.c-1286-\t\treturn id;\n--\nkernel/trace/trace_uprobe.c=542=static int __trace_uprobe_create(int argc, const char **argv)\n--\nkernel/trace/trace_uprobe.c-715-\tptype = is_ret_probe(tu) ? PROBE_PRINT_RETURN : PROBE_PRINT_NORMAL;\nkernel/trace/trace_uprobe.c:716:\tret = traceprobe_set_print_fmt(\u0026tu-\u003etp, ptype);\nkernel/trace/trace_uprobe.c-717-\tif (ret \u003c 0)\n--\nkernel/trace/trace_uprobe.c=1628=create_local_trace_uprobe(char *name, unsigned long offs,\n--\nkernel/trace/trace_uprobe.c-1671-\tptype = is_ret_probe(tu) ? PROBE_PRINT_RETURN : PROBE_PRINT_NORMAL;\nkernel/trace/trace_uprobe.c:1672:\tif (traceprobe_set_print_fmt(\u0026tu-\u003etp, ptype) \u003c 0) {\nkernel/trace/trace_uprobe.c-1673-\t\tret = -ENOMEM;\n"
}

13/2 2026/09/24 17:12 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 30527
							output: 29
							thoughts: 4192
						

Thoughts:
**Fuzzing Analysis: Kernel Tracing and Module Loading**

Okay, here's the breakdown. I need to figure out if this patch is worth fuzzing. I'm focusing on the criteria: is this *really* just decorative logging, or does it touch core functionality?

My initial scan shows this patch touches a *lot*. It's involved in reading event formats (`/sys/kernel/tracing/events`), tracepoint output, and the drop monitor netlink interface. The key thing I see is that it uses `trace_print_sym_seq` which then calls into things like `drop_reason_lookup` and, potentially, the module symbol lookup functions. This means anything that uses tracing, drop monitoring or module loading could be affected.

The negative criteria (when *not* to fuzz) lists "Purely decorative logging" or "that do not alter control flow or data structures". But this isn't that! This patch modifies how symbol lookup, printing, and parsing of trace data *actually* works within the kernel. The code modifies:
*   Core tracing infrastructure: `kernel/trace/*` functions for printing and looking up symbolic names.
*   Module loading: Changes to how trace symbols are handled within modules.
*   Networking: Modifies the drop monitor code and the lookup of `drop_reason` values.

This isn't just adding a print statement; it's changing how the kernel *interprets* and presents information. It adds and modifies data structures: `trace_sym_def`, `trace_sym_entry`, changes to `struct module`, etc. This looks like a refactoring. The positive criteria say that any changes to "core subsystems" or "restructuring of reachable data structures, helper abstractions, or algorithm flows" should be fuzzed. This definitely qualifies.

I know syzkaller can reach these paths, including reading event formats, tracing, generic netlink drop monitoring, and module loading (all easily done in a standard QEMU environment).

Now, let's hunt for potential bugs. I'm focusing on the `show_print_fmt()` function. Specifically, this block:

```c
		if (in_print_sym && *ptr == ':') {
			const char *name;

			ptr++;
			name = ptr;
			/* skip the name */
			while (*ptr && *ptr != ')')
				ptr++;
			/* and show the actual list inline now */
			show_sym_list(m, call, name, ptr - name);
			in_print_sym = false;
			continue;
		}
```

What if the `ptr` hits the end of the string before it finds a closing parenthesis? `show_sym_list` would be called with `name` pointing to a string that isn't null-terminated. Then `in_print_sym = false; continue;` and the loop continues, potentially leading to more reads.

Then, there's the module loading side of things. How is the list of symbols from modules handled? Let's check `show_sym_list()` again:

```c
	for (i = 0; i < n_sym_defs; i++) {
		if (sym_defs[i]->system != call->class->system)
			continue;
```

Are `sym_defs[i]->system` and `call->class->system` string pointers from different compilation units? If so, this comparison is probably comparing pointers! It should be `strcmp` for the strings, so this could lead to a bug.

I need to confirm if these comparisons are comparing string content or if they are comparing pointers. I also need to verify what happens when `show_sym_list()` is called from a module. There may be issues with how the module symbols are initialized.

Finally, the fact that this is changing the core networking path through `drop_reason_lookup` is also a potential fuzzing target.

Based on all of this, this patch definitely needs to be fuzzed. It's touching core kernel subsystems and introducing potential for bugs with string comparison.



14/2 2026/09/24 17:12 tool grepper
0m Args:
{
  "Expression": "system ==|system !=",
  "PathPrefix": "kernel/trace/"
}

Results:
{
  "Output": "kernel/trace/trace_events.c=2118=static void show_sym_list(struct seq_file *m, struct trace_event_call *call,\n--\nkernel/trace/trace_events.c-2142-\t\t\tcontinue;\nkernel/trace/trace_events.c:2143:\t\tif (sym_defs[i]-\u003esystem != call-\u003eclass-\u003esystem)\nkernel/trace/trace_events.c-2144-\t\t\tcontinue;\n--\nkernel/trace/trace_events.c=3782=void trace_event_update_all(struct trace_eval_map **map, int len, struct module *mod)\n--\nkernel/trace/trace_events.c-3798-\t\t/* events are usually grouped together with systems */\nkernel/trace/trace_events.c:3799:\t\tif (!last_system || call-\u003eclass-\u003esystem != last_system) {\nkernel/trace/trace_events.c-3800-\t\t\tfirst = true;\n--\nkernel/trace/trace_events.c-3816-\t\tfor (i = last_i; i \u003c len; i++) {\nkernel/trace/trace_events.c:3817:\t\t\tif (call-\u003eclass-\u003esystem == map[i]-\u003esystem) {\nkernel/trace/trace_events.c-3818-\t\t\t\t/* Save the first system if need be */\n--\nkernel/trace/trace_events_filter.c=1329=static void filter_free_subsystem_preds(struct trace_subsystem_dir *dir,\n--\nkernel/trace/trace_events_filter.c-1334-\tlist_for_each_entry(file, \u0026tr-\u003eevents, list) {\nkernel/trace/trace_events_filter.c:1335:\t\tif (file-\u003esystem != dir)\nkernel/trace/trace_events_filter.c-1336-\t\t\tcontinue;\n--\nkernel/trace/trace_events_filter.c=1438=static void filter_free_subsystem_filters(struct trace_subsystem_dir *dir,\n--\nkernel/trace/trace_events_filter.c-1452-\tlist_for_each_entry(file, \u0026tr-\u003eevents, list) {\nkernel/trace/trace_events_filter.c:1453:\t\tif (file-\u003esystem != dir)\nkernel/trace/trace_events_filter.c-1454-\t\t\tcontinue;\n--\nkernel/trace/trace_events_filter.c-1478-\tlist_for_each_entry(file, \u0026tr-\u003eevents, list) {\nkernel/trace/trace_events_filter.c:1479:\t\tif (file-\u003esystem != dir || !file-\u003efilter)\nkernel/trace/trace_events_filter.c-1480-\t\t\tcontinue;\n--\nkernel/trace/trace_events_filter.c=2253=static int process_system_preds(struct trace_subsystem_dir *dir,\n--\nkernel/trace/trace_events_filter.c-2272-\nkernel/trace/trace_events_filter.c:2273:\t\tif (file-\u003esystem != dir)\nkernel/trace/trace_events_filter.c-2274-\t\t\tcontinue;\n--\nkernel/trace/trace_events_hist.c=2263=static char *local_field_var_ref(struct hist_trigger_data *hist_data,\n--\nkernel/trace/trace_events_hist.c-2278-\nkernel/trace/trace_events_hist.c:2279:\tif (!!system != !!event_name)\nkernel/trace/trace_events_hist.c-2280-\t\treturn NULL;\n"
}

15/2 2026/09/24 17:12 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 36538
							output: 23
							thoughts: 1062
						

Thoughts:
**RCU Safety in `drop_reason_lookup` and Potential Vulnerabilities**

Okay, let's break this down. First, I was looking at `trace_event_update_all` and noted the use of pointer comparison in ftrace, which makes sense given how `TRACE_MAKE_SYSTEM_STR()` creates shared strings.  Now, I'm diving into `drop_reason_lookup` in `net/core/skbuff.c`.  I see the code, and my alarm bells are going off because of that `rcu_dereference` call.

My immediate question is: is `rcu_read_lock()` *always* held when calling `drop_reason_lookup()`? The function itself is declared in `include/net/dropreason.h` without any explicit RCU annotations or lockdep checks in the prototype.  This is a red flag.  I know that with `CONFIG_PROVE_RCU` enabled, `rcu_dereference()` will trigger a lockdep warning if `rcu_read_lock()` isn't held.

So, I need to verify all the call sites of `drop_reason_lookup()`.  The first two locations I checked in `net/core/drop_monitor.c` and `kernel/trace/trace_output.c` *do* have `rcu_read_lock()` surrounding the call, which is good.  But then I remember `drop_reason_lookup()` is `EXPORT_SYMBOL()` which means it's available to kernel modules. This makes me very nervous; what if some future, or existing, caller *doesn't* respect the RCU requirements?

That leads me to double-check `include/linux/tracepoint.h`, where I see the `struct trace_sym_def` structure, which defines the `lookup` function.  It *does* say "may return NULL, called under rcu_read_lock()".  This suggests an implicit contract.

The final function I investigated was `drop_reason_show` which, thankfully, *also* holds `rcu_read_lock()` around its usage of `rcu_dereference`. So that one is safe.

The real concern is that `drop_reason_lookup()` is exported. It's an exported symbol that relies on a specific RCU locking scheme without enforcing it in the API. This is very fragile.

So, to complete the investigation, I need to check how drop reasons are registered, since I am now curious about Open vSwitch. I need to review all callers of `drop_reasons_register_subsys` in the kernel. This is a potential vulnerability, a race condition, or a read-after-free situation waiting to happen if a module doesn't use the lock correctly.



16/2 2026/09/24 17:12 tool grepper
0m Args:
{
  "Expression": "drop_reasons_register_subsys"
}

Results:
{
  "Output": "include/net/dropreason.h=44=void drop_reason_show(struct seq_file *m);\n--\ninclude/net/dropreason.h-46-\ninclude/net/dropreason.h:47:void drop_reasons_register_subsys(enum skb_drop_reason_subsys subsys,\ninclude/net/dropreason.h-48-\t\t\t\t  const struct drop_reason_list *list);\n--\nnet/core/skbuff.c=175=void drop_reason_show(struct seq_file *m)\n--\nnet/core/skbuff.c-200-/**\nnet/core/skbuff.c:201: * drop_reasons_register_subsys - register another drop reason subsystem\nnet/core/skbuff.c-202- * @subsys: the subsystem to register, must not be the core\n--\nnet/core/skbuff.c-205- */\nnet/core/skbuff.c:206:void drop_reasons_register_subsys(enum skb_drop_reason_subsys subsys,\nnet/core/skbuff.c-207-\t\t\t\t  const struct drop_reason_list *list)\n--\nnet/core/skbuff.c-216-}\nnet/core/skbuff.c:217:EXPORT_SYMBOL_GPL(drop_reasons_register_subsys);\nnet/core/skbuff.c-218-\n--\nnet/mac80211/main.c=1795=static int __init ieee80211_init(void)\n--\nnet/mac80211/main.c-1811-\nnet/mac80211/main.c:1812:\tdrop_reasons_register_subsys(SKB_DROP_REASON_SUBSYS_MAC80211_UNUSABLE,\nnet/mac80211/main.c-1813-\t\t\t\t     \u0026drop_reason_list_unusable);\n--\nnet/openvswitch/datapath.c=2830=static int __init dp_init(void)\n--\nnet/openvswitch/datapath.c-2870-\nnet/openvswitch/datapath.c:2871:\tdrop_reasons_register_subsys(SKB_DROP_REASON_SUBSYS_OPENVSWITCH,\nnet/openvswitch/datapath.c-2872-\t\t\t\t     \u0026drop_reason_list_ovs);\n"
}

17/2 2026/09/24 17:12 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 38846
							output: 23
							thoughts: 114
						

Thoughts:
**Concurrent Access Concerns in Openvswitch and mac80211 Drop Reason Reporting**

Okay, so Openvswitch and mac80211 are using `drop_reasons_register_subsys` to, cleverly, register their drop reasons. Nice! And, dynamically, during the `kfree_skb/format` phase, we're iterating over these registered subsystems – using `drop_reason_show` – to dump out the relevant reasons, which is precisely what we want. The key point is that it uses `rcu_read_lock()` during the iteration; that's good practice.

But wait a second... this triggers a concern. What if a subsystem is unregistered or, even worse, *registered* concurrently while `drop_reason_show` is running, or perhaps during the read of the `format` data? That's a classic race condition scenario and something we need to explore immediately. We need to understand the implications of these concurrent operations on the registered subsystem list, so let's check what `drop_reasons_unregister_subsys` is doing. I need to understand if the RCU protection is sufficient, or if we have a bigger issue on our hands.



18/2 2026/09/24 17:12 tool grepper
0m Args:
{
  "Expression": "drop_reasons_unregister_subsys"
}

Results:
{
  "Output": "include/net/dropreason.h=47=void drop_reasons_register_subsys(enum skb_drop_reason_subsys subsys,\ninclude/net/dropreason.h-48-\t\t\t\t  const struct drop_reason_list *list);\ninclude/net/dropreason.h:49:void drop_reasons_unregister_subsys(enum skb_drop_reason_subsys subsys);\ninclude/net/dropreason.h-50-\n--\nnet/core/skbuff.c=217=EXPORT_SYMBOL_GPL(drop_reasons_register_subsys);\n--\nnet/core/skbuff.c-219-/**\nnet/core/skbuff.c:220: * drop_reasons_unregister_subsys - unregister a drop reason subsystem\nnet/core/skbuff.c-221- * @subsys: the subsystem to remove, must not be the core\n--\nnet/core/skbuff.c-224- */\nnet/core/skbuff.c:225:void drop_reasons_unregister_subsys(enum skb_drop_reason_subsys subsys)\nnet/core/skbuff.c-226-{\n--\nnet/core/skbuff.c-235-}\nnet/core/skbuff.c:236:EXPORT_SYMBOL_GPL(drop_reasons_unregister_subsys);\nnet/core/skbuff.c-237-\n--\nnet/mac80211/main.c=1822=static void __exit ieee80211_exit(void)\n--\nnet/mac80211/main.c-1829-\nnet/mac80211/main.c:1830:\tdrop_reasons_unregister_subsys(SKB_DROP_REASON_SUBSYS_MAC80211_UNUSABLE);\nnet/mac80211/main.c-1831-\n--\nnet/openvswitch/datapath.c=2893=static void dp_cleanup(void)\n--\nnet/openvswitch/datapath.c-2898-\tunregister_pernet_device(\u0026ovs_net_ops);\nnet/openvswitch/datapath.c:2899:\tdrop_reasons_unregister_subsys(SKB_DROP_REASON_SUBSYS_OPENVSWITCH);\nnet/openvswitch/datapath.c-2900-\trcu_barrier();\n"
}

19/2 2026/09/24 17:12 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 39860
							output: 30
							thoughts: 1325
						

Thoughts:
**Analyzing Trace Event Symbol Handling and Potential Vulnerabilities**

Okay, let's dive back into `kernel/trace/trace_events.c`. I need to re-examine how `show_print_fmt` and `show_sym_list` interact, specifically focusing on symbol definitions. My initial thought is to revisit `show_sym_list` when `call->module` is set.

Wait, what happens if `call->module` is set, indicating a module-defined tracepoint, but the module's `mod->trace_sym_defs` is NULL or empty? The code correctly handles this by skipping the loop, but it prompts a deeper question:

What if a module attempts to use a symbol definition from the kernel core or another module? The code, as it currently stands, seems to exclusively check `mod->trace_sym_defs` when `call->module` is set. This looks like a blind spot: a module-defined tracepoint might *expect* to use a built-in symbol, and that expectation wouldn't be met. The existing code can't identify such cases.

And that then made me think of the format file parsing. Let's see how `show_print_fmt` is set up.

Okay, let's look at `show_print_fmt`. I'm curious about whether `call->print_fmt` is ever modified concurrently. The general expectation is that `print_fmt` is constant or set during event creation. But...

What about dynamic events – eprobes, kprobes, user events, synthetic events? This is where the real potential for a problem lies. Can a user-created synthetic event or any of these other types craft a format string containing `__print_sym(`? If they can, it's possible to inject arbitrary symbol lookups into the trace output.

Wait, can userspace write to `/sys/kernel/tracing/events/...`? That's the key. Yes, userspace can create and modify synthetic events, dynamic events like uprobes, kprobes and user events!

My hypothesis is that a malicious user or program *could* exploit this by crafting a synthetic event or user_event with a specially crafted format string. The goal would be to trigger the execution of arbitrary code through symbolic lookups and print formatting.

For example, when a user creates a user event or synth event with a field or argument, the format string is generated.

Where does the format actually get generated? I'll need to look at `__set_synth_event_print_fmt` and `traceprobe_set_print_fmt`. Specifically, let's see what `__set_print_fmt` does in `trace_probe.c`. This needs a closer look!



20/2 2026/09/24 17:12 tool grepper
0m Args:
{
  "Expression": "__set_print_fmt",
  "PathPrefix": "kernel/trace/"
}

Results:
{
  "Output": "kernel/trace/trace_probe.c=2428=int traceprobe_update_arg(struct probe_arg *arg)\n--\nkernel/trace/trace_probe.c-2463-#define LEN_OR_ZERO (len \u003e pos ? len - pos : 0)\nkernel/trace/trace_probe.c:2464:static int __set_print_fmt(struct trace_probe *tp, char *buf, int len,\nkernel/trace/trace_probe.c-2465-\t\t\t   enum probe_print_type ptype)\n--\nkernel/trace/trace_probe.c=2534=int traceprobe_set_print_fmt(struct trace_probe *tp, enum probe_print_type ptype)\n--\nkernel/trace/trace_probe.c-2540-\t/* First: called with 0 length to calculate the needed length */\nkernel/trace/trace_probe.c:2541:\tlen = __set_print_fmt(tp, NULL, 0, ptype);\nkernel/trace/trace_probe.c-2542-\tprint_fmt = kmalloc(len + 1, GFP_KERNEL);\n--\nkernel/trace/trace_probe.c-2546-\t/* Second: actually write the @print_fmt */\nkernel/trace/trace_probe.c:2547:\t__set_print_fmt(tp, print_fmt, len + 1, ptype);\nkernel/trace/trace_probe.c-2548-\tcall-\u003eprint_fmt = print_fmt;\n"
}

21/2 2026/09/24 17:12 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 42187
							output: 38
							thoughts: 2078
						

Thoughts:
**Fuzzing Decision for a Kernel Patch**

Okay, so I've got this patch, and I need to figure out if it's worth fuzzing. The first thing that jumps out is that `show_print_fmt()` is now called whenever the `format` file is read for *any* tracing event! That's a huge change from the previous version, which used a simple `seq_printf`. Now it parses the format string character by character and calls `show_sym_list()` when it finds `__print_sym(`, which does a linear scan for symbols. The implications are that *every* trace event format is now parsed character by character.

I need to confirm if this change is worth the extra attention. It touches multiple core subsystems: tracing, modules, and networking. This patch clearly doesn't fall into any of the "negative criteria" for not fuzzing, as it's not documentation or purely cosmetic. It *does* change executable kernel code and alters data structures, and it touches reachable code through userspace operations, like reading `/sys/kernel/tracing/trace` or loading modules. So, based on the criteria, `WorthFuzzing=true`.

Now, I'll need to figure out what symbols to focus on for fuzzing. The goal is to target specific feature logic, not ubiquitous functions. I'll need to identify functions specifically added or altered.

Here's my initial list of modified/new symbols based on code inspection:
*   `drop_reason_lookup` and `drop_reason_show` from `net/core/skbuff.c`.
*   `trace_print_sym_seq`, `trace_sym_lookup`, and `trace_sym_show` from `kernel/trace/trace_output.c`.
*   `show_print_fmt` and `show_sym_list` in `kernel/trace/trace_events.c`.
*   `net_dm_packet_report_fill` from `net/core/drop_monitor.c`.
*   `find_module_sections` from `kernel/module/main.c`.

Although `find_module_sections` is touched during module loads, `show_print_fmt`, `show_sym_list`, and the `trace_*` functions, `drop_reason_*` are much more specific to this feature. Even if `show_print_fmt` and `show_sym_list` are static, they are not inlined by the compiler.
I should also keep an eye on `f_show`, the `seq_file` "show" method for event format files in tracefs!

Therefore, the following would be an ideal starting list of focus symbols:
*   `drop_reason_lookup`
*   `drop_reason_show`
*   `trace_print_sym_seq`
*   `trace_sym_lookup`
*   `trace_sym_show`
*   `show_print_fmt`
*   `show_sym_list`
*   `net_dm_packet_report_fill`
*   `f_show` (to investigate it!)



22/2 2026/09/24 17:13 tool read-file
0m Args:
{
  "File": "kernel/trace/trace_events.c",
  "FirstLine": 2205,
  "LineCount": 40
}

Results:
{
  "Contents": "2205:\t\t}\n2206:\t\n2207:\t\tseq_putc(m, '\\n');\n2208:\t}\n2209:\t\n2210:\tstatic int f_show(struct seq_file *m, void *v)\n2211:\t{\n2212:\t\tstruct trace_event_file *file = event_file_data(m-\u003eprivate);\n2213:\t\tstruct trace_event_call *call = file-\u003eevent_call;\n2214:\t\tstruct ftrace_event_field *field;\n2215:\t\tconst char *array_descriptor;\n2216:\t\n2217:\t\tswitch ((unsigned long)v) {\n2218:\t\tcase FORMAT_HEADER:\n2219:\t\t\tseq_printf(m, \"name: %s\\n\", trace_event_name(call));\n2220:\t\t\tseq_printf(m, \"ID: %d\\n\", call-\u003eevent.type);\n2221:\t\t\tseq_puts(m, \"format:\\n\");\n2222:\t\t\treturn 0;\n2223:\t\n2224:\t\tcase FORMAT_FIELD_SEPERATOR:\n2225:\t\t\tseq_putc(m, '\\n');\n2226:\t\t\treturn 0;\n2227:\t\n2228:\t\tcase FORMAT_PRINTFMT:\n2229:\t\t\tshow_print_fmt(m, call);\n2230:\t\t\treturn 0;\n2231:\t\t}\n2232:\t\n2233:\t\tfield = list_entry(v, struct ftrace_event_field, link);\n2234:\t\t/*\n2235:\t\t * Smartly shows the array type(except dynamic array).\n2236:\t\t * Normal:\n2237:\t\t *\tfield:TYPE VAR\n2238:\t\t * If TYPE := TYPE[LEN], it is shown:\n2239:\t\t *\tfield:TYPE VAR[LEN]\n2240:\t\t */\n2241:\t\tarray_descriptor = strchr(field-\u003etype, '[');\n2242:\t\n2243:\t\tif (str_has_prefix(field-\u003etype, \"__data_loc\"))\n2244:\t\t\tarray_descriptor = NULL;\n"
}

23/2 2026/09/24 17:13 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 45572
							output: 36
							thoughts: 71
						

Thoughts:
Here's my thought process, as I analyze these configurations:

**Analyzing EnableConfigs for Code Compilation and Execution**

Okay, so I need to figure out the necessary configurations ("EnableConfigs") to compile and actually *use* this modified code. The first thing I’m zeroing in on are the specific source files: `kernel/trace/trace_events.c` and `kernel/trace/trace_output.c`. They're the core of the matter. My goal is to determine which Kconfig options are absolutely essential for enabling this tracing functionality. The logical next step is to examine the `kernel/trace/Makefile`. That's where the dependencies and compilation rules usually live, which will point me to the relevant Kconfig symbols. Time to dig in and correlate the source files with the build system.



24/2 2026/09/24 17:13 tool grepper
0m Args:
{
  "Expression": "trace_events\\.o|trace_output\\.o",
  "PathPrefix": "kernel/trace/Makefile"
}

Results:
{
  "Output": "kernel/trace/Makefile=20=ifdef CONFIG_FUNCTION_SELF_TRACING\nkernel/trace/Makefile:21:CFLAGS_trace_output.o = $(CC_FLAGS_FTRACE)\nkernel/trace/Makefile-22-CFLAGS_trace_seq.o = $(CC_FLAGS_FTRACE)\n--\nkernel/trace/Makefile=25=CFLAGS_synth_event_gen_test.o = $(CC_FLAGS_FTRACE)\nkernel/trace/Makefile:26:CFLAGS_trace_events.o = $(CC_FLAGS_FTRACE)\nkernel/trace/Makefile-27-CFLAGS_trace_syscalls.o = $(CC_FLAGS_FTRACE)\n--\nkernel/trace/Makefile=67=obj-$(CONFIG_TRACING) += trace.o\nkernel/trace/Makefile:68:obj-$(CONFIG_TRACING) += trace_output.o\nkernel/trace/Makefile-69-obj-$(CONFIG_TRACING) += trace_seq.o\n--\nkernel/trace/Makefile=96=endif\nkernel/trace/Makefile:97:obj-$(CONFIG_EVENT_TRACING) += trace_events.o\nkernel/trace/Makefile-98-obj-$(CONFIG_EVENT_TRACING) += trace_export.o\n"
}

25/2 2026/09/24 17:13 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 46154
							output: 28
							thoughts: 118
						

Thoughts:
**Tracing Configuration: Deeper Dive**

Okay, so `CONFIG_TRACING` clearly brings in `trace_output.o`, and `CONFIG_EVENT_TRACING` pulls in `trace_events.o`. But I'm curious about the relationship with `CONFIG_TRACEPOINTS`. Where does that fit into the picture? Let me see... Aha! In `net/core/skbuff.c`, I see a conditional inclusion: `#ifdef CONFIG_TRACEPOINTS`, and then a `drop_reason_show()` function. That's a good clue. Now, what about the potential integration with `net/core/drop_monitor.c`? Does that have anything to do with tracing? Let's quickly check the `net/core/Makefile` to see if `drop_monitor.o` gets built conditionally.



26/2 2026/09/24 17:13 tool grepper
0m Args:
{
  "Expression": "drop_monitor",
  "PathPrefix": "net/core/Makefile"
}

Results:
{
  "Output": "net/core/Makefile=30=obj-$(CONFIG_TRACEPOINTS) += net-traces.o\nnet/core/Makefile:31:obj-$(CONFIG_NET_DROP_MONITOR) += drop_monitor.o\nnet/core/Makefile-32-obj-$(CONFIG_NET_IEEE8021Q_HELPERS) += ieee8021q_helpers.o\n"
}

27/2 2026/09/24 17:13 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 46578
							output: 29
							thoughts: 37
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Enabling Advanced Network Drop Monitoring**

Right, so `CONFIG_NET_DROP_MONITOR` is the key. That’s what’s going to get us the network drop monitor. Now, before I dive in and start fiddling with kernel configurations, it's worth double-checking that we have the necessary supporting infrastructure in place. My initial thought is to cross-reference with the Kconfig system. Specifically, I'll need to confirm the status of `EVENT_TRACING` – does it, or some compatible tracing mechanism, need to be enabled for `NET_DROP_MONITOR` to function effectively? I'm also thinking there might be some dependencies here, and it's always a good idea to confirm `NET_DROP_MONITOR` itself is defined and ready to go. I wouldn't want to waste time on a feature that hasn't been properly introduced, or that might collide with existing network functions. Making sure those are correctly configured should lead to useful data from the dropped packets.



28/2 2026/09/24 17:13 tool grepper
0m Args:
{
  "Expression": "config EVENT_TRACING",
  "PathPrefix": "kernel/trace/"
}

Results:
{
  "Output": "kernel/trace/Kconfig=144=config RING_BUFFER\n--\nkernel/trace/Kconfig-148-\nkernel/trace/Kconfig:149:config EVENT_TRACING\nkernel/trace/Kconfig-150-\tselect CONTEXT_SWITCH_TRACER\n"
}

29/2 2026/09/24 17:13 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 46956
							output: 34
							thoughts: 29
						

Thoughts:
Okay, let's dive into this. Here's how I'd approach summarizing the Kconfig for `EVENT_TRACING` around line 149 in `kernel/trace/Kconfig`:

**Analyzing the `EVENT_TRACING` Kconfig Entry**

Alright, my focus is now on understanding the `EVENT_TRACING` configuration option within the kernel. I need to zero in on around line 149 of the `kernel/trace/Kconfig` file. I'll be looking for the standard structure here: the `config EVENT_TRACING` declaration, dependencies, default values, help text, and anything else relevant that provides context. I'm especially interested in the implications of enabling or disabling this feature. What are the dependencies? Are there conflicts with other options I should be aware of? What does this enable within the tracing infrastructure? Does it affect the size or performance of the kernel significantly? I'll probably be able to deduce the general function of this config option, and I want to look specifically for any details that affect my area of expertise.



30/2 2026/09/24 17:13 tool read-file
0m Args:
{
  "File": "kernel/trace/Kconfig",
  "FirstLine": 145,
  "LineCount": 30
}

Results:
{
  "Contents": " 145:\t\tbool\n 146:\t\tselect TRACE_CLOCK\n 147:\t\tselect IRQ_WORK\n 148:\t\n 149:\tconfig EVENT_TRACING\n 150:\t\tselect CONTEXT_SWITCH_TRACER\n 151:\t\tselect GLOB\n 152:\t\tbool\n 153:\t\n 154:\tconfig CONTEXT_SWITCH_TRACER\n 155:\t\tbool\n 156:\t\n 157:\tconfig RING_BUFFER_ALLOW_SWAP\n 158:\t\tbool\n 159:\t\thelp\n 160:\t\t Allow the use of ring_buffer_swap_cpu.\n 161:\t\t Adds a very slight overhead to tracing when enabled.\n 162:\t\n 163:\tconfig PREEMPTIRQ_TRACEPOINTS\n 164:\t\tbool\n 165:\t\tdepends on TRACE_PREEMPT_TOGGLE || TRACE_IRQFLAGS\n 166:\t\tselect TRACING\n 167:\t\tdefault y\n 168:\t\thelp\n 169:\t\t  Create preempt/irq toggle tracepoints if needed, so that other parts\n 170:\t\t  of the kernel can use them to generate or add hooks to them.\n 171:\t\n 172:\t# All tracer options should select GENERIC_TRACER. For those options that are\n 173:\t# enabled by all tracers (context switch and event tracer) they select TRACING.\n 174:\t# This allows those options to appear when no other tracer is selected. But the\n"
}

31/2 2026/09/24 17:13 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 47651
							output: 29
							thoughts: 21
						

Thoughts:
Okay, here's my thought process laid out, expert to expert:

**Investigating the Activation of Event Tracing**

Alright, so I need to figure out what's triggering this `EVENT_TRACING` behavior. The question isn't just *if* it's happening, but *what* is making it happen. I need to trace the root cause, so my first move is to identify the selection criteria. What selects this particular event? Is it a specific internal flag, a configuration setting, or perhaps a particular user interaction that toggles it?

Essentially, I need to understand the control flow. Is there a clearly defined user-facing option, maybe a checkbox in a settings menu, that directly enables this functionality? Or am I dealing with something more implicit, triggered by a specific set of circumstances within the application logic? I have to look for that connection between the external manifestation of this behavior, and the internal mechanisms that turn it on. That's my initial area of focus: where does the "switch" get flipped for `EVENT_TRACING`? I will go and find it.



32/2 2026/09/24 17:13 tool grepper
0m Args:
{
  "Expression": "select EVENT_TRACING",
  "PathPrefix": "kernel/trace/"
}

Results:
{
  "Output": "kernel/trace/Kconfig=179=config TRACING\n--\nkernel/trace/Kconfig-185-\tselect BINARY_PRINTF\nkernel/trace/Kconfig:186:\tselect EVENT_TRACING\nkernel/trace/Kconfig-187-\tselect TRACE_CLOCK\n"
}

33/2 2026/09/24 17:13 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 48016
							output: 34
							thoughts: 57
						

Thoughts:
Okay, here's my interpretation of this thought process, keeping in mind my expertise:

**Examining the Kernel Trace Configuration**

Right, so `TRACING` is definitely tied to `EVENT_TRACING`. The obvious next step is to figure out *what* within the user-facing configuration options actually enables `TRACING`, or, for that matter, if the legacy `FTRACE` plays into the picture. Time to dive into `kernel/trace/Kconfig`, specifically lines 170-210. I need to understand the dependencies and interactions of these tracing features at a deeper level. Let's see what the configuration logic reveals.



34/2 2026/09/24 17:13 tool read-file
0m Args:
{
  "File": "kernel/trace/Kconfig",
  "FirstLine": 175,
  "LineCount": 40
}

Results:
{
  "Contents": " 175:\t# options do not appear when something else selects it. We need the two options\n 176:\t# GENERIC_TRACER and TRACING to avoid circular dependencies to accomplish the\n 177:\t# hiding of the automatic options.\n 178:\t\n 179:\tconfig TRACING\n 180:\t\tbool\n 181:\t\tselect RING_BUFFER\n 182:\t\tselect STACKTRACE if STACKTRACE_SUPPORT\n 183:\t\tselect TRACEPOINTS\n 184:\t\tselect NOP_TRACER\n 185:\t\tselect BINARY_PRINTF\n 186:\t\tselect EVENT_TRACING\n 187:\t\tselect TRACE_CLOCK\n 188:\t\tselect NEED_TASKS_RCU\n 189:\t\n 190:\tconfig GENERIC_TRACER\n 191:\t\tbool\n 192:\t\tselect TRACING\n 193:\t\n 194:\t#\n 195:\t# Minimum requirements an architecture has to meet for us to\n 196:\t# be able to offer generic tracing facilities:\n 197:\t#\n 198:\tconfig TRACING_SUPPORT\n 199:\t\tbool\n 200:\t\tdepends on TRACE_IRQFLAGS_SUPPORT\n 201:\t\tdepends on STACKTRACE_SUPPORT\n 202:\t\tdefault y\n 203:\t\n 204:\tmenuconfig FTRACE\n 205:\t\tbool \"Tracers\"\n 206:\t\tdepends on TRACING_SUPPORT\n 207:\t\tdefault y if DEBUG_KERNEL\n 208:\t\thelp\n 209:\t\t  Enable the kernel tracing infrastructure.\n 210:\t\n 211:\tif FTRACE\n 212:\t\n 213:\tconfig TRACEFS_AUTOMOUNT_DEPRECATED\n 214:\t\tbool \"Automount tracefs on debugfs [DEPRECATED]\"\n"
}

35/2 2026/09/24 17:13 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 48746
							output: 36
							thoughts: 42
						

Thoughts:
Okay, let's break this down.

**Investigating Tracer Configuration Options**

Alright, so I need to figure out which configuration options, specifically within the kernel's build system, are responsible for enabling the various tracing features. I need to understand what pulls in the `TRACING` infrastructure, and, more specifically, what causes either the `FTRACE` features or the more generic tracing functionality (`GENERIC_TRACER`) to be included in the build. I'll need to meticulously examine the menuconfig structures and any associated dependencies. I'm going to start with a systematic search to identify what visible options are directly responsible for selecting or activating the `TRACING` or `GENERIC_TRACER` symbols in the kernel. This should help me construct a clearer picture of how tracing is controlled and configured.



36/2 2026/09/24 17:14 tool grepper
0m Args:
{
  "Expression": "select (GENERIC_TRACER|TRACING)",
  "PathPrefix": "kernel/trace/"
}

Results:
{
  "Output": "kernel/trace/Kconfig=163=config PREEMPTIRQ_TRACEPOINTS\n--\nkernel/trace/Kconfig-165-\tdepends on TRACE_PREEMPT_TOGGLE || TRACE_IRQFLAGS\nkernel/trace/Kconfig:166:\tselect TRACING\nkernel/trace/Kconfig-167-\tdefault y\n--\nkernel/trace/Kconfig-171-\nkernel/trace/Kconfig:172:# All tracer options should select GENERIC_TRACER. For those options that are\nkernel/trace/Kconfig:173:# enabled by all tracers (context switch and event tracer) they select TRACING.\nkernel/trace/Kconfig-174-# This allows those options to appear when no other tracer is selected. But the\n--\nkernel/trace/Kconfig=190=config GENERIC_TRACER\nkernel/trace/Kconfig-191-\tbool\nkernel/trace/Kconfig:192:\tselect TRACING\nkernel/trace/Kconfig-193-\n--\nkernel/trace/Kconfig=235=config FUNCTION_TRACER\n--\nkernel/trace/Kconfig-238-\tselect KALLSYMS\nkernel/trace/Kconfig:239:\tselect GENERIC_TRACER\nkernel/trace/Kconfig-240-\tselect CONTEXT_SWITCH_TRACER\n--\nkernel/trace/Kconfig=421=config IRQSOFF_TRACER\n--\nkernel/trace/Kconfig-425-\tselect TRACE_IRQFLAGS\nkernel/trace/Kconfig:426:\tselect GENERIC_TRACER\nkernel/trace/Kconfig-427-\tselect TRACER_MAX_TRACE\n--\nkernel/trace/Kconfig=444=config PREEMPT_TRACER\n--\nkernel/trace/Kconfig-447-\tdepends on PREEMPTION\nkernel/trace/Kconfig:448:\tselect GENERIC_TRACER\nkernel/trace/Kconfig-449-\tselect TRACER_MAX_TRACE\n--\nkernel/trace/Kconfig=467=config SCHED_TRACER\nkernel/trace/Kconfig-468-\tbool \"Scheduling Latency Tracer\"\nkernel/trace/Kconfig:469:\tselect GENERIC_TRACER\nkernel/trace/Kconfig-470-\tselect CONTEXT_SWITCH_TRACER\n--\nkernel/trace/Kconfig=476=config HWLAT_TRACER\nkernel/trace/Kconfig-477-\tbool \"Tracer to detect hardware latencies (like SMIs)\"\nkernel/trace/Kconfig:478:\tselect GENERIC_TRACER\nkernel/trace/Kconfig-479-\tselect TRACER_MAX_TRACE\n--\nkernel/trace/Kconfig=512=config OSNOISE_TRACER\nkernel/trace/Kconfig-513-\tbool \"OS Noise tracer\"\nkernel/trace/Kconfig:514:\tselect GENERIC_TRACER\nkernel/trace/Kconfig-515-\tselect TRACER_MAX_TRACE\n--\nkernel/trace/Kconfig=547=config TIMERLAT_TRACER\n--\nkernel/trace/Kconfig-549-\tselect OSNOISE_TRACER\nkernel/trace/Kconfig:550:\tselect GENERIC_TRACER\nkernel/trace/Kconfig-551-\thelp\n--\nkernel/trace/Kconfig=575=config MMIOTRACE\n--\nkernel/trace/Kconfig-577-\tdepends on HAVE_MMIOTRACE_SUPPORT \u0026\u0026 PCI\nkernel/trace/Kconfig:578:\tselect GENERIC_TRACER\nkernel/trace/Kconfig-579-\thelp\n--\nkernel/trace/Kconfig=588=config ENABLE_DEFAULT_TRACERS\n--\nkernel/trace/Kconfig-590-\tdepends on !GENERIC_TRACER\nkernel/trace/Kconfig:591:\tselect TRACING\nkernel/trace/Kconfig-592-\thelp\n--\nkernel/trace/Kconfig=597=config FTRACE_SYSCALLS\n--\nkernel/trace/Kconfig-599-\tdepends on HAVE_SYSCALL_TRACEPOINTS\nkernel/trace/Kconfig:600:\tselect GENERIC_TRACER\nkernel/trace/Kconfig-601-\tselect KALLSYMS\n--\nkernel/trace/Kconfig=652=config TRACE_BRANCH_PROFILING\nkernel/trace/Kconfig-653-\tbool\nkernel/trace/Kconfig:654:\tselect GENERIC_TRACER\nkernel/trace/Kconfig-655-\n--\nkernel/trace/Kconfig=717=config BRANCH_TRACER\n--\nkernel/trace/Kconfig-719-\tdepends on TRACE_BRANCH_PROFILING\nkernel/trace/Kconfig:720:\tselect TRACING_BRANCHES\nkernel/trace/Kconfig-721-\thelp\n--\nkernel/trace/Kconfig=731=config BLK_DEV_IO_TRACE\n--\nkernel/trace/Kconfig-737-\tselect TRACEPOINTS\nkernel/trace/Kconfig:738:\tselect GENERIC_TRACER\nkernel/trace/Kconfig-739-\tselect STACKTRACE\n--\nkernel/trace/Kconfig=756=config FPROBE_EVENTS\n--\nkernel/trace/Kconfig-759-\tbool \"Enable fprobe-based dynamic events\"\nkernel/trace/Kconfig:760:\tselect TRACING\nkernel/trace/Kconfig-761-\tselect PROBE_EVENTS\n--\nkernel/trace/Kconfig=794=config KPROBE_EVENTS\n--\nkernel/trace/Kconfig-797-\tbool \"Enable kprobes-based dynamic events\"\nkernel/trace/Kconfig:798:\tselect TRACING\nkernel/trace/Kconfig-799-\tselect PROBE_EVENTS\n--\nkernel/trace/Kconfig=833=config UPROBE_EVENTS\n--\nkernel/trace/Kconfig-840-\tselect DYNAMIC_EVENTS\nkernel/trace/Kconfig:841:\tselect TRACING\nkernel/trace/Kconfig-842-\tdefault y\n--\nkernel/trace/Kconfig=924=config SYNTH_EVENTS\nkernel/trace/Kconfig-925-\tbool \"Synthetic trace events\"\nkernel/trace/Kconfig:926:\tselect TRACING\nkernel/trace/Kconfig-927-\tselect DYNAMIC_EVENTS\n--\nkernel/trace/Kconfig=941=config USER_EVENTS\nkernel/trace/Kconfig-942-\tbool \"User trace events\"\nkernel/trace/Kconfig:943:\tselect TRACING\nkernel/trace/Kconfig-944-\tselect DYNAMIC_EVENTS\n--\nkernel/trace/Kconfig=956=config HIST_TRIGGERS\n--\nkernel/trace/Kconfig-958-\tdepends on ARCH_HAVE_NMI_SAFE_CMPXCHG\nkernel/trace/Kconfig:959:\tselect TRACING_MAP\nkernel/trace/Kconfig:960:\tselect TRACING\nkernel/trace/Kconfig-961-\tselect DYNAMIC_EVENTS\n--\nkernel/trace/rv/Kconfig=39=menuconfig RV\nkernel/trace/rv/Kconfig-40-\tbool \"Runtime Verification\"\nkernel/trace/rv/Kconfig:41:\tselect TRACING\nkernel/trace/rv/Kconfig-42-\thelp\n"
}

37/2 2026/09/24 17:14 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 50843
							output: 21
							thoughts: 58
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Kernel Tracing Configuration - A Quick Mental Checklist**

Alright, let's see, I'm thinking about configuring some kernel tracing. First, I'm going to look at the main avenues: `FTRACE`, obviously. I'll need to consider how `ENABLE_DEFAULT_TRACERS` interacts, and whether I need something specific like `FUNCTION_TRACER`, or the more general `TRACING` option. These are the usual suspects for getting a basic trace going.

But hold on, what about `NET_DROP_MONITOR`? That's a different beast, something specific to network packet drops. I should probably double-check its dependencies in the Kconfig file. I'm used to this by now.



38/2 2026/09/24 17:14 tool grepper
0m Args:
{
  "Expression": "config NET_DROP_MONITOR"
}

Results:
{
  "Output": "net/Kconfig=385=config NET_PKTGEN\n--\nnet/Kconfig-399-\nnet/Kconfig:400:config NET_DROP_MONITOR\nnet/Kconfig-401-\ttristate \"Legacy network packet drop alerting service\"\n"
}

39/2 2026/09/24 17:14 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 51175
							output: 32
							thoughts: 17
						

Thoughts:
Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person:

**Navigating the Kconfig Labyrinth**

Alright, so the task at hand requires a deep dive into the kernel configuration system, specifically `net/Kconfig`. My gut tells me that focusing around line 400 is probably a good starting point. That general area usually hosts configuration options for… well, I'd have to see the code to be sure, but it's likely related to either core networking components or perhaps a specific driver or subsystem within the networking stack. Line numbers are a great starting point for navigation, providing a point to get my bearings in the larger context of the file. No point trying to grasp the entire Kconfig in one go. I'll need to look at what's there and begin working on piecing the puzzle together. I'm expecting some conditional dependencies and potentially some tricky interactions, so understanding the scope of that section is crucial before digging deeper into the problem. Let's see what's what.



40/2 2026/09/24 17:14 tool read-file
0m Args:
{
  "File": "net/Kconfig",
  "FirstLine": 400,
  "LineCount": 15
}

Results:
{
  "Contents": " 400:\tconfig NET_DROP_MONITOR\n 401:\t\ttristate \"Legacy network packet drop alerting service\"\n 402:\t\tdepends on INET \u0026\u0026 TRACEPOINTS\n 403:\t\thelp\n 404:\t\t  This feature provides an alerting service to userspace in the\n 405:\t\t  event that packets are discarded in the network stack.  Alerts\n 406:\t\t  are broadcast via netlink socket to any listening user space\n 407:\t\t  process. This feature is NOT related to \"perf\" based drop monitoring.\n 408:\t\t  Say N here unless you need to support older userspace tools like\n 409:\t\t  \"dropwatch\".\n 410:\t\n 411:\tendmenu # Network testing\n 412:\t\n 413:\tendmenu # Networking options\n 414:\t\n"
}

41/2 2026/09/24 17:14 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 51675
							output: 274
							thoughts: 527
						

Thoughts:
**Analyzing the Impact of Recent Kernel Changes**

Okay, let's break this down. My initial concern is to ensure the `NET_DROP_MONITOR` is functioning correctly, and it appears it relies on a few core components: `INET`, `TRACEPOINTS`, and either `EVENT_TRACING`, `TRACING`, or `FTRACE`. The presence of `FTRACE` and `ENABLE_DEFAULT_TRACERS` or just `TRACING` looks promising, so let's confirm those are set.

Specifically, I need to make sure these configs are enabled: `FTRACE`, `ENABLE_DEFAULT_TRACERS`, `NET_DROP_MONITOR`, and of course `TRACEPOINTS` (which should be implicitly enabled by `TRACING`).

Now, let's dig into the meat of the changes. The commit introduces new dynamic symbol lookup and formatting. It's replacing the old static enum printing with a more dynamic approach using `__print_sym`, `TRACE_DEFINE_SYM_FNS`, and `TRACE_DEFINE_SYM_LIST`. This affects how print formats are parsed and presented to userspace, specifically through functions like `show_print_fmt` and `show_sym_list` in `kernel/trace/trace_events.c`. There are also changes related to trace symbol sequence formatting (`trace_print_sym_seq`, `trace_sym_lookup`, `trace_sym_show` in `kernel/trace/trace_output.c`), the integration of module symbol definitions during module loading (`find_module_sections`), and a rework of the skb drop reason lookup within networking (`drop_reason_lookup`, `drop_reason_show`, and `net_dm_packet_report_fill` in `drop_monitor.c`).

These are all important modifications to core subsystems - tracing, networking, and module management. They're accessible through standard interfaces such as tracefs, packet drop netlink alerts, and trace output. This means they are definitely worth investigating from a fuzzing perspective, so the `WorthFuzzing` should be `true`.

I'll keep a close eye on these symbols, as they are the key entrypoints: `show_print_fmt`, `show_sym_list`, `trace_print_sym_seq`, `trace_sym_lookup`, `trace_sym_show`, `drop_reason_lookup`, `drop_reason_show`, and `net_dm_packet_report_fill`.

Finally, based on this analysis, I'm going to set the results, confirming the `WorthFuzzing` value and providing the key symbols and necessary configurations. The `EnableConfigs` are: `FTRACE`, `ENABLE_DEFAULT_TRACERS`, and `NET_DROP_MONITOR`.



42/2 2026/09/24 17:14 tool set-results
0m Args:
{
  "EnableConfigs": [
    "FTRACE",
    "ENABLE_DEFAULT_TRACERS",
    "NET_DROP_MONITOR"
  ],
  "FocusSymbols": [
    "show_print_fmt",
    "show_sym_list",
    "trace_print_sym_seq",
    "trace_sym_lookup",
    "trace_sym_show",
    "drop_reason_lookup",
    "drop_reason_show",
    "net_dm_packet_report_fill"
  ],
  "Reasoning": "The patch introduces a new dynamic symbol lookup and formatting subsystem (__print_sym, TRACE_DEFINE_SYM_FNS, TRACE_DEFINE_SYM_LIST) in ftrace, replacing static symbol mapping for events such as kfree_skb and timer tick_stop. It introduces custom print format parsing in show_print_fmt and show_sym_list when userspace reads event format files from tracefs, dynamic symbol sequence formatting in trace_print_sym_seq, module section handling for ftrace symbols, and skb drop reason resolution helpers in net/core/skbuff.c used by drop_monitor netlink reporting. These changes alter reachable executable logic in core tracing and networking subsystems, warranting fuzzing.",
  "WorthFuzzing": true
}

Results:
{
  "EnableConfigs": [
    "FTRACE",
    "ENABLE_DEFAULT_TRACERS",
    "NET_DROP_MONITOR"
  ],
  "FocusSymbols": [
    "show_print_fmt",
    "show_sym_list",
    "trace_print_sym_seq",
    "trace_sym_lookup",
    "trace_sym_show",
    "drop_reason_lookup",
    "drop_reason_show",
    "net_dm_packet_report_fill"
  ],
  "Reasoning": "The patch introduces a new dynamic symbol lookup and formatting subsystem (__print_sym, TRACE_DEFINE_SYM_FNS, TRACE_DEFINE_SYM_LIST) in ftrace, replacing static symbol mapping for events such as kfree_skb and timer tick_stop. It introduces custom print format parsing in show_print_fmt and show_sym_list when userspace reads event format files from tracefs, dynamic symbol sequence formatting in trace_print_sym_seq, module section handling for ftrace symbols, and skb drop reason resolution helpers in net/core/skbuff.c used by drop_monitor netlink reporting. These changes alter reachable executable logic in core tracing and networking subsystems, warranting fuzzing.",
  "WorthFuzzing": true
}

43/1 2026/09/24 17:14 action If
24m Args:
{
  "WorthFuzzing": true
}

Results:
null

44/2 2026/09/24 17:14 agent kmsan-evaluator
24m Model:
core

Args:
null

Results:
{
  "KMSANReasoning": "The patch refactors ftrace symbol resolution and printing (__print_sym) for tracepoints, notably skb drop reasons and timer tick dependencies. It introduces compile-time generated symbol definition tables (struct trace_sym_def and struct trace_sym_entry), adds lookup/show helpers (drop_reason_lookup, drop_reason_show, trace_print_sym_seq), and replaces inline symbolic strings in print_fmt with a parser (show_print_fmt) that generates them on demand for userspace seq_file reads.\n\nKMSAN is not needed here because:\n1. No uninitialized memory is allocated or read: all newly introduced symbol structures are static and initialized at compile time via macros, and all lookup functions operate on integers passed by value and return pointers to static constant string literals.\n2. The netlink attribute formatting in net_dm_packet_report_fill passes static string literals to nla_put_string, without copying uninitialized struct padding or fields to userspace.\n3. Any potential bugs in this patch involve pointer arithmetic and string traversal (e.g. parsing call-\u003eprint_fmt in show_print_fmt or iterating sym_defs array), out-of-bounds reads, or RCU locking semantics (e.g. drop_reasons_by_subsys dereferencing). These classes of bugs are thoroughly covered by standard KASAN and LOCKDEP / PROVE_RCU detectors.\n\nHence, 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 17080a6ac7f5b2b473c2114f50bbff927278e9a6
Author: syz-cluster <triage@syzkaller.com>
Date:   Thu Sep 24 17:03:19 2026 +0000

    syz-cluster: applied patch under review

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index b2988aa12f664..632eafd0f496a 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -275,9 +275,12 @@
 #define FTRACE_EVENTS()							\
 	. = ALIGN(8);							\
 	BOUNDED_SECTION(_ftrace_events)					\
+	. = ALIGN(8);							\
 	BOUNDED_SECTION_BY(_ftrace_eval_map, _ftrace_eval_maps)
+#define FTRACE_SYM_DEFS()	BOUNDED_SECTION(_ftrace_sym_defs)
 #else
 #define FTRACE_EVENTS()
+#define FTRACE_SYM_DEFS()
 #endif
 
 #ifdef CONFIG_TRACING
@@ -391,6 +394,7 @@
 	TRACE_PRINTKS()							\
 	BPF_RAW_TP()							\
 	TRACEPOINT_STR()						\
+	FTRACE_SYM_DEFS()						\
 	KUNIT_TABLE()
 
 /*
diff --git a/include/linux/module.h b/include/linux/module.h
index 96cc98568eea5..a02833ac421bd 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -516,6 +516,8 @@ struct module {
 	unsigned int num_trace_events;
 	struct trace_eval_map **trace_evals;
 	unsigned int num_trace_evals;
+	struct trace_sym_def **trace_sym_defs;
+	unsigned int num_trace_sym_defs;
 #endif
 #ifdef CONFIG_DYNAMIC_FTRACE
 	unsigned int num_ftrace_callsites;
diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
index 5cbd09c8be8d5..80c34ef89feb1 100644
--- a/include/linux/trace_events.h
+++ b/include/linux/trace_events.h
@@ -29,6 +29,13 @@ const char *trace_print_symbols_seq(struct trace_seq *p, unsigned long val,
 				    const struct trace_print_flags *symbol_array,
 				    size_t symbol_array_size);
 
+const char *trace_print_sym_seq(struct trace_seq *p, unsigned long long val,
+				const char *(*lookup)(unsigned long long val));
+const char *trace_sym_lookup(const struct trace_sym_entry *list,
+			     size_t len, unsigned long long value);
+void trace_sym_show(struct seq_file *m,
+		    const struct trace_sym_entry *list, size_t len);
+
 #if BITS_PER_LONG == 32
 const char *trace_print_flags_seq_u64(struct trace_seq *p, const char *delim,
 		      unsigned long long flags,
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index e0d838c9ce938..05c45a72756c3 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -32,6 +32,24 @@ struct trace_eval_map {
 	unsigned long		eval_value;
 };
 
+struct trace_sym_def {
+	const char		*system;
+	const char		*symbol_id;
+	/* may return NULL, called under rcu_read_lock() */
+	const char *		(*lookup)(unsigned long long);
+	/*
+	 * Must print the list: ', { val, "name"}, ...'
+	 * with no trailing comma, but with the leading ', '
+	 * to simplify things:
+	 */
+	void 			(*show)(struct seq_file *);
+};
+
+struct trace_sym_entry {
+	unsigned long long	value;
+	const char		*name;
+};
+
 #define TRACEPOINT_DEFAULT_PRIO	10
 
 extern int
@@ -163,6 +181,8 @@ extern void syscall_unregfunc(void);
 
 #define TRACE_DEFINE_ENUM(x)
 #define TRACE_DEFINE_SIZEOF(x)
+#define TRACE_DEFINE_SYM_FNS(...)
+#define TRACE_DEFINE_SYM_LIST(...)
 
 #ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS
 static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
diff --git a/include/net/dropreason.h b/include/net/dropreason.h
index 1df60645fb278..537428c726424 100644
--- a/include/net/dropreason.h
+++ b/include/net/dropreason.h
@@ -38,9 +38,11 @@ struct drop_reason_list {
 	size_t n_reasons;
 };
 
-/* Note: due to dynamic registrations, access must be under RCU */
-extern const struct drop_reason_list __rcu *
-drop_reasons_by_subsys[SKB_DROP_REASON_SUBSYS_NUM];
+const char *drop_reason_lookup(unsigned long long value);
+
+#ifdef CONFIG_TRACEPOINTS
+void drop_reason_show(struct seq_file *m);
+#endif
 
 void drop_reasons_register_subsys(enum skb_drop_reason_subsys subsys,
 				  const struct drop_reason_list *list);
diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h
index 2945aa7fe9a7d..991bf172a6ea1 100644
--- a/include/trace/events/skb.h
+++ b/include/trace/events/skb.h
@@ -8,15 +8,9 @@
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
 #include <linux/tracepoint.h>
+#include <net/dropreason.h>
 
-#undef FN
-#define FN(reason)	TRACE_DEFINE_ENUM(SKB_DROP_REASON_##reason);
-DEFINE_DROP_REASON(FN, FN)
-
-#undef FN
-#undef FNe
-#define FN(reason)	{ SKB_DROP_REASON_##reason, #reason },
-#define FNe(reason)	{ SKB_DROP_REASON_##reason, #reason }
+TRACE_DEFINE_SYM_FNS(drop_reason, drop_reason_lookup, drop_reason_show);
 
 /*
  * Tracepoint for free an sk_buff:
@@ -47,8 +41,7 @@ TRACE_EVENT(kfree_skb,
 	TP_printk("skbaddr=%p rx_sk=%p protocol=%u location=%pS reason: %s",
 		  __entry->skbaddr, __entry->rx_sk, __entry->protocol,
 		  __entry->location,
-		  __print_symbolic(__entry->reason,
-				   DEFINE_DROP_REASON(FN, FNe)))
+		  __print_sym(__entry->reason, drop_reason))
 );
 
 #undef FN
diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h
index 3aa0608c63611..d45259d960695 100644
--- a/include/trace/events/timer.h
+++ b/include/trace/events/timer.h
@@ -441,26 +441,18 @@ TRACE_EVENT(itimer_expire,
 #undef tick_dep_mask_name
 #undef tick_dep_name_end
 
-/* The MASK will convert to their bits and they need to be processed too */
-#define tick_dep_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \
-	TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
-#define tick_dep_name_end(sdep)  TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \
-	TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
-/* NONE only has a mask defined for it */
-#define tick_dep_mask_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
+#define tick_dep_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
+#define tick_dep_mask_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
+#define tick_dep_name_end(sdep) { TICK_DEP_MASK_##sdep, #sdep }
 
-TICK_DEP_NAMES
+TRACE_DEFINE_SYM_LIST(tick_dep_names, TICK_DEP_NAMES);
 
 #undef tick_dep_name
 #undef tick_dep_mask_name
 #undef tick_dep_name_end
 
-#define tick_dep_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
-#define tick_dep_mask_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
-#define tick_dep_name_end(sdep) { TICK_DEP_MASK_##sdep, #sdep }
-
 #define show_tick_dep_name(val)				\
-	__print_symbolic(val, TICK_DEP_NAMES)
+	__print_sym(val, tick_dep_names)
 
 TRACE_EVENT(tick_stop,
 
diff --git a/include/trace/stages/init.h b/include/trace/stages/init.h
index 000bcfc8dd2e7..6285a03a52b2d 100644
--- a/include/trace/stages/init.h
+++ b/include/trace/stages/init.h
@@ -23,6 +23,61 @@ TRACE_MAKE_SYSTEM_STR();
 	__section("_ftrace_eval_map")			\
 	*TRACE_SYSTEM##_##a = &__##TRACE_SYSTEM##_##a
 
+/*
+ * Define a symbol for __print_sym by giving lookup and
+ * show functions. See &struct trace_sym_def.
+ */
+#undef TRACE_DEFINE_SYM_FNS
+#define TRACE_DEFINE_SYM_FNS(_symbol_id, _lookup, _show)		\
+	_TRACE_DEFINE_SYM_FNS(TRACE_SYSTEM, _symbol_id, _lookup, _show)
+#define _TRACE_DEFINE_SYM_FNS(_system, _symbol_id, _lookup, _show)	\
+	__TRACE_DEFINE_SYM_FNS(_system, _symbol_id, _lookup, _show)
+#define __TRACE_DEFINE_SYM_FNS(_system, _symbol_id, _lookup, _show)	\
+	___TRACE_DEFINE_SYM_FNS(_system ## _ ## _symbol_id, _symbol_id,	\
+				_lookup, _show)
+#define ___TRACE_DEFINE_SYM_FNS(_name, _symbol_id, _lookup, _show)	\
+	static struct trace_sym_def					\
+	__trace_sym_def_ ## _name = {					\
+		.system = TRACE_SYSTEM_STRING,				\
+		.symbol_id = #_symbol_id,				\
+		.lookup = _lookup,					\
+		.show = _show,						\
+	};								\
+	static struct trace_sym_def __used				\
+	__section("_ftrace_sym_defs")					\
+	*__trace_sym_def_p_ ## _name = &__trace_sym_def_ ## _name
+
+/*
+ * Define a symbol for __print_sym by giving lookup and
+ * show functions. See &struct trace_sym_def.
+ */
+#undef TRACE_DEFINE_SYM_LIST
+#define TRACE_DEFINE_SYM_LIST(_symbol_id, ...)				\
+	_TRACE_DEFINE_SYM_LIST(TRACE_SYSTEM, _symbol_id, __VA_ARGS__)
+#define _TRACE_DEFINE_SYM_LIST(_system, _symbol_id, ...)		\
+	__TRACE_DEFINE_SYM_LIST(_system, _symbol_id, __VA_ARGS__)
+#define __TRACE_DEFINE_SYM_LIST(_system, _symbol_id, ...)		\
+	___TRACE_DEFINE_SYM_LIST(_system ## _ ## _symbol_id, _symbol_id,\
+				 __VA_ARGS__)
+#define ___TRACE_DEFINE_SYM_LIST(_name, _symbol_id, ...)		\
+	static struct trace_sym_entry					\
+	__trace_sym_list_ ## _name[] = { __VA_ARGS__ };			\
+	static const char *						\
+	__trace_sym_lookup_ ## _name(unsigned long long value)		\
+	{								\
+		return trace_sym_lookup(__trace_sym_list_ ## _name,	\
+			ARRAY_SIZE(__trace_sym_list_ ## _name), value);	\
+	}								\
+	static void							\
+	__trace_sym_show_ ## _name(struct seq_file *m)			\
+	{								\
+		trace_sym_show(m, __trace_sym_list_ ## _name,		\
+			       ARRAY_SIZE(__trace_sym_list_ ## _name));	\
+	}								\
+	___TRACE_DEFINE_SYM_FNS(_name, _symbol_id,			\
+				__trace_sym_lookup_ ## _name,		\
+				__trace_sym_show_ ## _name)
+
 #undef TRACE_DEFINE_SIZEOF
 #define TRACE_DEFINE_SIZEOF(a)				\
 	static struct trace_eval_map __used __initdata	\
diff --git a/include/trace/stages/stage2_data_offsets.h b/include/trace/stages/stage2_data_offsets.h
index 8b0cff06d3463..5afd9de7deb3b 100644
--- a/include/trace/stages/stage2_data_offsets.h
+++ b/include/trace/stages/stage2_data_offsets.h
@@ -5,6 +5,12 @@
 #undef TRACE_DEFINE_ENUM
 #define TRACE_DEFINE_ENUM(a)
 
+#undef TRACE_DEFINE_SYM_FNS
+#define TRACE_DEFINE_SYM_FNS(_symbol_id, _lookup, _show)
+
+#undef TRACE_DEFINE_SYM_LIST
+#define TRACE_DEFINE_SYM_LIST(_symbol_id, ...)
+
 #undef TRACE_DEFINE_SIZEOF
 #define TRACE_DEFINE_SIZEOF(a)
 
diff --git a/include/trace/stages/stage3_trace_output.h b/include/trace/stages/stage3_trace_output.h
index 181b813357812..09304259a8c1d 100644
--- a/include/trace/stages/stage3_trace_output.h
+++ b/include/trace/stages/stage3_trace_output.h
@@ -79,6 +79,15 @@
 		trace_print_symbols_seq(p, value, symbols, ARRAY_SIZE(symbols));	\
 	})
 
+#undef __print_sym
+#define __print_sym(value, symbol_id)					\
+	___print_sym(TRACE_SYSTEM, value, symbol_id)
+#define ___print_sym(sys, value, symbol_id)				\
+	____print_sym(sys, value, symbol_id)
+#define ____print_sym(sys, value, symbol_id)				\
+	trace_print_sym_seq(p, value,					\
+		__trace_sym_def_p_ ## sys ## _ ## symbol_id->lookup)
+
 #undef __print_flags_u64
 #undef __print_symbolic_u64
 #if BITS_PER_LONG == 32
diff --git a/include/trace/stages/stage7_class_define.h b/include/trace/stages/stage7_class_define.h
index 47008897a7956..936b9fa08ceaf 100644
--- a/include/trace/stages/stage7_class_define.h
+++ b/include/trace/stages/stage7_class_define.h
@@ -45,6 +45,9 @@
 #define __event_in_softirq()	(REC->common_flags & 0x10)
 #define __event_in_irq()	(REC->common_flags & 0x18)
 
+#undef __print_sym
+#define __print_sym(value, symbol_id)	__print_sym(value:symbol_id)
+
 /*
  * The below is not executed in the kernel. It is only what is
  * displayed in the print format for userspace to parse.
diff --git a/kernel/module/main.c b/kernel/module/main.c
index d0e1e0bd2ad06..8ab386a373768 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -2735,6 +2735,9 @@ static int find_module_sections(struct module *mod, struct load_info *info)
 	mod->trace_evals = section_objs(info, "_ftrace_eval_map",
 					sizeof(*mod->trace_evals),
 					&mod->num_trace_evals);
+	mod->trace_sym_defs = section_objs(info, "_ftrace_sym_defs",
+					   sizeof(*mod->trace_sym_defs),
+					   &mod->num_trace_sym_defs);
 #endif
 #ifdef CONFIG_TRACING
 	mod->trace_bprintk_fmt_start = section_objs(info, "__trace_printk_fmt",
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 30c0ddf90887f..53849baae2916 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -2111,6 +2111,102 @@ static void *f_next(struct seq_file *m, void *v, loff_t *pos)
 		return node;
 }
 
+extern struct trace_sym_def *__start_ftrace_sym_defs[];
+extern struct trace_sym_def *__stop_ftrace_sym_defs[];
+
+/* note: @name is not NUL-terminated */
+static void show_sym_list(struct seq_file *m, struct trace_event_call *call,
+			  const char *name, unsigned int name_len)
+{
+	struct trace_sym_def **sym_defs;
+	unsigned int n_sym_defs, i;
+
+	if ((call->flags & TRACE_EVENT_FL_DYNAMIC) || !call->module) {
+		sym_defs = __start_ftrace_sym_defs;
+		n_sym_defs = __stop_ftrace_sym_defs - __start_ftrace_sym_defs;
+	} else {
+#ifdef CONFIG_MODULES
+		struct module *mod = call->module;
+
+		sym_defs = mod->trace_sym_defs;
+		n_sym_defs = mod->num_trace_sym_defs;
+#else
+		return;
+#endif /* CONFIG_MODULES */
+	}
+
+	for (i = 0; i < n_sym_defs; i++) {
+		unsigned int sym_len;
+
+		if (!sym_defs[i])
+			continue;
+		if (sym_defs[i]->system != call->class->system)
+			continue;
+		sym_len = strlen(sym_defs[i]->symbol_id);
+		if (name_len != sym_len)
+			continue;
+		if (strncmp(sym_defs[i]->symbol_id, name, sym_len))
+			continue;
+		if (sym_defs[i]->show)
+			sym_defs[i]->show(m);
+		break;
+	}
+}
+
+static void show_print_fmt(struct seq_file *m, struct trace_event_call *call)
+{
+	char *ptr = call->print_fmt;
+	bool in_print_sym = false;
+	int quote = 0;
+
+	seq_puts(m, "\nprint fmt: ");
+	while (*ptr) {
+		if (*ptr == '\\') {
+			seq_putc(m, *ptr);
+			ptr++;
+			/* paranoid */
+			if (!*ptr)
+				break;
+			goto next;
+		}
+		if (*ptr == '"') {
+			quote ^= 1;
+			goto next;
+		}
+		if (quote)
+			goto next;
+
+		if (in_print_sym && *ptr != ':')
+			goto next;
+
+		if (in_print_sym && *ptr == ':') {
+			const char *name;
+
+			ptr++;
+			name = ptr;
+			/* skip the name */
+			while (*ptr && *ptr != ')')
+				ptr++;
+			/* and show the actual list inline now */
+			show_sym_list(m, call, name, ptr - name);
+			in_print_sym = false;
+			continue;
+		}
+
+		if (strncmp(ptr, "__print_sym(", 12) == 0) {
+			ptr += 12;
+			seq_puts(m, "__print_symbolic(");
+			in_print_sym = true;
+			continue;
+		}
+next:
+		seq_putc(m, *ptr);
+		ptr++;
+	}
+
+	seq_putc(m, '\n');
+}
+
 static int f_show(struct seq_file *m, void *v)
 {
 	struct trace_event_file *file = event_file_data(m->private);
@@ -2130,8 +2226,7 @@ static int f_show(struct seq_file *m, void *v)
 		return 0;
 
 	case FORMAT_PRINTFMT:
-		seq_printf(m, "\nprint fmt: %s\n",
-			   call->print_fmt);
+		show_print_fmt(m, call);
 		return 0;
 	}
 
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index a5ad76175d10d..0850b3ad57075 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -131,6 +131,51 @@ trace_print_symbols_seq(struct trace_seq *p, unsigned long val,
 }
 EXPORT_SYMBOL(trace_print_symbols_seq);
 
+const char *trace_sym_lookup(const struct trace_sym_entry *list,
+			     size_t len, unsigned long long value)
+{
+	size_t i;
+
+	for (i = 0; i < len; i++) {
+		if (list[i].value == value)
+			return list[i].name;
+	}
+	return NULL;
+}
+EXPORT_SYMBOL(trace_sym_lookup);
+
+void trace_sym_show(struct seq_file *m,
+		    const struct trace_sym_entry *list, size_t len)
+{
+	size_t i;
+
+	for (i = 0; i < len; i++)
+		seq_printf(m, ", { %lld, \"%s\" }",
+			   list[i].value, list[i].name);
+}
+EXPORT_SYMBOL(trace_sym_show);
+
+const char *
+trace_print_sym_seq(struct trace_seq *p, unsigned long long val,
+		    const char *(*lookup)(unsigned long long val))
+{
+	const char *ret = trace_seq_buffer_ptr(p);
+	const char *name;
+
+	rcu_read_lock();
+	name = lookup(val);
+	if (name)
+		trace_seq_puts(p, name);
+	else
+		trace_seq_printf(p, "0x%llx", val);
+	rcu_read_unlock();
+
+	trace_seq_putc(p, 0);
+
+	return ret;
+}
+EXPORT_SYMBOL(trace_print_sym_seq);
+
 #if BITS_PER_LONG == 32
 const char *
 trace_print_flags_seq_u64(struct trace_seq *p, const char *delim,
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index edc660778408e..5aa7692c5df27 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -611,9 +611,8 @@ static int net_dm_packet_report_fill(struct sk_buff *msg, struct sk_buff *skb,
 				     size_t payload_len)
 {
 	struct net_dm_skb_cb *cb = NET_DM_SKB_CB(skb);
-	const struct drop_reason_list *list = NULL;
-	unsigned int subsys, subsys_reason;
 	char buf[NET_DM_MAX_SYMBOL_LEN];
+	const char *reason_str;
 	struct nlattr *attr;
 	void *hdr;
 	int rc;
@@ -631,19 +630,10 @@ static int net_dm_packet_report_fill(struct sk_buff *msg, struct sk_buff *skb,
 		goto nla_put_failure;
 
 	rcu_read_lock();
-	subsys = u32_get_bits(cb->reason, SKB_DROP_REASON_SUBSYS_MASK);
-	if (subsys < SKB_DROP_REASON_SUBSYS_NUM)
-		list = rcu_dereference(drop_reasons_by_subsys[subsys]);
-	subsys_reason = cb->reason & ~SKB_DROP_REASON_SUBSYS_MASK;
-	if (!list ||
-	    subsys_reason >= list->n_reasons ||
-	    !list->reasons[subsys_reason] ||
-	    strlen(list->reasons[subsys_reason]) > NET_DM_MAX_REASON_LEN) {
-		list = rcu_dereference(drop_reasons_by_subsys[SKB_DROP_REASON_SUBSYS_CORE]);
-		subsys_reason = SKB_DROP_REASON_NOT_SPECIFIED;
-	}
-	if (nla_put_string(msg, NET_DM_ATTR_REASON,
-			   list->reasons[subsys_reason])) {
+	reason_str = drop_reason_lookup(cb->reason);
+	if (unlikely(!reason_str))
+		reason_str = drop_reason_lookup(SKB_DROP_REASON_NOT_SPECIFIED);
+	if (nla_put_string(msg, NET_DM_ATTR_REASON, reason_str)) {
 		rcu_read_unlock();
 		goto nla_put_failure;
 	}
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index dbbe10277d51d..c675d33309374 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -148,11 +148,54 @@ static const struct drop_reason_list drop_reasons_core = {
 	.n_reasons = ARRAY_SIZE(drop_reasons),
 };
 
-const struct drop_reason_list __rcu *
+static const struct drop_reason_list __rcu *
 drop_reasons_by_subsys[SKB_DROP_REASON_SUBSYS_NUM] = {
 	[SKB_DROP_REASON_SUBSYS_CORE] = RCU_INITIALIZER(&drop_reasons_core),
 };
-EXPORT_SYMBOL(drop_reasons_by_subsys);
+
+const char *drop_reason_lookup(unsigned long long value)
+{
+	unsigned long long subsys_id = value >> SKB_DROP_REASON_SUBSYS_SHIFT;
+	u32 reason = value & ~SKB_DROP_REASON_SUBSYS_MASK;
+	const struct drop_reason_list *subsys;
+
+	if (subsys_id >= SKB_DROP_REASON_SUBSYS_NUM)
+		return NULL;
+
+	subsys = rcu_dereference(drop_reasons_by_subsys[subsys_id]);
+	if (!subsys)
+		return NULL;
+	if (reason >= subsys->n_reasons)
+		return NULL;
+	return subsys->reasons[reason];
+}
+EXPORT_SYMBOL(drop_reason_lookup);
+
+#ifdef CONFIG_TRACEPOINTS
+void drop_reason_show(struct seq_file *m)
+{
+	u32 subsys_id;
+
+	rcu_read_lock();
+	for (subsys_id = 0; subsys_id < SKB_DROP_REASON_SUBSYS_NUM; subsys_id++) {
+		const struct drop_reason_list *subsys;
+		u32 i;
+
+		subsys = rcu_dereference(drop_reasons_by_subsys[subsys_id]);
+		if (!subsys)
+			continue;
+
+		for (i = 0; i < subsys->n_reasons; i++) {
+			if (!subsys->reasons[i])
+				continue;
+			seq_printf(m, ", { %u, \"%s\" }",
+				   (subsys_id << SKB_DROP_REASON_SUBSYS_SHIFT) | i,
+				   subsys->reasons[i]);
+		}
+	}
+	rcu_read_unlock();
+}
+#endif
 
 /**
  * drop_reasons_register_subsys - register another drop reason subsystem
diff --git a/tools/testing/selftests/net/openvswitch/openvswitch.sh b/tools/testing/selftests/net/openvswitch/openvswitch.sh
index a31f7fb6882dc..9b8edfcd2d1a8 100755
--- a/tools/testing/selftests/net/openvswitch/openvswitch.sh
+++ b/tools/testing/selftests/net/openvswitch/openvswitch.sh
@@ -234,7 +234,7 @@ ovs_drop_reason_count()
 	local reason=$1
 
 	local perf_output=`perf script -i ${ovs_dir}/perf.data -F trace:event,trace`
-	local pattern="skb:kfree_skb:.*reason: $reason"
+	local pattern="skb:kfree_skb:.*reason: $reason$"
 
 	return `echo "$perf_output" | grep "$pattern" | wc -l`
 }
@@ -790,15 +790,6 @@ test_psample() {
 # - drop packets and verify the right drop reason is reported
 test_drop_reason() {
 	which perf >/dev/null 2>&1 || return $ksft_skip
-	which pahole >/dev/null 2>&1 || return $ksft_skip
-
-	ovs_drop_subsys=$(pahole -C skb_drop_reason_subsys |
-			      awk '/OPENVSWITCH/ { print $3; }' |
-			      tr -d ,)
-	if [ -z "$ovs_drop_subsys" ]; then
-		info "failed to get OVS drop subsys ID"
-		return $ksft_skip
-	fi
 
 	sbx_add "test_drop_reason" || return $?
 
@@ -842,7 +833,7 @@ test_drop_reason() {
 		"in_port(2),eth(),eth_type(0x0800),ipv4(src=172.31.110.20,proto=1),icmp()" 'drop'
 
 	ovs_drop_record_and_run "test_drop_reason" ip netns exec client ping -c 2 172.31.110.20
-	ovs_drop_reason_count 0x${ovs_drop_subsys}0001 # OVS_DROP_FLOW_ACTION
+	ovs_drop_reason_count OVS_DROP_LAST_ACTION
 	if [[ "$?" -ne "2" ]]; then
 		info "Did not detect expected drops: $?"
 		return 1
@@ -859,7 +850,7 @@ test_drop_reason() {
 
 	ovs_drop_record_and_run \
             "test_drop_reason" ip netns exec client nc -i 1 -zuv 172.31.110.20 6000
-	ovs_drop_reason_count 0x${ovs_drop_subsys}0004 # OVS_DROP_EXPLICIT_ACTION_ERROR
+	ovs_drop_reason_count OVS_DROP_EXPLICIT_WITH_ERROR
 	if [[ "$?" -ne "1" ]]; then
 		info "Did not detect expected explicit error drops: $?"
 		return 1
@@ -867,7 +858,7 @@ test_drop_reason() {
 
 	ovs_drop_record_and_run \
             "test_drop_reason" ip netns exec client nc -i 1 -zuv 172.31.110.20 7000
-	ovs_drop_reason_count 0x${ovs_drop_subsys}0003 # OVS_DROP_EXPLICIT_ACTION
+	ovs_drop_reason_count OVS_DROP_EXPLICIT
 	if [[ "$?" -ne "1" ]]; then
 		info "Did not detect expected explicit drops: $?"
 		return 1

45/3 2026/09/24 17:14 llm kmsan-evaluator
23m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 10742
							output: 23
							thoughts: 3958
						

Thoughts:
**KMSAN Evaluation of Kernel Patch Series**

Okay, let's break this down. The primary goal here is to determine if this patch series warrants a dedicated KMSAN fuzzing session, as opposed to relying solely on KASAN. We need to focus on potential uninitialized memory reads or information leaks that KMSAN excels at catching.

The core of this patch seems to introduce a symbol lookup mechanism for tracing, which primarily involves adding data structures and functions to manage symbolic representations of values in trace events. It replaces direct dereferencing of tables with lookup functions, specifically for things like drop reasons in networking code and timer dependencies.

Key areas to scrutinize for KMSAN-related issues:

1.  **`drop_reason_lookup`:** This function is now the central point for retrieving human-readable strings associated with packet drop reasons. It involves looking up values within a `drop_reasons_by_subsys` table. The old version read from this table directly, and now it calls `drop_reason_lookup`. The key thing to check is that these drop reason strings are either statically defined, or that they return the same values as before, and that this code doesn't read any uninitialized memory. This is especially true because we see it being used in `net_dm_packet_report_fill`, where netlink messages are created. *Upon inspection* the lookup function and the `nla_put_string` function, we see that the string returned in a netlink message (`reason_str`) is a string literal, such as `"NOT_SPECIFIED"` or strings defined in kernel subsystems.
2.  **`show_sym_list` and `show_print_fmt`:** These functions seem to be involved in formatting and displaying trace event output. The code dynamically parses `print_fmt`, pulling out symbol names. This code is reading a string. However, since the string being parsed is controlled and null-terminated, there is no risk of buffer overflows.
3.  **`trace_print_sym_seq`:** Takes a value and a lookup function. It uses the `lookup` function to translate the value to a string. `lookup()` is safe. `val` is passed by value.
4.  **`trace_sym_lookup`:** This looks up values in a static array.
5.  **`TRACE_DEFINE_SYM_LIST` and related macros:** These are used to create static arrays that contain symbol information and their string representations. This means we're dealing with initialized data. The relevant portion of the patch expands this into static arrays with initialized entries.

The main concern is that the new tracing mechanism involves looking up values (e.g., in the drop reason code) from lookups, which must have initialized entries, and that these entries are used to print data to the user. From careful inspection, it does not.

Conclusion: Based on this review, I don't see any obvious vulnerabilities introduced by this patch series that would warrant a dedicated KMSAN fuzzing session. The code is carefully checking bounds, the relevant structures seem to be initialized properly, and the values exposed to user space (via netlink, in the case of the drop reason) are consistently derived from string literals. While a full fuzzing campaign is always a good idea, KASAN should be sufficient to catch any issues stemming from out-of-bounds accesses or use-after-free conditions.



46/3 2026/09/24 17:37 tool grepper
0m Args:
{
  "Expression": "drop_reasons_register_subsys"
}

Results:
{
  "Output": "include/net/dropreason.h=44=void drop_reason_show(struct seq_file *m);\n--\ninclude/net/dropreason.h-46-\ninclude/net/dropreason.h:47:void drop_reasons_register_subsys(enum skb_drop_reason_subsys subsys,\ninclude/net/dropreason.h-48-\t\t\t\t  const struct drop_reason_list *list);\n--\nnet/core/skbuff.c=175=void drop_reason_show(struct seq_file *m)\n--\nnet/core/skbuff.c-200-/**\nnet/core/skbuff.c:201: * drop_reasons_register_subsys - register another drop reason subsystem\nnet/core/skbuff.c-202- * @subsys: the subsystem to register, must not be the core\n--\nnet/core/skbuff.c-205- */\nnet/core/skbuff.c:206:void drop_reasons_register_subsys(enum skb_drop_reason_subsys subsys,\nnet/core/skbuff.c-207-\t\t\t\t  const struct drop_reason_list *list)\n--\nnet/core/skbuff.c-216-}\nnet/core/skbuff.c:217:EXPORT_SYMBOL_GPL(drop_reasons_register_subsys);\nnet/core/skbuff.c-218-\n--\nnet/mac80211/main.c=1795=static int __init ieee80211_init(void)\n--\nnet/mac80211/main.c-1811-\nnet/mac80211/main.c:1812:\tdrop_reasons_register_subsys(SKB_DROP_REASON_SUBSYS_MAC80211_UNUSABLE,\nnet/mac80211/main.c-1813-\t\t\t\t     \u0026drop_reason_list_unusable);\n--\nnet/openvswitch/datapath.c=2830=static int __init dp_init(void)\n--\nnet/openvswitch/datapath.c-2870-\nnet/openvswitch/datapath.c:2871:\tdrop_reasons_register_subsys(SKB_DROP_REASON_SUBSYS_OPENVSWITCH,\nnet/openvswitch/datapath.c-2872-\t\t\t\t     \u0026drop_reason_list_ovs);\n"
}

47/3 2026/09/24 17:37 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 16067
							output: 36
							thoughts: 117
						

Thoughts:
**Examining Module Symbol Loading**

Okay, so I'm diving into the module loading process, specifically focusing on how trace symbols are handled. My initial point of reference is `kernel/module/main.c`, line 2735. Let's start by scrutinizing the `mod->trace_sym_defs` assignment. I want to understand exactly how `section_objs` is used to populate this field. I'm keen to trace its behavior and compare it to how other related fields, like `trace_evals`, are loaded. I need to get a clear picture of the whole symbol loading lifecycle, paying particularly close attention to how trace-related symbols are managed.



48/3 2026/09/24 17:37 tool read-file
0m Args:
{
  "File": "kernel/module/main.c",
  "FirstLine": 2725,
  "LineCount": 30
}

Results:
{
  "Contents": "2725:\t#endif\n2726:\t#ifdef CONFIG_JUMP_LABEL\n2727:\t\tmod-\u003ejump_entries = section_objs(info, \"__jump_table\",\n2728:\t\t\t\t\t\tsizeof(*mod-\u003ejump_entries),\n2729:\t\t\t\t\t\t\u0026mod-\u003enum_jump_entries);\n2730:\t#endif\n2731:\t#ifdef CONFIG_EVENT_TRACING\n2732:\t\tmod-\u003etrace_events = section_objs(info, \"_ftrace_events\",\n2733:\t\t\t\t\t\t sizeof(*mod-\u003etrace_events),\n2734:\t\t\t\t\t\t \u0026mod-\u003enum_trace_events);\n2735:\t\tmod-\u003etrace_evals = section_objs(info, \"_ftrace_eval_map\",\n2736:\t\t\t\t\t\tsizeof(*mod-\u003etrace_evals),\n2737:\t\t\t\t\t\t\u0026mod-\u003enum_trace_evals);\n2738:\t\tmod-\u003etrace_sym_defs = section_objs(info, \"_ftrace_sym_defs\",\n2739:\t\t\t\t\t\t   sizeof(*mod-\u003etrace_sym_defs),\n2740:\t\t\t\t\t\t   \u0026mod-\u003enum_trace_sym_defs);\n2741:\t#endif\n2742:\t#ifdef CONFIG_TRACING\n2743:\t\tmod-\u003etrace_bprintk_fmt_start = section_objs(info, \"__trace_printk_fmt\",\n2744:\t\t\t\t\t\t sizeof(*mod-\u003etrace_bprintk_fmt_start),\n2745:\t\t\t\t\t\t \u0026mod-\u003enum_trace_bprintk_fmt);\n2746:\t#endif\n2747:\t#ifdef CONFIG_DYNAMIC_FTRACE\n2748:\t\t/* sechdrs[0].sh_size is always zero */\n2749:\t\tmod-\u003eftrace_callsites = section_objs(info, FTRACE_CALLSITE_SECTION,\n2750:\t\t\t\t\t\t     sizeof(*mod-\u003eftrace_callsites),\n2751:\t\t\t\t\t\t     \u0026mod-\u003enum_ftrace_callsites);\n2752:\t#endif\n2753:\t#ifdef CONFIG_FUNCTION_ERROR_INJECTION\n2754:\t\tmod-\u003eei_funcs = section_objs(info, \"_error_injection_whitelist\",\n"
}

49/3 2026/09/24 17:37 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 16918
							output: 27
							thoughts: 345
						

Thoughts:
**Analyzing Potential Uninitialized Variable Issues**

Okay, let's systematically go through the checklist. First, let's consider item 2: "Conditional logic or branching that depends on potentially uninitialized variables or struct fields." Nothing jumps out as a concern here in the current code segment.

Next, I need to consider point 3: "Allocation or initialization of complex data structures where uninitialized fields could be read later in reachable code paths". Ah, this one's important. However, the `trace_sym_def` structs are defined using designated initializers within macros, which is good practice. I see that they are statically declared. Looking at the code:
```c
	static struct trace_sym_def					\
	__trace_sym_def_ ## _name = {					\
		.system = TRACE_SYSTEM_STRING,				\
		.symbol_id = #_symbol_id,				\
		.lookup = _lookup,					\
		.show = _show,						\
	};								\
	static struct trace_sym_def __used				\
	__section("_ftrace_sym_defs")					\
	*__trace_sym_def_p_ ## _name = &__trace_sym_def_ ## _name
```
In C, the static storage duration guarantees zero-initialization of all members in the struct. But, since every field in `struct trace_sym_def` (system, symbol_id, lookup, show) is explicitly initialized anyway, the zero-initialization isn't even relevant here. So I think it is safe.

Now, let's tackle point 4: "Bounds checks, lengths, or logic in a way that allows surrounding code to access uninitialized bytes of existing buffers." I'll need to drill down into the details of the handling of `FORMAT_PRINTFMT` within `show_sym_list` and `show_print_fmt`. I'll need to examine how `call->print_fmt` is set up. This warrants a closer look at `kernel/trace/trace_events.c`.



50/3 2026/09/24 17:37 tool grepper
0m Args:
{
  "Expression": "print_fmt",
  "PathPrefix": "kernel/trace/"
}

Results:
{
  "Output": "kernel/trace/trace.c=3033=static enum print_line_t print_trace_fmt(struct trace_iterator *iter)\n--\nkernel/trace/trace.c-3060-\t\t/*\nkernel/trace/trace.c:3061:\t\t * For TRACE_EVENT() events, the print_fmt is not\nkernel/trace/trace.c-3062-\t\t * safe to use if the array has delta offsets\n--\nkernel/trace/trace_eprobe.c=839=static int __trace_eprobe_create(int argc, const char *argv[])\n--\nkernel/trace/trace_eprobe.c-950-\t}\nkernel/trace/trace_eprobe.c:951:\tret = traceprobe_set_print_fmt(\u0026ep-\u003etp, PROBE_PRINT_EVENT);\nkernel/trace/trace_eprobe.c-952-\tif (ret \u003c 0)\n--\nkernel/trace/trace_events.c=452=static void test_event_printk(struct trace_event_call *call)\n--\nkernel/trace/trace_events.c-463-\nkernel/trace/trace_events.c:464:\tfmt = call-\u003eprint_fmt;\nkernel/trace/trace_events.c-465-\n--\nkernel/trace/trace_events.c-640-\t\t\ttrace_event_name(call), arg);\nkernel/trace/trace_events.c:641:\t\tpr_warn(\"print_fmt: %s\\n\", fmt);\nkernel/trace/trace_events.c-642-\t}\n--\nkernel/trace/trace_events.c=2118=static void show_sym_list(struct seq_file *m, struct trace_event_call *call,\n--\nkernel/trace/trace_events.c-2155-\nkernel/trace/trace_events.c:2156:static void show_print_fmt(struct seq_file *m, struct trace_event_call *call)\nkernel/trace/trace_events.c-2157-{\nkernel/trace/trace_events.c:2158:\tchar *ptr = call-\u003eprint_fmt;\nkernel/trace/trace_events.c-2159-\tbool in_print_sym = false;\n--\nkernel/trace/trace_events.c=2210=static int f_show(struct seq_file *m, void *v)\n--\nkernel/trace/trace_events.c-2228-\tcase FORMAT_PRINTFMT:\nkernel/trace/trace_events.c:2229:\t\tshow_print_fmt(m, call);\nkernel/trace/trace_events.c-2230-\t\treturn 0;\n--\nkernel/trace/trace_events.c=3556=static void update_event_printk(struct trace_event_call *call,\n--\nkernel/trace/trace_events.c-3562-\nkernel/trace/trace_events.c:3563:\tfor (ptr = call-\u003eprint_fmt; *ptr; ptr++) {\nkernel/trace/trace_events.c-3564-\t\tif (*ptr == '\\\\') {\n--\nkernel/trace/trace_events_synth.c=321=static void print_synth_event_num_val(struct trace_seq *s,\nkernel/trace/trace_events_synth.c:322:\t\t\t\t      char *print_fmt, char *name,\nkernel/trace/trace_events_synth.c-323-\t\t\t\t      int size, union trace_synth_field *val, char *space)\n--\nkernel/trace/trace_events_synth.c-326-\tcase 1:\nkernel/trace/trace_events_synth.c:327:\t\ttrace_seq_printf(s, print_fmt, name, val-\u003eas_u8, space);\nkernel/trace/trace_events_synth.c-328-\t\tbreak;\n--\nkernel/trace/trace_events_synth.c-330-\tcase 2:\nkernel/trace/trace_events_synth.c:331:\t\ttrace_seq_printf(s, print_fmt, name, val-\u003eas_u16, space);\nkernel/trace/trace_events_synth.c-332-\t\tbreak;\n--\nkernel/trace/trace_events_synth.c-334-\tcase 4:\nkernel/trace/trace_events_synth.c:335:\t\ttrace_seq_printf(s, print_fmt, name, val-\u003eas_u32, space);\nkernel/trace/trace_events_synth.c-336-\t\tbreak;\n--\nkernel/trace/trace_events_synth.c-338-\tdefault:\nkernel/trace/trace_events_synth.c:339:\t\ttrace_seq_printf(s, print_fmt, name, val-\u003eas_u64, space);\nkernel/trace/trace_events_synth.c-340-\t\tbreak;\n--\nkernel/trace/trace_events_synth.c=344=static enum print_line_t print_synth_event(struct trace_iterator *iter,\n--\nkernel/trace/trace_events_synth.c-352-\tunsigned int i, j, n_u64;\nkernel/trace/trace_events_synth.c:353:\tchar print_fmt[32];\nkernel/trace/trace_events_synth.c-354-\tconst char *fmt;\n--\nkernel/trace/trace_events_synth.c-370-\nkernel/trace/trace_events_synth.c:371:\t\tsnprintf(print_fmt, sizeof(print_fmt), \"%%s=%s%%s\", fmt);\nkernel/trace/trace_events_synth.c-372-\n--\nkernel/trace/trace_events_synth.c-377-\nkernel/trace/trace_events_synth.c:378:\t\t\t\ttrace_seq_printf(s, print_fmt, se-\u003efields[i]-\u003ename,\nkernel/trace/trace_events_synth.c-379-\t\t\t\t\t\t (char *)entry + data-\u003eas_dynamic.offset,\n--\nkernel/trace/trace_events_synth.c-382-\t\t\t} else {\nkernel/trace/trace_events_synth.c:383:\t\t\t\ttrace_seq_printf(s, print_fmt, se-\u003efields[i]-\u003ename,\nkernel/trace/trace_events_synth.c-384-\t\t\t\t\t\t (char *)\u0026entry-\u003efields[n_u64].as_u64,\n--\nkernel/trace/trace_events_synth.c-400-\nkernel/trace/trace_events_synth.c:401:\t\t\tprint_synth_event_num_val(s, print_fmt,\nkernel/trace/trace_events_synth.c-402-\t\t\t\t\t\t  se-\u003efields[i]-\u003ename,\n--\nkernel/trace/trace_events_synth.c=619=static void perf_event_raw_event_synth(void *__data,\n--\nkernel/trace/trace_events_synth.c-657-\nkernel/trace/trace_events_synth.c:658:static void free_synth_event_print_fmt(struct trace_event_call *call)\nkernel/trace/trace_events_synth.c-659-{\nkernel/trace/trace_events_synth.c-660-\tif (call) {\nkernel/trace/trace_events_synth.c:661:\t\tkfree(call-\u003eprint_fmt);\nkernel/trace/trace_events_synth.c:662:\t\tcall-\u003eprint_fmt = NULL;\nkernel/trace/trace_events_synth.c-663-\t}\n--\nkernel/trace/trace_events_synth.c-665-\nkernel/trace/trace_events_synth.c:666:static int __set_synth_event_print_fmt(struct synth_event *event,\nkernel/trace/trace_events_synth.c-667-\t\t\t\t       char *buf, int len)\n--\nkernel/trace/trace_events_synth.c-699-\nkernel/trace/trace_events_synth.c:700:\t/* return the length of print_fmt */\nkernel/trace/trace_events_synth.c-701-\treturn pos;\n--\nkernel/trace/trace_events_synth.c-703-\nkernel/trace/trace_events_synth.c:704:static int set_synth_event_print_fmt(struct trace_event_call *call)\nkernel/trace/trace_events_synth.c-705-{\nkernel/trace/trace_events_synth.c-706-\tstruct synth_event *event = call-\u003edata;\nkernel/trace/trace_events_synth.c:707:\tchar *print_fmt;\nkernel/trace/trace_events_synth.c-708-\tint len;\n--\nkernel/trace/trace_events_synth.c-710-\t/* First: called with 0 length to calculate the needed length */\nkernel/trace/trace_events_synth.c:711:\tlen = __set_synth_event_print_fmt(event, NULL, 0);\nkernel/trace/trace_events_synth.c-712-\nkernel/trace/trace_events_synth.c:713:\tprint_fmt = kmalloc(len + 1, GFP_KERNEL);\nkernel/trace/trace_events_synth.c:714:\tif (!print_fmt)\nkernel/trace/trace_events_synth.c-715-\t\treturn -ENOMEM;\nkernel/trace/trace_events_synth.c-716-\nkernel/trace/trace_events_synth.c:717:\t/* Second: actually write the @print_fmt */\nkernel/trace/trace_events_synth.c:718:\t__set_synth_event_print_fmt(event, print_fmt, len + 1);\nkernel/trace/trace_events_synth.c:719:\tcall-\u003eprint_fmt = print_fmt;\nkernel/trace/trace_events_synth.c-720-\n--\nkernel/trace/trace_events_synth.c=955=static int register_synth_event(struct synth_event *event)\n--\nkernel/trace/trace_events_synth.c-998-\nkernel/trace/trace_events_synth.c:999:\tret = set_synth_event_print_fmt(call);\nkernel/trace/trace_events_synth.c-1000-\t/* unregister_trace_event() will be called inside */\n--\nkernel/trace/trace_events_synth.c=1020=static void free_synth_event(struct synth_event *event)\n--\nkernel/trace/trace_events_synth.c-1034-\tfree_synth_tracepoint(event-\u003etp);\nkernel/trace/trace_events_synth.c:1035:\tfree_synth_event_print_fmt(\u0026event-\u003ecall);\nkernel/trace/trace_events_synth.c-1036-\tkfree(event);\n--\nkernel/trace/trace_events_user.c=1395=static int user_field_set_string(struct ftrace_event_field *field,\n--\nkernel/trace/trace_events_user.c-1412-\nkernel/trace/trace_events_user.c:1413:static int user_event_set_print_fmt(struct user_event *user, char *buf, int len)\nkernel/trace/trace_events_user.c-1414-{\n--\nkernel/trace/trace_events_user.c-1446-\nkernel/trace/trace_events_user.c:1447:static int user_event_create_print_fmt(struct user_event *user)\nkernel/trace/trace_events_user.c-1448-{\nkernel/trace/trace_events_user.c:1449:\tchar *print_fmt;\nkernel/trace/trace_events_user.c-1450-\tint len;\nkernel/trace/trace_events_user.c-1451-\nkernel/trace/trace_events_user.c:1452:\tlen = user_event_set_print_fmt(user, NULL, 0);\nkernel/trace/trace_events_user.c-1453-\nkernel/trace/trace_events_user.c:1454:\tprint_fmt = kmalloc(len, GFP_KERNEL_ACCOUNT);\nkernel/trace/trace_events_user.c-1455-\nkernel/trace/trace_events_user.c:1456:\tif (!print_fmt)\nkernel/trace/trace_events_user.c-1457-\t\treturn -ENOMEM;\nkernel/trace/trace_events_user.c-1458-\nkernel/trace/trace_events_user.c:1459:\tuser_event_set_print_fmt(user, print_fmt, len);\nkernel/trace/trace_events_user.c-1460-\nkernel/trace/trace_events_user.c:1461:\tuser-\u003ecall.print_fmt = print_fmt;\nkernel/trace/trace_events_user.c-1462-\n--\nkernel/trace/trace_events_user.c=1502=static int destroy_user_event(struct user_event *user)\n--\nkernel/trace/trace_events_user.c-1539-\nkernel/trace/trace_events_user.c:1540:\tkfree(user-\u003ecall.print_fmt);\nkernel/trace/trace_events_user.c-1541-\tkfree(EVENT_NAME(user));\n--\nkernel/trace/trace_events_user.c=2103=static int user_event_parse(struct user_event_group *group, char *name,\n--\nkernel/trace/trace_events_user.c-2172-\nkernel/trace/trace_events_user.c:2173:\tret = user_event_create_print_fmt(user);\nkernel/trace/trace_events_user.c-2174-\n--\nkernel/trace/trace_events_user.c-2230-\tuser_event_destroy_validators(user);\nkernel/trace/trace_events_user.c:2231:\tkfree(user-\u003ecall.print_fmt);\nkernel/trace/trace_events_user.c-2232-\n--\nkernel/trace/trace_export.c=188=struct trace_event_call __used event_##call = {\t\t\t\t\\\n--\nkernel/trace/trace_export.c-193-\t.event.type\t\t= etype,\t\t\t\t\\\nkernel/trace/trace_export.c:194:\t.print_fmt\t\t= print,\t\t\t\t\\\nkernel/trace/trace_export.c-195-\t.flags\t\t\t= TRACE_EVENT_FL_IGNORE_ENABLE,\t\t\\\n--\nkernel/trace/trace_fprobe.c=1209=static int trace_fprobe_create_internal(int argc, const char *argv[],\n--\nkernel/trace/trace_fprobe.c-1373-\nkernel/trace/trace_fprobe.c:1374:\tret = traceprobe_set_print_fmt(\u0026tf-\u003etp,\nkernel/trace/trace_fprobe.c-1375-\t\t\tis_return ? PROBE_PRINT_RETURN : PROBE_PRINT_NORMAL);\n--\nkernel/trace/trace_kprobe.c=854=static int trace_kprobe_create_internal(int argc, const char *argv[],\n--\nkernel/trace/trace_kprobe.c-1072-\tptype = is_return ? PROBE_PRINT_RETURN : PROBE_PRINT_NORMAL;\nkernel/trace/trace_kprobe.c:1073:\tret = traceprobe_set_print_fmt(\u0026tk-\u003etp, ptype);\nkernel/trace/trace_kprobe.c-1074-\tif (ret \u003c 0)\n--\nkernel/trace/trace_kprobe.c=1933=create_local_trace_kprobe(char *func, void *addr, unsigned long offs,\n--\nkernel/trace/trace_kprobe.c-1967-\t\tPROBE_PRINT_RETURN : PROBE_PRINT_NORMAL;\nkernel/trace/trace_kprobe.c:1968:\tif (traceprobe_set_print_fmt(\u0026tk-\u003etp, ptype) \u003c 0)\nkernel/trace/trace_kprobe.c-1969-\t\treturn ERR_PTR(-ENOMEM);\n--\nkernel/trace/trace_probe.c=2428=int traceprobe_update_arg(struct probe_arg *arg)\n--\nkernel/trace/trace_probe.c-2463-#define LEN_OR_ZERO (len \u003e pos ? len - pos : 0)\nkernel/trace/trace_probe.c:2464:static int __set_print_fmt(struct trace_probe *tp, char *buf, int len,\nkernel/trace/trace_probe.c-2465-\t\t\t   enum probe_print_type ptype)\n--\nkernel/trace/trace_probe.c-2528-\nkernel/trace/trace_probe.c:2529:\t/* return the length of print_fmt */\nkernel/trace/trace_probe.c-2530-\treturn pos;\n--\nkernel/trace/trace_probe.c-2533-\nkernel/trace/trace_probe.c:2534:int traceprobe_set_print_fmt(struct trace_probe *tp, enum probe_print_type ptype)\nkernel/trace/trace_probe.c-2535-{\n--\nkernel/trace/trace_probe.c-2537-\tint len;\nkernel/trace/trace_probe.c:2538:\tchar *print_fmt;\nkernel/trace/trace_probe.c-2539-\nkernel/trace/trace_probe.c-2540-\t/* First: called with 0 length to calculate the needed length */\nkernel/trace/trace_probe.c:2541:\tlen = __set_print_fmt(tp, NULL, 0, ptype);\nkernel/trace/trace_probe.c:2542:\tprint_fmt = kmalloc(len + 1, GFP_KERNEL);\nkernel/trace/trace_probe.c:2543:\tif (!print_fmt)\nkernel/trace/trace_probe.c-2544-\t\treturn -ENOMEM;\nkernel/trace/trace_probe.c-2545-\nkernel/trace/trace_probe.c:2546:\t/* Second: actually write the @print_fmt */\nkernel/trace/trace_probe.c:2547:\t__set_print_fmt(tp, print_fmt, len + 1, ptype);\nkernel/trace/trace_probe.c:2548:\tcall-\u003eprint_fmt = print_fmt;\nkernel/trace/trace_probe.c-2549-\n--\nkernel/trace/trace_probe.c=2619=static void trace_probe_event_free(struct trace_probe_event *tpe)\n--\nkernel/trace/trace_probe.c-2627-\tkfree(tpe-\u003ecall.name);\nkernel/trace/trace_probe.c:2628:\tkfree(tpe-\u003ecall.print_fmt);\nkernel/trace/trace_probe.c-2629-\tkfree(tpe);\n--\nkernel/trace/trace_probe.h=519=enum probe_print_type {\n--\nkernel/trace/trace_probe.h-524-\nkernel/trace/trace_probe.h:525:extern int traceprobe_set_print_fmt(struct trace_probe *tp, enum probe_print_type ptype);\nkernel/trace/trace_probe.h-526-\n--\nkernel/trace/trace_remote.c=1088=static int remote_event_format_show(struct seq_file *s, void *unused)\n--\nkernel/trace/trace_remote.c-1110-\nkernel/trace/trace_remote.c:1111:\tseq_printf(s, \"print fmt: %s\\n\", evt-\u003eprint_fmt);\nkernel/trace/trace_remote.c-1112-\n--\nkernel/trace/trace_syscalls.c=387=static int __init\nkernel/trace/trace_syscalls.c:388:sys_enter_openat_print_fmt(struct syscall_metadata *entry, char *buf, int len)\nkernel/trace/trace_syscalls.c-389-{\n--\nkernel/trace/trace_syscalls.c=440=static int __init\nkernel/trace/trace_syscalls.c:441:__set_enter_print_fmt(struct syscall_metadata *entry, char *buf, int len)\nkernel/trace/trace_syscalls.c-442-{\n--\nkernel/trace/trace_syscalls.c-448-\tcase __NR_openat:\nkernel/trace/trace_syscalls.c:449:\t\treturn sys_enter_openat_print_fmt(entry, buf, len);\nkernel/trace/trace_syscalls.c-450-\tdefault:\n--\nkernel/trace/trace_syscalls.c-488-\nkernel/trace/trace_syscalls.c:489:\t/* return the length of print_fmt */\nkernel/trace/trace_syscalls.c-490-\treturn pos;\n--\nkernel/trace/trace_syscalls.c-492-\nkernel/trace/trace_syscalls.c:493:static int __init set_syscall_print_fmt(struct trace_event_call *call)\nkernel/trace/trace_syscalls.c-494-{\nkernel/trace/trace_syscalls.c:495:\tchar *print_fmt;\nkernel/trace/trace_syscalls.c-496-\tint len;\n--\nkernel/trace/trace_syscalls.c-499-\tif (entry-\u003eenter_event != call) {\nkernel/trace/trace_syscalls.c:500:\t\tcall-\u003eprint_fmt = \"\\\"0x%lx\\\", REC-\u003eret\";\nkernel/trace/trace_syscalls.c-501-\t\treturn 0;\n--\nkernel/trace/trace_syscalls.c-504-\t/* First: called with 0 length to calculate the needed length */\nkernel/trace/trace_syscalls.c:505:\tlen = __set_enter_print_fmt(entry, NULL, 0);\nkernel/trace/trace_syscalls.c-506-\nkernel/trace/trace_syscalls.c:507:\tprint_fmt = kmalloc(len + 1, GFP_KERNEL);\nkernel/trace/trace_syscalls.c:508:\tif (!print_fmt)\nkernel/trace/trace_syscalls.c-509-\t\treturn -ENOMEM;\nkernel/trace/trace_syscalls.c-510-\nkernel/trace/trace_syscalls.c:511:\t/* Second: actually write the @print_fmt */\nkernel/trace/trace_syscalls.c:512:\t__set_enter_print_fmt(entry, print_fmt, len + 1);\nkernel/trace/trace_syscalls.c:513:\tcall-\u003eprint_fmt = print_fmt;\nkernel/trace/trace_syscalls.c-514-\n--\nkernel/trace/trace_syscalls.c-517-\nkernel/trace/trace_syscalls.c:518:static void __init free_syscall_print_fmt(struct trace_event_call *call)\nkernel/trace/trace_syscalls.c-519-{\n--\nkernel/trace/trace_syscalls.c-522-\tif (entry-\u003eenter_event == call)\nkernel/trace/trace_syscalls.c:523:\t\tkfree(call-\u003eprint_fmt);\nkernel/trace/trace_syscalls.c-524-}\n--\nkernel/trace/trace_syscalls.c=1265=static int __init init_syscall_trace(struct trace_event_call *call)\n--\nkernel/trace/trace_syscalls.c-1278-\nkernel/trace/trace_syscalls.c:1279:\tif (set_syscall_print_fmt(call) \u003c 0)\nkernel/trace/trace_syscalls.c-1280-\t\treturn -ENOMEM;\n--\nkernel/trace/trace_syscalls.c-1284-\tif (id \u003c 0) {\nkernel/trace/trace_syscalls.c:1285:\t\tfree_syscall_print_fmt(call);\nkernel/trace/trace_syscalls.c-1286-\t\treturn id;\n--\nkernel/trace/trace_uprobe.c=542=static int __trace_uprobe_create(int argc, const char **argv)\n--\nkernel/trace/trace_uprobe.c-715-\tptype = is_ret_probe(tu) ? PROBE_PRINT_RETURN : PROBE_PRINT_NORMAL;\nkernel/trace/trace_uprobe.c:716:\tret = traceprobe_set_print_fmt(\u0026tu-\u003etp, ptype);\nkernel/trace/trace_uprobe.c-717-\tif (ret \u003c 0)\n--\nkernel/trace/trace_uprobe.c=1628=create_local_trace_uprobe(char *name, unsigned long offs,\n--\nkernel/trace/trace_uprobe.c-1671-\tptype = is_ret_probe(tu) ? PROBE_PRINT_RETURN : PROBE_PRINT_NORMAL;\nkernel/trace/trace_uprobe.c:1672:\tif (traceprobe_set_print_fmt(\u0026tu-\u003etp, ptype) \u003c 0) {\nkernel/trace/trace_uprobe.c-1673-\t\tret = -ENOMEM;\n"
}

51/3 2026/09/24 17:37 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 24202
							output: 37
							thoughts: 671
						

Thoughts:
**Analyzing Potential Memory Issues in Kernel Tracing and Drop Monitoring**

Okay, let's break this down. My initial focus is on the `f_show` function within `kernel/trace/trace_events.c`, specifically how it handles formatting the output for tracepoints, which is accessed via the `format` file under debugfs/tracefs. It seems `f_show` is responsible for presenting the format of trace events in a user-friendly manner, particularly when events use the `__print_sym` macro.

The critical path here leads through `show_print_fmt`, where I see the conversion of `__print_sym` to `__print_symbolic` during the format display. This transformation is key for users to understand what the data actually represents. The function populates a sequential buffer managed by `seq_file`. Thankfully, the `seq_file` infrastructure takes care of buffer boundary checks, which is good to see as it alleviates a common source of bugs.

The part that caught my attention was the potential for string handling vulnerabilities, especially in `show_sym_list`. It calls `show_sym_list(m, call, name, ptr - name);`. I've verified that the `name` pointer is actually a pointer into the `call->print_fmt` string, which is guaranteed to be null-terminated. The subsequent calculation of `ptr - name` is safe since it represents the length of the string segment within `print_fmt`. So, no immediate concerns there.

Diving deeper into `show_sym_list`, it compares `sym_defs[i]->symbol_id` with `name`. I've checked and it is using static data or function pointers to static functions, so it's not likely to be reading uninitialized data.

Now, shifting gears to `drop_monitor.c`, specifically the `drop_reason_lookup` function. I'm looking at `reason_str = drop_reason_lookup(cb->reason);`. There is a check: `if (unlikely(!reason_str))` for a null return from `drop_reason_lookup`. Then `reason_str = drop_reason_lookup(SKB_DROP_REASON_NOT_SPECIFIED);`. My primary worry is about uninitialized memory in `cb->reason` that could potentially be used. Where does `cb->reason` actually get populated? That's the next critical piece of information I need to investigate. I need to trace back how the `cb->reason` field is assigned to verify if the possible uninitialized memory is a real vulnerability, or if initialization has already happened earlier in the code.



52/3 2026/09/24 17:38 tool grepper
0m Args:
{
  "Expression": "NET_DM_SKB_CB",
  "PathPrefix": "net/core/drop_monitor.c"
}

Results:
{
  "Output": "net/core/drop_monitor.c=123=struct net_dm_skb_cb {\n--\nnet/core/drop_monitor.c-130-\nnet/core/drop_monitor.c:131:#define NET_DM_SKB_CB(__skb) ((struct net_dm_skb_cb *)\u0026((__skb)-\u003ecb[0]))\nnet/core/drop_monitor.c-132-\n--\nnet/core/drop_monitor.c=491=static void net_dm_packet_trace_kfree_skb_hit(void *ignore,\n--\nnet/core/drop_monitor.c-509-\nnet/core/drop_monitor.c:510:\tcb = NET_DM_SKB_CB(nskb);\nnet/core/drop_monitor.c-511-\tcb-\u003ereason = reason;\n--\nnet/core/drop_monitor.c=610=static int net_dm_packet_report_fill(struct sk_buff *msg, struct sk_buff *skb,\n--\nnet/core/drop_monitor.c-612-{\nnet/core/drop_monitor.c:613:\tstruct net_dm_skb_cb *cb = NET_DM_SKB_CB(skb);\nnet/core/drop_monitor.c-614-\tchar buf[NET_DM_MAX_SYMBOL_LEN];\n--\nnet/core/drop_monitor.c=767=static int net_dm_hw_packet_report_fill(struct sk_buff *msg,\n--\nnet/core/drop_monitor.c-773-\nnet/core/drop_monitor.c:774:\thw_metadata = NET_DM_SKB_CB(skb)-\u003ehw_metadata;\nnet/core/drop_monitor.c-775-\n--\nnet/core/drop_monitor.c=893=static void net_dm_hw_packet_report(struct sk_buff *skb)\n--\nnet/core/drop_monitor.c-908-\nnet/core/drop_monitor.c:909:\thw_metadata = NET_DM_SKB_CB(skb)-\u003ehw_metadata;\nnet/core/drop_monitor.c-910-\tmsg = nlmsg_new(net_dm_hw_packet_report_size(payload_len, hw_metadata),\n--\nnet/core/drop_monitor.c-923-out:\nnet/core/drop_monitor.c:924:\tnet_dm_hw_metadata_free(NET_DM_SKB_CB(skb)-\u003ehw_metadata);\nnet/core/drop_monitor.c-925-\tconsume_skb(skb);\n--\nnet/core/drop_monitor.c=948=net_dm_hw_trap_packet_probe(void *ignore, const struct devlink *devlink,\n--\nnet/core/drop_monitor.c-971-\nnet/core/drop_monitor.c:972:\tNET_DM_SKB_CB(nskb)-\u003ehw_metadata = n_hw_metadata;\nnet/core/drop_monitor.c-973-\tnskb-\u003etstamp = tstamp;\n--\nnet/core/drop_monitor.c=1033=static int net_dm_hw_monitor_start(struct netlink_ext_ack *extack)\n--\nnet/core/drop_monitor.c-1079-\nnet/core/drop_monitor.c:1080:\t\t\thw_metadata = NET_DM_SKB_CB(skb)-\u003ehw_metadata;\nnet/core/drop_monitor.c-1081-\t\t\tnet_dm_hw_metadata_free(hw_metadata);\n--\nnet/core/drop_monitor.c=1089=static void net_dm_hw_monitor_stop(struct netlink_ext_ack *extack)\n--\nnet/core/drop_monitor.c-1113-\nnet/core/drop_monitor.c:1114:\t\t\thw_metadata = NET_DM_SKB_CB(skb)-\u003ehw_metadata;\nnet/core/drop_monitor.c-1115-\t\t\tnet_dm_hw_metadata_free(hw_metadata);\n"
}

53/3 2026/09/24 17:38 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 26525
							output: 341
							thoughts: 1321
						

Thoughts:
**KMSAN Evaluation: No Need for Dedicated Fuzzing**

Okay, so I've been carefully reviewing this patch series, and it seems the existing `cb->reason = reason;` functionality already handles the core change. The update simplifies `net_dm_packet_report_fill` by replacing a manual lookup with a call to `drop_reason_lookup(cb->reason)`. Now, the important question is: Does this necessitate KMSAN? Based on my understanding of the criteria, I need to evaluate whether this patch introduces uninitialized memory risks that *only* KMSAN would catch.

Let's break it down:

1.  **Kernel-to-User Space Structures:** Nope. The network message for drop monitoring sends a string (`NET_DM_ATTR_REASON`) derived from static string literals. No risk there.

2.  **Conditional Logic & Uninitialized Variables:** No, again. All the variables used in conditions are either function arguments, or derived directly from known string lengths, array sizes, or pointer values. No hidden uninitialized values here.

3.  **Complex Data Structure Allocation/Initialization:** No. The code introduces statically defined and initialized `struct trace_sym_def` and `struct trace_sym_entry` tables. These are defined at compile time and initialized by macros. No dynamic allocation, no uninitialized fields to worry about.

4.  **Bounds Checks/Length Logic:** Also no. The `show_print_fmt` code parses `call->print_fmt`, a C string, and outputs formatted text via `seq_file`. Any potential issues here are boundary violations of the string itself, which KASAN would pick up. For tracepoints: `__print_sym` expands to `trace_print_sym_seq` which formats the string into `struct trace_seq`. All operations use `trace_seq` APIs with strings or formatted 64-bit hex.

Now, let's consider where *other* sanitizers apply:

*   Parsing logic in `show_print_fmt` (string manipulation, pointer arithmetic on `call->print_fmt`) – KASAN.
*   Array indexing in `show_sym_list` (`sym_defs[i]` iterating up to `n_sym_defs`) – KASAN.
*   RCU dereference in `drop_reason_lookup` / `drop_reason_show` – LOCKDEP / PROVE\_RCU.

Essentially, all the potential problems are already covered by KASAN, LOCKDEP, or the standard checks.

In conclusion, this patch does *not* introduce any uninitialized memory risks or kernel-to-user information leaks that would require a dedicated KMSAN fuzzing session. The existing sanitizers are sufficient.

Therefore, `NeedsKMSAN` should be false. The reasoning needs to clearly differentiate KMSAN and KASAN. The summary should cover what the patch does (refactoring ftrace symbolic printing, introducing `struct trace_sym_def` and `struct trace_sym_entry`, adding drop reason lookup helpers, and formatting `print_fmt` in debugfs/tracefs), and should explain why KMSAN is not needed (no allocation of uninitialized memory, no uninitialized fields copied to user space, no conditional branching on uninitialized data), and explain why KASAN/LOCKDEP *are* relevant to cover potential string parsing, pointer dereferences/OOB/NULL/RCU issues. I believe I have a solid understanding of this, so I will now call `set-results`.



54/3 2026/09/24 17:38 tool set-results
0m Args:
{
  "KMSANReasoning": "The patch refactors ftrace symbol resolution and printing (__print_sym) for tracepoints, notably skb drop reasons and timer tick dependencies. It introduces compile-time generated symbol definition tables (struct trace_sym_def and struct trace_sym_entry), adds lookup/show helpers (drop_reason_lookup, drop_reason_show, trace_print_sym_seq), and replaces inline symbolic strings in print_fmt with a parser (show_print_fmt) that generates them on demand for userspace seq_file reads.\n\nKMSAN is not needed here because:\n1. No uninitialized memory is allocated or read: all newly introduced symbol structures are static and initialized at compile time via macros, and all lookup functions operate on integers passed by value and return pointers to static constant string literals.\n2. The netlink attribute formatting in net_dm_packet_report_fill passes static string literals to nla_put_string, without copying uninitialized struct padding or fields to userspace.\n3. Any potential bugs in this patch involve pointer arithmetic and string traversal (e.g. parsing call-\u003eprint_fmt in show_print_fmt or iterating sym_defs array), out-of-bounds reads, or RCU locking semantics (e.g. drop_reasons_by_subsys dereferencing). These classes of bugs are thoroughly covered by standard KASAN and LOCKDEP / PROVE_RCU detectors.\n\nHence, a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false
}

Results:
{
  "KMSANReasoning": "The patch refactors ftrace symbol resolution and printing (__print_sym) for tracepoints, notably skb drop reasons and timer tick dependencies. It introduces compile-time generated symbol definition tables (struct trace_sym_def and struct trace_sym_entry), adds lookup/show helpers (drop_reason_lookup, drop_reason_show, trace_print_sym_seq), and replaces inline symbolic strings in print_fmt with a parser (show_print_fmt) that generates them on demand for userspace seq_file reads.\n\nKMSAN is not needed here because:\n1. No uninitialized memory is allocated or read: all newly introduced symbol structures are static and initialized at compile time via macros, and all lookup functions operate on integers passed by value and return pointers to static constant string literals.\n2. The netlink attribute formatting in net_dm_packet_report_fill passes static string literals to nla_put_string, without copying uninitialized struct padding or fields to userspace.\n3. Any potential bugs in this patch involve pointer arithmetic and string traversal (e.g. parsing call-\u003eprint_fmt in show_print_fmt or iterating sym_defs array), out-of-bounds reads, or RCU locking semantics (e.g. drop_reasons_by_subsys dereferencing). These classes of bugs are thoroughly covered by standard KASAN and LOCKDEP / PROVE_RCU detectors.\n\nHence, a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false
}

LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)