summaryrefslogtreecommitdiff
path: root/Documentation/gpu/intel-display/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2026-06-07 21:05:15 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2026-06-10 18:56:01 -0300
commit9c74f0aab398cb32ab250401f323c0fdc9a3a496 (patch)
tree6cdc1bdd47d12dcffa6c841c69d1b5dd91894ff6 /Documentation/gpu/intel-display/git@git.tavy.me:linux.git
parent6eaa8ee3e2abe5112e80e94c27196bb175689469 (diff)
perf symbols: Bounds-check .gnu_debuglink section data
filename__read_debuglink() copies .gnu_debuglink section data into a caller-provided buffer via: strncpy(debuglink, data->d_buf, size); where size is PATH_MAX. If the ELF section is smaller than size and lacks a null terminator, strncpy reads past data->d_buf into adjacent memory. A malformed ELF file can trigger this, potentially causing a segfault or leaking heap data. Additionally, strncpy does not guarantee null termination when the source fills the buffer. Replace with an explicit memcpy bounded by both the output buffer size and the actual section data size (data->d_size), followed by explicit null termination. Fixes: e5a1845fc0aeca85 ("perf symbols: Split out util/symbol-elf.c") Reported-by: sashiko-bot <sashiko-bot@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Assisted-by: Claude:claude-opus-4.6 Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'Documentation/gpu/intel-display/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions