M Masami Hiramatsu (Google) #
Message details and related content
Hi, Here is the 3rd 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/179291742944.492959.11659339795290028998.stgit@devnote2 This version splitted some combined patches into dedicated patches, dropped a wrong patch, and introduced 5 new patches to fix wrong error position reported in error_log (this is required to fix syntax test failures). Changes in v3: [01/16] - Split zero-length string underflow and out-of-bounds fix from fixed-size string matching. - Return 0 immediately if "len <= r->len" in regex_match_end() without scanning the string. [02/16] - Split from zero-length string fix into a dedicated patch. - Introduce regex_match_end_str() for fixed-size buffers and assign it in parse_pred() for FILTER_COMM and FILTER_STATIC_STRING, avoiding strnlen() overhead for dynamic and pointer strings in regex_match_end(). [06/16] ([05/09] in v2) - Check if str[i] is NUL immediately after skipping whitespace after the operator in parse_pred() across all event types, as suggested by Steven Rostedt. [07/16] ([05/09] in v2) - Fix quoted operand parsing in function event filter. - Allow empty quoted operand ("") as valid syntax per Steven Rostedt. [08/16] ([05/09] in v2) - Reject empty unquoted operands (!q && !len) in function events. [09/16] ([05/09] in v2) - Reject stray quotes and '(' in unquoted function event operands. ([06/09] in v2) - Dropped. [11/16] - Introduce filter_check_newline() to convert the first newline to NUL and reject any non-whitespace characters after the newline with