Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1489257 > unrolled thread

[PATCH 4.7 174/184] metag: copy_from_user() should zero the destination on access_ok() failure

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2016-09-22 20:00 +0200
Last post2016-09-22 20:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.7 174/184] metag: copy_from_user() should zero the destination on access_ok() failure Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-22 20:00 +0200

#1489257 — [PATCH 4.7 174/184] metag: copy_from_user() should zero the destination on access_ok() failure

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2016-09-22 20:00 +0200
Subject[PATCH 4.7 174/184] metag: copy_from_user() should zero the destination on access_ok() failure
Message-ID<skgrW-10r-117@gated-at.bofh.it>
4.7-stable review patch.  If anyone has any objections, please let me know.

------------------

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

commit 8ae95ed4ae5fc7c3391ed668b2014c9e2079533b upstream.

Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/metag/include/asm/uaccess.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/arch/metag/include/asm/uaccess.h
+++ b/arch/metag/include/asm/uaccess.h
@@ -204,8 +204,9 @@ extern unsigned long __must_check __copy
 static inline unsigned long
 copy_from_user(void *to, const void __user *from, unsigned long n)
 {
-	if (access_ok(VERIFY_READ, from, n))
+	if (likely(access_ok(VERIFY_READ, from, n)))
 		return __copy_user_zeroing(to, from, n);
+	memset(to, 0, n);
 	return n;
 }
 

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web