From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:39886 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932885AbcI2JHM (ORCPT ); Thu, 29 Sep 2016 05:07:12 -0400 From: Jiri Slaby To: stable@vger.kernel.org Cc: Al Viro , Jiri Slaby Subject: [patch added to 3.12-stable] sparc32: fix copy_from_user() Date: Thu, 29 Sep 2016 11:06:50 +0200 Message-Id: <20160929090654.27405-39-jslaby@suse.cz> In-Reply-To: <20160929090654.27405-1-jslaby@suse.cz> References: <20160929090654.27405-1-jslaby@suse.cz> Sender: stable-owner@vger.kernel.org List-ID: From: Al Viro This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. =============== commit 917400cecb4b52b5cde5417348322bb9c8272fa6 upstream. Acked-by: David S. Miller Signed-off-by: Al Viro Signed-off-by: Jiri Slaby --- arch/sparc/include/asm/uaccess_32.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/sparc/include/asm/uaccess_32.h b/arch/sparc/include/asm/uaccess_32.h index 53a28dd59f59..01f602858de1 100644 --- a/arch/sparc/include/asm/uaccess_32.h +++ b/arch/sparc/include/asm/uaccess_32.h @@ -265,8 +265,10 @@ static inline unsigned long copy_from_user(void *to, const void __user *from, un { if (n && __access_ok((unsigned long) from, n)) return __copy_user((__force void __user *) to, from, n); - else + else { + memset(to, 0, n); return n; + } } static inline unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n) -- 2.10.0