All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "avr32: fix copy_from_user()" has been added to the 4.7-stable tree
@ 2016-09-22 15:42 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-09-22 15:42 UTC (permalink / raw)
  To: viro, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    avr32: 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:
     avr32-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 <stable@vger.kernel.org> know about it.


>From 8630c32275bac2de6ffb8aea9d9b11663e7ad28e Mon Sep 17 00:00:00 2001
From: Al Viro <viro@zeniv.linux.org.uk>
Date: Fri, 9 Sep 2016 19:28:23 -0400
Subject: avr32: fix copy_from_user()

From: Al Viro <viro@zeniv.linux.org.uk>

commit 8630c32275bac2de6ffb8aea9d9b11663e7ad28e upstream.

really ugly, but apparently avr32 compilers turns access_ok() into
something so bad that they want it in assembler.  Left that way,
zeroing added in inline wrapper.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/avr32/include/asm/uaccess.h |   11 ++++++++++-
 arch/avr32/kernel/avr32_ksyms.c  |    2 +-
 arch/avr32/lib/copy_user.S       |    4 ++--
 3 files changed, 13 insertions(+), 4 deletions(-)

--- a/arch/avr32/include/asm/uaccess.h
+++ b/arch/avr32/include/asm/uaccess.h
@@ -74,7 +74,7 @@ extern __kernel_size_t __copy_user(void
 
 extern __kernel_size_t copy_to_user(void __user *to, const void *from,
 				    __kernel_size_t n);
-extern __kernel_size_t copy_from_user(void *to, const void __user *from,
+extern __kernel_size_t ___copy_from_user(void *to, const void __user *from,
 				      __kernel_size_t n);
 
 static inline __kernel_size_t __copy_to_user(void __user *to, const void *from,
@@ -88,6 +88,15 @@ static inline __kernel_size_t __copy_fro
 {
 	return __copy_user(to, (const void __force *)from, n);
 }
+static inline __kernel_size_t copy_from_user(void *to,
+					       const void __user *from,
+					       __kernel_size_t n)
+{
+	size_t res = ___copy_from_user(to, from, n);
+	if (unlikely(res))
+		memset(to + (n - res), 0, res);
+	return res;
+}
 
 #define __copy_to_user_inatomic __copy_to_user
 #define __copy_from_user_inatomic __copy_from_user
--- a/arch/avr32/kernel/avr32_ksyms.c
+++ b/arch/avr32/kernel/avr32_ksyms.c
@@ -36,7 +36,7 @@ EXPORT_SYMBOL(copy_page);
 /*
  * Userspace access stuff.
  */
-EXPORT_SYMBOL(copy_from_user);
+EXPORT_SYMBOL(___copy_from_user);
 EXPORT_SYMBOL(copy_to_user);
 EXPORT_SYMBOL(__copy_user);
 EXPORT_SYMBOL(strncpy_from_user);
--- a/arch/avr32/lib/copy_user.S
+++ b/arch/avr32/lib/copy_user.S
@@ -25,11 +25,11 @@
 	.align	1
 	.global	copy_from_user
 	.type	copy_from_user, @function
-copy_from_user:
+___copy_from_user:
 	branch_if_kernel r8, __copy_user
 	ret_if_privileged r8, r11, r10, r10
 	rjmp	__copy_user
-	.size	copy_from_user, . - copy_from_user
+	.size	___copy_from_user, . - ___copy_from_user
 
 	.global	copy_to_user
 	.type	copy_to_user, @function


Patches currently in stable-queue which might be from viro@zeniv.linux.org.uk 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-09-22 15:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-22 15:42 Patch "avr32: fix copy_from_user()" has been added to the 4.7-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.