]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
Fix order of arguments to compat_put_time[spec|val]
authorMikulas Patocka <mpatocka@redhat.com>
Sat, 1 Sep 2012 16:34:07 +0000 (12:34 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Sep 2012 17:00:23 +0000 (10:00 -0700)
commit43da476d7f734a1b55680668246d0237dde4ea57
tree109cac684c7f88772dcf89779f863730e70907ad
parent05d71a5a25da396f76ee942af6682dfaecc73e84
Fix order of arguments to compat_put_time[spec|val]

commit ed6fe9d614fc1bca95eb8c0ccd0e92db00ef9d5d upstream.

Commit 644595f89620 ("compat: Handle COMPAT_USE_64BIT_TIME in
net/socket.c") introduced a bug where the helper functions to take
either a 64-bit or compat time[spec|val] got the arguments in the wrong
order, passing the kernel stack pointer off as a user pointer (and vice
versa).

Because of the user address range check, that in turn then causes an
EFAULT due to the user pointer range checking failing for the kernel
address.  Incorrectly resuling in a failed system call for 32-bit
processes with a 64-bit kernel.

On odder architectures like HP-PA (with separate user/kernel address
spaces), it can be used read kernel memory.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/socket.c