bpf: fix null pointer access for malformed BPF_CORE_TYPE_ID_LOCAL relos
Status from this message: This series was applied to bpf/bpf-next.git (master)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest2 patches 0 repliesApplied 2/2
- v22 patches 7 repliesSuperseded
Changes in v3 from the cover letter
- selftest update suggested by Andrii:
avoid memset(0) for log buffer and do memset(0) for bpf_attr.
Patches in v3 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | bpf: correctly handle malformed BPF_CORE_TYPE_ID_LOCAL reloskernel/ | +8 | 0 replies | Applied |
| 2/2 | selftests/bpf: test for malformed BPF_CORE_TYPE_ID_LOCAL relocationtools/ | +125 | 0 replies | Applied |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | Andrii Nakryiko |
|---|---|
| 1/2 | A-b |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH bpf-next v3 0/2] bpf: fix null pointer access for malformed BPF_CORE_TYPE_ID_LOCAL relos
Liu RuiTong reported an in-kernel null pointer derefence when processing BPF_CORE_TYPE_ID_LOCAL relocations referencing non-existing BTF types. Fix this by adding proper id checks.
Changes v2->v3:
- selftest update suggested by Andrii:
avoid memset(0) for log buffer and do memset(0) for bpf_attr.
Changes v1->v2:
- moved check from bpf_core_calc_relo_insn() to bpf_core_apply() now both in kernel and in libbpf relocation type id is guaranteed to exist when bpf_core_calc_relo_insn() is called;
- added a test case.
v1: https://lore.kernel.org/bpf/[email protected]/
v2: https://lore.kernel.org/bpf/[email protected]/
Eduard Zingerman (2):
bpf: correctly handle malformed BPF_CORE_TYPE_ID_LOCAL relos selftests/bpf: test for malformed BPF_CORE_TYPE_ID_LOCAL relocation
kernel/bpf/btf.c | 8 ++ .../selftests/bpf/prog_tests/core_reloc_raw.c | 125 ++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 tools/testing/selftests/bpf/prog_tests/core_reloc_raw.c
Signature · 1 line
2.45.2