Skip to content

Restrict bpf_probe_read{,str}() and bpf_trace_printk()'s %s

Daniel Borkmann bpf netdev 2 versions – Applied

Status from this message: Applied to bpf tree. Thanks

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyApplied
  2. v13 patches 10 repliesSuperseded

Changes in v2 from the cover letter

- 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/

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3bpf: restrict bpf_probe_read{,str}() only to archs where they workarch/arm/Kconfig arch/arm64/Kconfig arch/x86/Kconfig +2 more+10 -20 replies
2/3bpf: add bpf_probe_read_{user, kernel}_str() to do_refine_retval_rangekernel/bpf/verifier.c+3 -10 replies
3/3bpf: restrict bpf_trace_printk()'s %s usage and add %pks, %pus specifierDocumentation/core-api/printk-formats.rst kernel/trace/bpf_trace.c lib/vsprintf.c+88 -320 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchJohn FastabendYonghong SongLinus TorvaldsMasami Hiramatsu
1/3A-b R-b
2/3A-b A-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v2 thread

Cover letter [PATCH bpf v2 0/3] Restrict bpf_probe_read{,str}() and bpf_trace_printk()'s %s

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/

Daniel Borkmann (3):
bpf: restrict bpf_probe_read{,str}() only to archs where they work
bpf: add bpf_probe_read_{user, kernel}_str() to do_refine_retval_range
bpf: restrict bpf_trace_printk()'s %s usage and add %pks, %pus specifier

 Documentation/core-api/printk-formats.rst |  14 +++
 arch/arm/Kconfig                          |   1 +
 arch/arm64/Kconfig                        |   1 +
 arch/x86/Kconfig                          |   1 +
 init/Kconfig                              |   3 +
 kernel/bpf/verifier.c                     |   4 +-
 kernel/trace/bpf_trace.c                  | 100 ++++++++++++++--------
 lib/vsprintf.c                            |  12 +++
 8 files changed, 101 insertions(+), 35 deletions(-)
Signature · 1 line
2.21.0