Skip to content
Commit eca344a7 authored by Steven Rostedt (Google)'s avatar Steven Rostedt (Google)
Browse files

tracing: Have trace event string test handle zero length strings

If a trace event has in its TP_printk():

 "%*.s", len, len ? __get_str(string) : NULL

It is perfectly valid if len is zero and passing in the NULL.
Unfortunately, the runtime string check at time of reading the trace sees
the NULL and flags it as a bad string and produces a WARN_ON().

Handle this case by passing into the test function if the format has an
asterisk (star) and if so, if the length is zero, then mark it as safe.

Link: https://lore.kernel.org/all/YjsWzuw5FbWPrdqq@bfoster/



Cc: stable@vger.kernel.org
Reported-by: default avatarBrian Foster <bfoster@redhat.com>
Tested-by: default avatarBrian Foster <bfoster@redhat.com>
Fixes: 9a6944fe ("tracing: Add a verifier to check string pointers for trace events")
Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
parent 78cbc651
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment