Fix leaks in libbpf and selftests
Status from this message: Applied. Thanks
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest9 patches 1 replyApplied
- v39 patches 1 replySuperseded
- v29 patches 3 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 9 patches | 0 replies | Superseded |
Changes in v4 from the cover letter
- rebase on latest bpf-next;
Patches in v4 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | selftests/bpf: pass sanitizer flags to linker through LDFLAGStools/ | +1 | 0 replies | |
| 2/9 | libbpf: free up resources used by inner map definitiontools/ | +4 | 0 replies | |
| 3/9 | selftests/bpf: fix memory leaks in btf_type_c_dump() helpertools/ | +7 | 0 replies | |
| 4/9 | selftests/bpf: free per-cpu values array in bpf_iter selftesttools/ | +4 | 0 replies | |
| 5/9 | selftests/bpf: free inner strings index in btf selftesttools/ | +2 | 0 replies | |
| 6/9 | selftests/bpf: clean up btf and btf_dump in dump_datasec testtools/ | +6 | 0 replies | |
| 7/9 | selftests/bpf: avoid duplicate btf__parse() calltools/ | +1 | 0 replies | |
| 8/9 | selftests/bpf: destroy XDP link correctlytools/ | +2 | 0 replies | |
| 9/9 | selftests/bpf: fix bpf_object leak in skb_ctx selftesttools/ | +2 | 0 replies |
Reviews trailers per patch
8 of 9 patches have a Reviewed-by or Acked-by.
| Patch | Hengqi Chen |
|---|---|
| 1/9 | R-b |
| 2/9 | R-b |
| 3/9 | R-b |
| 4/9 | |
| 5/9 | R-b |
| 6/9 | R-b |
| 7/9 | R-b |
| 8/9 | R-b |
| 9/9 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 bpf-next 0/9] Fix leaks in libbpf and selftests
Fix all the memory leaks reported by ASAN. All but one are just improper resource clean up in selftests. But one memory leak was discovered in libbpf, leaving inner map's name leaked.
First patch fixes selftests' Makefile by passing through SAN_CFLAGS to linker. Without that compiling with SAN_CFLAGS=-fsanitize=address kept failing.
Running selftests under ASAN in BPF CI is the next step, we just need to make sure all the necessary libraries (libasan and liblsan) are installed on the host and inside the VM. Would be great to get some help with that, but for now make sure that test_progs run is clean from leak sanitizer errors.
v3->v4:
- rebase on latest bpf-next;v2->v3:
- fix per-cpu array memory leaks in btf_iter.c selftests (Hengqi);v1->v2:
- call bpf_map__destroy() conditionally if map->inner_map is present.
Andrii Nakryiko (9):
selftests/bpf: pass sanitizer flags to linker through LDFLAGS
libbpf: free up resources used by inner map definition selftests/bpf: fix memory leaks in btf_type_c_dump() helper selftests/bpf: free per-cpu values array in bpf_iter selftest selftests/bpf: free inner strings index in btf selftest selftests/bpf: clean up btf and btf_dump in dump_datasec test selftests/bpf: avoid duplicate btf__parse() call selftests/bpf: destroy XDP link correctly selftests/bpf: fix bpf_object leak in skb_ctx selftest
tools/lib/bpf/libbpf.c | 5 ++++- tools/testing/selftests/bpf/Makefile | 1 + tools/testing/selftests/bpf/btf_helpers.c | 9 +++++++-- tools/testing/selftests/bpf/prog_tests/bpf_iter.c | 8 ++++---- tools/testing/selftests/bpf/prog_tests/btf.c | 6 ++---- tools/testing/selftests/bpf/prog_tests/btf_dump.c | 8 ++++++-- tools/testing/selftests/bpf/prog_tests/core_reloc.c | 2 +- .../testing/selftests/bpf/prog_tests/migrate_reuseport.c | 4 ++-- tools/testing/selftests/bpf/prog_tests/skb_ctx.c | 2 ++ 9 files changed, 29 insertions(+), 16 deletions(-)
Signature · 1 line
2.30.2