mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	block: Clear kernel memory before copying to user
If the kernel allocates a bounce buffer for user read data, this memory needs to be cleared before copying it to the user, otherwise it may leak kernel memory to user space. Laurence Oberman <loberman@redhat.com> Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
		
							parent
							
								
									e31d36b0a4
								
							
						
					
					
						commit
						f3587d76da
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		| 
						 | 
					@ -1260,6 +1260,7 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
 | 
				
			||||||
		if (ret)
 | 
							if (ret)
 | 
				
			||||||
			goto cleanup;
 | 
								goto cleanup;
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
 | 
							zero_fill_bio(bio);
 | 
				
			||||||
		iov_iter_advance(iter, bio->bi_iter.bi_size);
 | 
							iov_iter_advance(iter, bio->bi_iter.bi_size);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue