diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-08-02 11:27:09 -0300 |
|---|---|---|
| committer | Namhyung Kim <namhyung@kernel.org> | 2026-08-05 11:20:02 -0700 |
| commit | 01765b456f850aed7475b37111f1c50bf76aaf51 (patch) | |
| tree | 54dc6d900c38aaa62913f19cdee51125f048c3fa /scripts/patch-kernel | |
| parent | 9dd7c82d462ee98b4b293a93b8fb3b6514e73820 (diff) | |
| download | linux-01765b456f850aed7475b37111f1c50bf76aaf51.tar.gz linux-01765b456f850aed7475b37111f1c50bf76aaf51.zip | |
perf libbfd: Validate BPF prog info arrays before pointer cast
symbol__disassemble_bpf_libbfd() casts info_linear->info.jited_prog_insns
and info_linear->info.jited_ksyms to pointers without checking whether
bpil_offs_to_addr() actually converted the file offsets. A crafted
perf.data with PERF_BPIL_* bits unset but non-zero counts causes raw
file offsets to be dereferenced as pointers.
Add bitmask checks for PERF_BPIL_JITED_INSNS and PERF_BPIL_JITED_KSYMS
before the casts, matching the validation added to bpf-event.c call
sites.
Fixes: 6987561c9e86 ("perf annotate: Enable annotation of BPF programs")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Cc: Song Liu <songliubraving@fb.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'scripts/patch-kernel')
0 files changed, 0 insertions, 0 deletions
