Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

regset: Return -EFAULT, not -EIO, on host-side memory fault

There is only one error code to return for a bad user-space buffer
pointer passed to a system call in the same address space as the
system call is executed, and that is EFAULT. Furthermore, the
low-level access routines, which catch most of the faults, return
EFAULT already.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Roland McGrath <roland@hack.frob.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

H. Peter Anvin and committed by
Linus Torvalds
5189fa19 c8e25258

+2 -2
+2 -2
include/linux/regset.h
··· 339 339 return -EOPNOTSUPP; 340 340 341 341 if (!access_ok(VERIFY_WRITE, data, size)) 342 - return -EIO; 342 + return -EFAULT; 343 343 344 344 return regset->get(target, regset, offset, size, NULL, data); 345 345 } ··· 365 365 return -EOPNOTSUPP; 366 366 367 367 if (!access_ok(VERIFY_READ, data, size)) 368 - return -EIO; 368 + return -EFAULT; 369 369 370 370 return regset->set(target, regset, offset, size, NULL, data); 371 371 }