projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f398238
)
perf build-id: Truncate to avoid overflowing the build_id data
author
Ian Rogers
<irogers@google.com>
Thu, 24 Jul 2025 16:32:42 +0000
(09:32 -0700)
committer
Namhyung Kim
<namhyung@kernel.org>
Thu, 24 Jul 2025 20:50:17 +0000
(13:50 -0700)
Warning when the build_id data would be overflowed would lead to
memory corruption, switch to truncation.
Signed-off-by: Ian Rogers <irogers@google.com>
Link:
https://lore.kernel.org/r/20250724163302.596743-3-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/build-id.c
patch
|
blob
|
history
diff --git
a/tools/perf/util/build-id.c
b/tools/perf/util/build-id.c
index
e763e8d
..
5bc2040
100644
(file)
--- a/
tools/perf/util/build-id.c
+++ b/
tools/perf/util/build-id.c
@@
-951,7
+951,10
@@
bool perf_session__read_build_ids(struct perf_session *session, bool with_hits)
void build_id__init(struct build_id *bid, const u8 *data, size_t size)
{
- WARN_ON(size > BUILD_ID_SIZE);
+ if (size > BUILD_ID_SIZE) {
+ pr_debug("Truncating build_id size from %zd\n", size);
+ size = BUILD_ID_SIZE;
+ }
memcpy(bid->data, data, size);
bid->size = size;
}