aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2017-11-08 10:02:13 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2018-01-25 19:34:31 -0500
commit47669fb6b5951d0e09fc99719653e0ac92b50b99 (patch)
treef640184dbb5f40b3391205b169f6e3a99b3c7e02
parent5bdd0c6f89fba430e18d636493398389dadc3b17 (diff)
alpha: osf_sys.c: fix put_tv32 regression
There was a typo in the new version of put_tv32() that caused an unguarded access of a user space pointer, and failed to return the correct result in gettimeofday(), wait4(), usleep_thread() and old_adjtimex(). This fixes it to give the correct behavior again. Cc: stable@vger.kernel.org Fixes: 1cc6c4635e9f ("osf_sys.c: switch handling of timeval32/itimerval32 to copy_{to,from}_user()") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--arch/alpha/kernel/osf_sys.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index ce3a675c0c4b..75a5c35a2067 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -964,8 +964,8 @@ static inline long
964put_tv32(struct timeval32 __user *o, struct timeval *i) 964put_tv32(struct timeval32 __user *o, struct timeval *i)
965{ 965{
966 return copy_to_user(o, &(struct timeval32){ 966 return copy_to_user(o, &(struct timeval32){
967 .tv_sec = o->tv_sec, 967 .tv_sec = i->tv_sec,
968 .tv_usec = o->tv_usec}, 968 .tv_usec = i->tv_usec},
969 sizeof(struct timeval32)); 969 sizeof(struct timeval32));
970} 970}
971 971