mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 08:44:41 +00:00 
			
		
		
		
	binfmt_flat: use clear_user() rather than memset() to clear .bss
This is needed on systems with a MMU. Signed-off-by: Nicolas Pitre <nico@linaro.org> Reviewed-by: Greg Ungerer <gerg@linux-m68k.org> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
This commit is contained in:
		
							parent
							
								
									1b2ce442ea
								
							
						
					
					
						commit
						467aa1465a
					
				
					 1 changed files with 5 additions and 4 deletions
				
			
		|  | @ -795,10 +795,11 @@ static int load_flat_file(struct linux_binprm *bprm, | |||
| 	flush_icache_range(start_code, end_code); | ||||
| 
 | ||||
| 	/* zero the BSS,  BRK and stack areas */ | ||||
| 	memset((void *)(datapos + data_len), 0, bss_len + | ||||
| 	if (clear_user((void __user *)(datapos + data_len), bss_len + | ||||
| 		       (memp + memp_size - stack_len -		/* end brk */ | ||||
| 		       libinfo->lib_list[id].start_brk) +	/* start brk */ | ||||
| 			stack_len); | ||||
| 		       stack_len)) | ||||
| 		return -EFAULT; | ||||
| 
 | ||||
| 	return 0; | ||||
| err: | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Nicolas Pitre
						Nicolas Pitre