Fix unaligned enum values in btf_dump
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest2 patches 0 repliesNew
- v22 patches 1 replySuperseded
- v11 patch 2 repliesSuperseded
Changes in v3 from the cover letter
- Do the alignment check before the size check (David).
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | libbpf: Fix sign extension of unaligned enums in btf_dump_get_enum_value()tools/ | +4 | 0 replies | |
| 2/2 | selftests/bpf: Dump unaligned enums and a zeroed fs_contexttools/ | +9 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH bpf-next v3 0/2] Fix unaligned enum values in btf_dump
btf_dump_get_enum_value() reads unaligned enum values through btf_dump_get_bitfield_value() with a zero bit size, which shifts a __u64 by 64. Patch 1 copies unaligned enum data into an aligned buffer instead, as btf_dump_int_data() does. Patch 2 adds the tests Alexei posted in the v1 review.
Changes in v3:
- Do the alignment check before the size check (David).
Changes in v2:
- Describe the undefined shift in the commit log.
- Drop the data_end check, which broke the dump of struct fs_context without emit_zeroes.
- Add the selftests from the v1 review.
v2: https://lore.kernel.org/bpf/[email protected]/
v1: https://lore.kernel.org/bpf/[email protected]/
Hungyu Lin (2):
libbpf: Fix sign extension of unaligned enums in
btf_dump_get_enum_value()
selftests/bpf: Dump unaligned enums and a zeroed fs_context
tools/lib/bpf/btf_dump.c | 13 ++++--------- tools/testing/selftests/bpf/prog_tests/btf_dump.c | 10 +++++++++- 2 files changed, 13 insertions(+), 10 deletions(-)
base-commit: 8835113107b2cf75df33a71e265cdeec5d5d13e0
Signature · 1 line
2.43.0