diff options
| author | Namhyung Kim <namhyung@kernel.org> | 2026-07-10 17:32:35 -0700 |
|---|---|---|
| committer | Namhyung Kim <namhyung@kernel.org> | 2026-07-16 09:56:47 -0700 |
| commit | eadce0f46a1d066b812c7e5aa46a33711c78a755 (patch) | |
| tree | e882005748ece9a43c5582ef1611646f81ce1364 /scripts/Makefile.thinlto | |
| parent | 557f8b3ca8c8e58d5bc3084734bc7a470b043922 (diff) | |
tools/lib/api: Fix potential double-free from fdarray__grow()
If the realloc for fda->entries succeeds but the realloc for fda->priv
fails, the error path frees the newly allocated entries.
However, fda->entries is neither updated to point to the new entries block
nor cleared to NULL. If realloc moved the allocation to a new block, the
old fda->entries pointer is now freed memory.
When fdarray__exit() is later called to clean up, it executes
free(fda->entries), which would trigger a double-free on that old pointer.
Reported-by: Sashiko Review <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/linux-perf-users/20260710200150.11FE71F00A3A@smtp.kernel.org
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
