mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 00:28:52 +02:00 
			
		
		
		
	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: b355247df1 ("tracing: Cache ":mod:" events for modules not loaded yet")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
			
			
This commit is contained in:
		
							parent
							
								
									22412b72ca
								
							
						
					
					
						commit
						f95ee54294
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -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; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Steven Rostedt
						Steven Rostedt