M Masami Hiramatsu (Google) #
Message details and related content
Hi, Here is the 4th version of fixes for various bugs in the trace event filter parser and predicate evaluation in kernel/trace/trace_events_filter.c, along with a new ftracetest test case covering filter syntax checks. The previous version is here: https://lore.kernel.org/all/179314820431.684037.4147763044424284198.stgit@devnote2 In this version, according to the comment from Sashiko and Steve, dropped a redundant patch and reorder the patches for separating real bug fixes (1-8) and cleanups & test (9-15). Steve and I agreed that the patches which just fixes the error message will be a cleanup or improvement, so I removed Fixes/Cc:stable tags from those. Changes in v4: - Dropped the separate regex_match_end() zero-length string fix patch ([01/16] in v3) as redundant per review from Sashiko. - In [01/15], introduce regex_match_end_dynstr() for FILTER_STATIC_STRING fields defined with size 0 (such as the 'buf' field of ftrace/print events / trace_marker), so that suffix filtering on unbounded NUL-terminated strings works as expected without penalizing fixed-size buffer matching. - In [02/15], clean up process_system_preds() by replacing the 'fail' boolean with 'ret' and consolidating the cleanup logic between fail and fail_mem, as suggested by Steven Rostedt. - In [09/15] (was [10/16]), verify that all characters following the newline are whitespace before writing '\0' in filter_check_newline(), preventing in-place truncation of the filter string on error, as pointed out by Sashiko. - In [10/15] (was [08/16]), drop Fixes and Cc: stable tags, as this is an error log improvement cleanup rather than a bug fix. Also move it after other Cc: stable patches. - In [11/15] to [14/15], drop Fixes and Cc: stable tags from error position fixes as these are cleanups. Summary of the patches: ~~~~~~(fixes)~~~~~~ - [01/15] Introduce regex_match_end_str() for fixed-size string fields