mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	genirq: Fix chained interrupt data ordering
irq_set_chained_handler_and_data() sets up the chained interrupt and then stores the handler data. That's racy against an immediate interrupt which gets handled before the store of the handler data happened. The handler will dereference a NULL pointer and crash. Cure it by storing handler data before installing the chained handler. Reported-by: Borislav Petkov <bp@alien8.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable@vger.kernel.org
This commit is contained in:
		
							parent
							
								
									9459a04b6a
								
							
						
					
					
						commit
						2c4569ca26
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -880,8 +880,8 @@ irq_set_chained_handler_and_data(unsigned int irq, irq_flow_handler_t handle,
 | 
				
			||||||
	if (!desc)
 | 
						if (!desc)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	__irq_do_set_handler(desc, handle, 1, NULL);
 | 
					 | 
				
			||||||
	desc->irq_common_data.handler_data = data;
 | 
						desc->irq_common_data.handler_data = data;
 | 
				
			||||||
 | 
						__irq_do_set_handler(desc, handle, 1, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	irq_put_desc_busunlock(desc, flags);
 | 
						irq_put_desc_busunlock(desc, flags);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue