writable contexts for bpf raw tracepoints
Status from this message: Applied. Thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest5 patches 1 replyApplied
- v45 patches 3 repliesSuperseded
- v35 patches 10 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 5 patches | 3 replies | Superseded | |
| v1 | 2 of 3 patches | 4 replies | Superseded |
Changes in v5 from the cover letter
* rebased onto bpf-next/master and fixed merge conflicts
* "tools: sync bpf.h" also syncs comments that have previously changed in bpf-next
Patches in v5 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | bpf: add writable context for raw tracepointsinclude/ include/ include/ +5 more | +91 | 0 replies | |
| 2/5 | nbd: trace sending nbd requestsMAINTAINERS drivers/ include/ | +62 | 0 replies | |
| 3/5 | nbd: add tracepoints for send/receive timingdrivers/ include/ | +59 | 0 replies | |
| 4/5 | tools: sync bpf.htools/ tools/ tools/ | +11 | 0 replies | |
| 5/5 | selftests: bpf: test writable buffers in raw tpsinclude/ net/ tools/ +2 more | +210 | 0 replies |
Reviews trailers per patch
All 5 patches have a Reviewed-by or Acked-by.
| Patch | Yonghong Song | Josef Bacik |
|---|---|---|
| 1/5 | A-b | |
| 2/5 | R-b | |
| 3/5 | R-b | |
| 4/5 | A-b | |
| 5/5 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH bpf-next v5 0/5] writable contexts for bpf raw tracepoints
This adds an opt-in interface for tracepoints to expose a writable context to BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE programs that are attached, while supporting read-only access from existing BPF_PROG_TYPE_RAW_TRACEPOINT programs, as well as from non-BPF-based tracepoints.
The initial motivation is to support tracing that can be observed from the remote end of an NBD socket, e.g. by adding flags to the struct nbd_request header. Earlier attempts included adding an NBD-specific tracepoint fd, but in code review, I was recommended to implement it more generically -- as a result, this patchset is far simpler than my initial try.
v4->v5:
* rebased onto bpf-next/master and fixed merge conflicts
* "tools: sync bpf.h" also syncs comments that have previously changed in bpf-next
v3->v4:
* fixed a silly copy/paste typo in include/trace/events/bpf_test_run.h
(_TRACE_NBD_H -> _TRACE_BPF_TEST_RUN_H)
* fixed incorrect/misleading wording in patch 1's commit message, since the pointer cannot be directly dereferenced in a BPF_PROG_TYPE_RAW_TRACEPOINT
* cleaned up the error message wording if the prog_tests fail
* Addressed feedback from Yonghong
* reject non-pointer-sized accesses to the buffer pointer
* use sizeof(struct nbd_request) as one-byte-past-the-end in raw_tp_writable_reject_nbd_invalid.c
* use BPF_MOV64_IMM instead of BPF_LD_IMM64
v2->v3:
* Andrew addressed Josef's comments:
* C-style commenting in nbd.c
* Collapsed identical events into a single DECLARE_EVENT_CLASS. This saves about 2kB of kernel text
v1->v2:
* add selftests
* sync tools/include/uapi/linux/bpf.h
* reject variable offset into the buffer
* add string representation of PTR_TO_TP_BUFFER to reg_type_str
Andrew Hall (1):
nbd: add tracepoints for send/receive timing
Matt Mullins (4):
bpf: add writable context for raw tracepoints
nbd: trace sending nbd requests
tools: sync bpf.h
selftests: bpf: test writable buffers in raw tps
MAINTAINERS | 1 + drivers/block/nbd.c | 13 +++ include/linux/bpf.h | 2 + include/linux/bpf_types.h | 1 + include/linux/tracepoint-defs.h | 1 + include/trace/bpf_probe.h | 27 ++++- include/trace/events/bpf_test_run.h | 50 ++++++++ include/trace/events/nbd.h | 107 ++++++++++++++++++ include/uapi/linux/bpf.h | 1 + kernel/bpf/syscall.c | 8 +- kernel/bpf/verifier.c | 31 +++++ kernel/trace/bpf_trace.c | 24 ++++ net/bpf/test_run.c | 4 + tools/include/uapi/linux/bpf.h | 10 +- tools/lib/bpf/libbpf.c | 1 + tools/lib/bpf/libbpf_probes.c | 1 + .../raw_tp_writable_reject_nbd_invalid.c | 42 +++++++ .../bpf/prog_tests/raw_tp_writable_test_run.c | 80 +++++++++++++ .../selftests/bpf/verifier/raw_tp_writable.c | 34 ++++++ 19 files changed, 433 insertions(+), 5 deletions(-) create mode 100644 include/trace/events/bpf_test_run.h create mode 100644 include/trace/events/nbd.h create mode 100644 tools/testing/selftests/bpf/prog_tests/raw_tp_writable_reject_nbd_invalid.c create mode 100644 tools/testing/selftests/bpf/prog_tests/raw_tp_writable_test_run.c create mode 100644 tools/testing/selftests/bpf/verifier/raw_tp_writable.c
Signature · 1 line
2.17.1