Thread (11 messages) flat view 11 messages, 2 authors, 21d ago

Re: [PATCH 5/5] perf jitdump: Size code_move event allocation with idr_size

From: sashiko-bot@kernel.org
Date: 2026-09-04 14:56:22

From: Arnaldo Carvalho de Melo <redacted>

jit_repipe_code_move() allocated the mmap2 event with a hardcoded
+16, but computes event->mmap2.header.size as sizeof(event->mmap2)
minus unused filename bytes plus idr_size.  When idr_size is larger
than 16, header.size exceeds the allocation, so perf_data__write()
reads past the heap allocation, leaking adjacent heap memory into the
generated perf.data file.

Size the allocation with idr_size like jit_repipe_code_load() does.

Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Cc: Stephane Eranian <redacted>
Assisted-by: LLM
Signed-off-by: Arnaldo Carvalho de Melo <redacted>
Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260904144058.3341-1-acme@kernel.org?part=5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help