alpha: osf_sys.c: fix put_tv32 regression
authorArnd Bergmann <arnd@arndb.de>
Wed, 8 Nov 2017 15:02:13 +0000 (16:02 +0100)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 26 Jan 2018 00:34:31 +0000 (19:34 -0500)
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>
arch/alpha/kernel/osf_sys.c

index ce3a675c0c4bd76b3a4447daa9da32c18ee1459a..75a5c35a2067d05c10746138470249dfd6ba4e6a 100644 (file)
@@ -964,8 +964,8 @@ static inline long
 put_tv32(struct timeval32 __user *o, struct timeval *i)
 {
        return copy_to_user(o, &(struct timeval32){
-                               .tv_sec = o->tv_sec,
-                               .tv_usec = o->tv_usec},
+                               .tv_sec = i->tv_sec,
+                               .tv_usec = i->tv_usec},
                            sizeof(struct timeval32));
 }