mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	media: v4l2-core: Avoid the dangling pointer in v4l2_fh_release
A use after free bug caused by the dangling pointer filp->privitate_data in v4l2_fh_release. See https://lore.kernel.org/patchwork/patch/1419058/. My patch sets the dangling pointer to NULL to provide robust. Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
		
							parent
							
								
									01fe904c9a
								
							
						
					
					
						commit
						7dd0c9e547
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		| 
						 | 
					@ -96,6 +96,7 @@ int v4l2_fh_release(struct file *filp)
 | 
				
			||||||
		v4l2_fh_del(fh);
 | 
							v4l2_fh_del(fh);
 | 
				
			||||||
		v4l2_fh_exit(fh);
 | 
							v4l2_fh_exit(fh);
 | 
				
			||||||
		kfree(fh);
 | 
							kfree(fh);
 | 
				
			||||||
 | 
							filp->private_data = NULL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue