On Wed, 2026-09-23 at 11:10 +0000, [email protected] wrote: > > +#undef __print_sym > > +#define __print_sym(value, symbol_id) __print_sym(value:symbol_id) > > [Severity: Medium] > Does this delimiter choice in the __print_sym() macro in > include/trace/stages/stage7_class_define.h cause issues for arbitrary C > expressions? > > This macro transforms the arguments into a string format using a delimiter (:) > that is unsafe for arbitrary C expressions if parsed left-to-right. If a > kernel developer uses an expression containing a colon (such as a ternary > operator like a ? b : c) as the value argument, it seems the string > representation will contain multiple colons.
[snip] Technically, yes, but I think it's implausible to have a ternary for printing a simple enum value *inside* the TP_printk(). You'd usually want to store the result of the ternary via TP_fast_assign(), I'd think. > Could a backward search for ':' from the closing parenthesis safely isolate > the symbol ID? Technically? But it'd be relatively more complicated, the code would have to pre-parse to the end and we have seq_put() here etc. I'm not convinced it's worth doing. johannes
