mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	scsi: sg: allocate with __GFP_ZERO in sg_build_indirect()
This shall help avoid copying uninitialized memory to the userspace when calling ioctl(fd, SG_IO) with an empty command. Reported-by: syzbot+7d26fc1eea198488deab@syzkaller.appspotmail.com Cc: stable@vger.kernel.org Signed-off-by: Alexander Potapenko <glider@google.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
		
							parent
							
								
									a406b0a069
								
							
						
					
					
						commit
						a45b599ad8
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -1894,7 +1894,7 @@ sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size)
 | 
				
			||||||
		num = (rem_sz > scatter_elem_sz_prev) ?
 | 
							num = (rem_sz > scatter_elem_sz_prev) ?
 | 
				
			||||||
			scatter_elem_sz_prev : rem_sz;
 | 
								scatter_elem_sz_prev : rem_sz;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		schp->pages[k] = alloc_pages(gfp_mask, order);
 | 
							schp->pages[k] = alloc_pages(gfp_mask | __GFP_ZERO, order);
 | 
				
			||||||
		if (!schp->pages[k])
 | 
							if (!schp->pages[k])
 | 
				
			||||||
			goto out;
 | 
								goto out;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue