lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 30 Jun 2020 23:45:22 -0700
From:   Andrii Nakryiko <andriin@...com>
To:     <bpf@...r.kernel.org>, <netdev@...r.kernel.org>, <ast@...com>,
        <daniel@...earbox.net>
CC:     <andrii.nakryiko@...il.com>, <kernel-team@...com>,
        Andrii Nakryiko <andriin@...com>,
        Anton Protopopov <a.s.protopopov@...il.com>
Subject: [PATCH bpf-next 0/3] Strip away modifiers from BPF skeleton global variables

Fix bpftool logic of stripping away const/volatile modifiers for all global
variables during BPF skeleton generation. See patch #1 for details on when
existing logic breaks and why it's important. Support special .strip_mods=true
mode in btf_dump. Add selftests validating that everything works as expected.

Recent example of when this has caused problems can be found in [0].

  [0] https://github.com/iovisor/bcc/pull/2994#issuecomment-650588533

Cc: Anton Protopopov <a.s.protopopov@...il.com>

Andrii Nakryiko (3):
  libbpf: support stripping modifiers for btf_dump
  selftests/bpf: add selftest validating btf_dump's mod-stripping output
  tools/bpftool: strip away modifiers from global variables

 tools/bpf/bpftool/gen.c                       | 13 ++---
 tools/lib/bpf/btf.h                           |  6 +++
 tools/lib/bpf/btf_dump.c                      | 18 +++++--
 .../selftests/bpf/prog_tests/btf_dump.c       |  5 +-
 .../selftests/bpf/prog_tests/skeleton.c       |  6 +--
 .../bpf/progs/btf_dump_test_case_strip_mods.c | 50 +++++++++++++++++++
 .../selftests/bpf/progs/test_skeleton.c       |  6 ++-
 7 files changed, 84 insertions(+), 20 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/btf_dump_test_case_strip_mods.c

-- 
2.24.1

Powered by blists - more mailing lists