Skip to contentSkip to conversation

tracing: Add ustring operation to filtering string pointers

PATCH New Steven Rostedt 1 participant 1 message Jan 14, 2022

Subsystems (2)
lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

PATCH 1/1 tracing: Add ustring operation to filtering string pointers

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
for-next

Head SHA1: f37c3bbc635994eda203a6da4ba0f9d05165a8d6

Steven Rostedt (1):
tracing: Add ustring operation to filtering string pointers

----

 Documentation/trace/events.rst     |  9 +++++
 kernel/trace/trace_events_filter.c | 81 +++++++++++++++++++++++++++-----------
 2 files changed, 66 insertions(+), 24 deletions(-)
---------------------------
commit f37c3bbc635994eda203a6da4ba0f9d05165a8d6
Author: Steven Rostedt <[email protected]>
Date:   Thu Jan 13 20:08:40 2022 -0500

tracing: Add ustring operation to filtering string pointers

Since referencing user space pointers is special, if the user wants to filter on a field that is a pointer to user space, then they need to specify it.

Add a ".ustring" attribute to the field name for filters to state that the field is pointing to user space such that the kernel can take the appropriate action to read that pointer.

Fixes 77360f9bbc7e ("tracing: Add test for user space strings when filtering on string pointers")
Documentation/trace/events.rst +9 -0
index 45e66a60a816..c47f381d0c00 100644
@@ -198,6 +198,15 @@ The glob (~) accepts a wild card character (\*,?) and character classes
   prev_comm ~ "*sh*"
   prev_comm ~ "ba*sh"
 
+If the field is a pointer that points into user space (for example
+"filename" from sys_enter_openat), then you have to append ".ustring" to the
+field name::
+
+  filename.ustring ~ "password"
+
+As the kernel will have to know how to retrieve the memory that the pointer
+is at from user space.
+
 5.2 Setting filters
 -------------------
 
kernel/trace/trace_events_filter.c +57 -24

129 lines not on this page · raw message