aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <[email protected]>2025-01-21 20:12:36 +0000
committerSteven Rostedt (Google) <[email protected]>2025-01-21 20:22:41 +0000
commitf95ee542947d748d4ca01b4d3103dbdc4fdc8889 (patch)
treeeccd1d9949f1af3b7868cf8e18d99b818ac423f0
parenttracing: Rename update_cache() to update_mod_cache() (diff)
downloadkernel-f95ee542947d748d4ca01b4d3103dbdc4fdc8889.tar.gz
kernel-f95ee542947d748d4ca01b4d3103dbdc4fdc8889.zip
tracing: Fix allocation of printing set_event file content
The adding of cached events for modules not loaded yet required a descriptor to separate the iteration of events with the iteration of cached events for a module. But the allocation used the size of the pointer and not the size of the contents to allocate its data and caused a slab-out-of-bounds. Cc: Masami Hiramatsu <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Linus Torvalds <[email protected]> Link: https://lore.kernel.org/[email protected] Reported-by: Sasha Levin <[email protected]> Closes: https://lore.kernel.org/all/Z4_OHKESRSiJcr-b@lappy/ Fixes: b355247df104e ("tracing: Cache ":mod:" events for modules not loaded yet") Signed-off-by: Steven Rostedt (Google) <[email protected]>
-rw-r--r--kernel/trace/trace_events.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 51c5014877e8..5217dcddcb4c 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -1588,7 +1588,7 @@ static void *s_start(struct seq_file *m, loff_t *pos)
struct set_event_iter *iter;
loff_t l;
- iter = kzalloc(sizeof(iter), GFP_KERNEL);
+ iter = kzalloc(sizeof(*iter), GFP_KERNEL);
if (!iter)
return NULL;