mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	mips/ptrace: Preserve previous registers for short regset write
Ensure that if userspace supplies insufficient data to PTRACE_SETREGSET to fill all the registers, the thread's old registers are preserved. Signed-off-by: Dave Martin <Dave.Martin@arm.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
		
							parent
							
								
									7195ee3120
								
							
						
					
					
						commit
						d614fd58a2
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -485,7 +485,8 @@ static int fpr_set(struct task_struct *target,
 | 
			
		|||
					  &target->thread.fpu,
 | 
			
		||||
					  0, sizeof(elf_fpregset_t));
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < NUM_FPU_REGS; i++) {
 | 
			
		||||
	BUILD_BUG_ON(sizeof(fpr_val) != sizeof(elf_fpreg_t));
 | 
			
		||||
	for (i = 0; i < NUM_FPU_REGS && count >= sizeof(elf_fpreg_t); i++) {
 | 
			
		||||
		err = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
 | 
			
		||||
					 &fpr_val, i * sizeof(elf_fpreg_t),
 | 
			
		||||
					 (i + 1) * sizeof(elf_fpreg_t));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue