Patch "alpha: fix copy_from_user()" has been added to the 4.7-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
alpha: fix copy_from_user()
to the 4.7-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
alpha-fix-copy_from_user.patch
and it can be found in the queue-4.7 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
2561d309dfd1555e781484af757ed0115035ddb3Mon Sep 17 00:00:00 2001
From: Al Viro <[email protected]>
Date: Wed, 17 Aug 2016 16:02:32 -0400
Subject: alpha: fix copy_from_user()
From: Al Viro <[email protected]>
commit 2561d309dfd1555e781484af757ed0115035ddb3 upstream.
it should clear the destination even when access_ok() fails.
--- arch/alpha/include/asm/uaccess.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-)
arch/alpha/include/asm/uaccess.h +8 -11
@@ -371,14 +371,6 @@ __copy_tofrom_user_nocheck(void *to, conreturn __cu_len; } -extern inline long -__copy_tofrom_user (void *to,const void *from,long len,const void __user *validate) -{ -if (__access_ok ((unsigned long )validate, len,get_fs ())) - len =__copy_tofrom_user_nocheck (to, from, len); -return len; -} -#define __copy_to_user (to, from, n) \ ({ \ __chk_user_ptr(to); \
@@ -393,17 +385,22 @@ __copy_tofrom_user(void *to, const void#define __copy_to_user_inatomic __copy_to_user#define __copy_from_user_inatomic __copy_from_user -extern inline long copy_to_user (void __user *to,const void *from,long n) { -return __copy_tofrom_user ((__force void *)to, from, n, to); +if (likely (__access_ok ((unsigned long )to, n,get_fs ()))) + n =__copy_tofrom_user_nocheck ((__force void *)to, from, n); +return n; }extern inline long copy_from_user (void *to,const void __user *from,long n) { -return __copy_tofrom_user (to, (__force void *)from, n, from); +if (likely (__access_ok ((unsigned long )from, n,get_fs ()))) + n =__copy_tofrom_user_nocheck (to, (__force void *)from, n); +else +memset (to,0 , n); +return n; }extern void __do_clear_user (void );
Patches currently in stable-queue which might be from [email protected] are
queue-4.7/nios2-copy_from_user-should-zero-the-tail-of-destination.patch queue-4.7/m32r-fix-__get_user.patch queue-4.7/microblaze-fix-copy_from_user.patch queue-4.7/cris-buggered-copy_from_user-copy_to_user-clear_user.patch queue-4.7/asm-generic-make-copy_from_user-zero-the-destination-properly.patch queue-4.7/metag-copy_from_user-should-zero-the-destination-on-access_ok-failure.patch queue-4.7/score-fix-__get_user-get_user.patch queue-4.7/parisc-fix-copy_from_user.patch queue-4.7/mips-copy_from_user-must-zero-the-destination-on-access_ok-failure.patch queue-4.7/alpha-fix-copy_from_user.patch queue-4.7/mn10300-failing-__get_user-and-get_user-should-zero.patch queue-4.7/openrisc-fix-copy_from_user.patch queue-4.7/avr32-fix-copy_from_user.patch queue-4.7/score-fix-copy_from_user-and-friends.patch queue-4.7/sh64-failing-__get_user-should-zero.patch queue-4.7/arc-uaccess-get_user-to-zero-out-dest-in-cause-of-fault.patch queue-4.7/hexagon-fix-strncpy_from_user-error-return.patch queue-4.7/af_unix-split-u-readlock-into-two-iolock-and-bindlock.patch queue-4.7/frv-fix-clear_user.patch queue-4.7/fix-minor-infoleak-in-get_user_ex.patch queue-4.7/asm-generic-make-get_user-clear-the-destination-on-errors.patch queue-4.7/mn10300-copy_from_user-should-zero-on-access_ok-failure.patch queue-4.7/s390-get_user-should-zero-on-failure.patch queue-4.7/microblaze-fix-__get_user.patch queue-4.7/blackfin-fix-copy_from_user.patch queue-4.7/fix-iov_iter_fault_in_readable.patch queue-4.7/nios2-fix-__get_user.patch queue-4.7/sh-fix-copy_from_user.patch