aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/flamegraph.py
diff options
context:
space:
mode:
authorSong Liu <[email protected]>2022-02-17 10:30:01 -0800
committerAlexei Starovoitov <[email protected]>2022-02-17 13:15:36 -0800
commitd24d2a2b0a81dd5e9bb99aeb4559ec9734e1416f (patch)
treea5995c6791568b5220f927ffd228cf89c35087c9 /tools/perf/scripts/python/flamegraph.py
parentb75dacaac4650478ed5a9d33975b91b99016daff (diff)
bpf: bpf_prog_pack: Set proper size before freeing ro_header
bpf_prog_pack_free() uses header->size to decide whether the header should be freed with module_memfree() or the bpf_prog_pack logic. However, in kvmalloc() failure path of bpf_jit_binary_pack_alloc(), header->size is not set yet. As a result, bpf_prog_pack_free() may treat a slice of a pack as a standalone kvmalloc'd header and call module_memfree() on the whole pack. This in turn causes use-after-free by other users of the pack. Fix this by setting ro_header->size before freeing ro_header. Fixes: 33c9805860e5 ("bpf: Introduce bpf_jit_binary_pack_[alloc|finalize|free]") Reported-by: [email protected] Reported-by: [email protected] Reported-by: [email protected] Signed-off-by: Song Liu <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/flamegraph.py')
0 files changed, 0 insertions, 0 deletions