aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2020-05-15 08:10:36 -0700
committerAlexei Starovoitov <ast@kernel.org>2020-05-15 08:15:07 -0700
commit59df9f1fb4977b40cfad8d07b0d5baeb3a07e22c (patch)
treebb520b4c58247f567a586756c98ab5840d21f8f8 /Documentation
parentselftests/bpf: Enforce returning 0 for fentry/fexit programs (diff)
parentbpf: Restrict bpf_trace_printk()'s %s usage and add %pks, %pus specifier (diff)
downloadlinux-dev-59df9f1fb4977b40cfad8d07b0d5baeb3a07e22c.tar.xz
linux-dev-59df9f1fb4977b40cfad8d07b0d5baeb3a07e22c.zip
Merge branch 'restrict-bpf_probe_read'
Daniel Borkmann says: ==================== Small set of fixes in order to restrict BPF helpers for tracing which are broken on archs with overlapping address ranges as per discussion in [0]. I've targetted this for -bpf tree so they can be routed as fixes. Thanks! v1 -> v2: - switch to reusable %pks, %pus format specifiers (Yonghong) - fixate %s on kernel_ds probing for archs with overlapping addr space [0] https://lore.kernel.org/bpf/CAHk-=wjJKo0GVixYLmqPn-Q22WFu0xHaBSjKEo7e7Yw72y5SPQ@mail.gmail.com/T/ ==================== Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/core-api/printk-formats.rst14
1 files changed, 14 insertions, 0 deletions
diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core-api/printk-formats.rst
index 8ebe46b1af39..5dfcc4592b23 100644
--- a/Documentation/core-api/printk-formats.rst
+++ b/Documentation/core-api/printk-formats.rst
@@ -112,6 +112,20 @@ used when printing stack backtraces. The specifier takes into
consideration the effect of compiler optimisations which may occur
when tail-calls are used and marked with the noreturn GCC attribute.
+Probed Pointers from BPF / tracing
+----------------------------------
+
+::
+
+ %pks kernel string
+ %pus user string
+
+The ``k`` and ``u`` specifiers are used for printing prior probed memory from
+either kernel memory (k) or user memory (u). The subsequent ``s`` specifier
+results in printing a string. For direct use in regular vsnprintf() the (k)
+and (u) annotation is ignored, however, when used out of BPF's bpf_trace_printk(),
+for example, it reads the memory it is pointing to without faulting.
+
Kernel Pointers
---------------