Re: [PATCH] tracing/filters: Fix MATCH_END_ONLY on dynamic char arrays

From: Steven Rostedt

Date: Thu Dec 03 2026 - 08:29:09 EST


On Thu, 26 Nov 2026 21:52:28 +0000
David Carlier <devnexen@xxxxxxxxx> wrote:

> regex_match_end() takes the string length as "len - 1", which holds
> for __string() fields where the length counts the trailing NUL. A
> __dynamic_array() of char does not have to be NUL-terminated or
> filled to its length. The xfs namespace events copy name->len bytes
> with no NUL, so the compare is off by one:
>
> # echo 'name ~ "*.txt"' > events/xfs/xfs_lookup/filter
>
> misses "foo.txt" and matches "a.txtz".
>
> Use regex_match_end_str() for dynamic strings as well, which finds
> the end with strnlen().

After this change, does anything actually use regex_match_end?

Why not just remove it or replace it with regex_match_end_str?

-- Steve