Skip to content

Commit f95ee54

Browse files
committed
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 <mhiramat@kernel.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/20250121151236.47fcf433@gandalf.local.home Reported-by: Sasha Levin <sashal@kernel.org> Closes: https://lore.kernel.org/all/Z4_OHKESRSiJcr-b@lappy/ Fixes: b355247 ("tracing: Cache ":mod:" events for modules not loaded yet") Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 22412b7 commit f95ee54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/trace_events.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1588,7 +1588,7 @@ static void *s_start(struct seq_file *m, loff_t *pos)
15881588
struct set_event_iter *iter;
15891589
loff_t l;
15901590

1591-
iter = kzalloc(sizeof(iter), GFP_KERNEL);
1591+
iter = kzalloc(sizeof(*iter), GFP_KERNEL);
15921592
if (!iter)
15931593
return NULL;
15941594

0 commit comments

Comments
 (0)