Fix buffer overrun in sched_getaffinity
Zeroing of the cpu array should start from &cpus[kernel_ret] not &cpus[num_zeros_to_fill]. This fixes a crash in EFL's edje_cc running under qemu-arm. Signed-off-by: Mike McCormack <mj.mccormack@samsung.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
This commit is contained in:
		
							parent
							
								
									6f11f013a5
								
							
						
					
					
						commit
						e95d3bf04d
					
				| 
						 | 
				
			
			@ -6505,7 +6505,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
 | 
			
		|||
                    unsigned long zero = arg2 - ret;
 | 
			
		||||
                    p = alloca(zero);
 | 
			
		||||
                    memset(p, 0, zero);
 | 
			
		||||
                    if (copy_to_user(arg3 + zero, p, zero)) {
 | 
			
		||||
                    if (copy_to_user(arg3 + ret, p, zero)) {
 | 
			
		||||
                        goto efault;
 | 
			
		||||
                    }
 | 
			
		||||
                    arg2 = ret;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue