Received: by 10.192.165.148 with SMTP id m20csp2466951imm; Sun, 22 Apr 2018 07:38:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx48C/MRdjKbr1OrIWTMQF9cGfaxfap3ixhE74N0keCgy4BLA4VP4UoDxIB/x6mXQaPCWNuuC X-Received: by 2002:a17:902:8d8b:: with SMTP id v11-v6mr18056634plo.9.1524407913557; Sun, 22 Apr 2018 07:38:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524407913; cv=none; d=google.com; s=arc-20160816; b=v7TWJmgXwDEUI5wdtjtfxnPmDTUMJqqWdBL6v34zjtdTFxhl02NgxjR2jX1PAZyv71 WvzfxB2RdEqfwmgxuVdhTnsiQkg584igtUqv41OSnW2bfDu/bwNKsYJk0PQe+bbn4AOj 88xo/Gw4m3Rp3Md+XyKBENNZ/24P6Qk73GWYJ5+keD6Gep18XWl3Bjl8EhG6wGzmvm3+ Dct5bwf4MMfqqYji8X23N1c0buVLX8VZBEflJV6fiuVRfhtGu7+OKgyK6ylX+3EJeoV+ vlgShLQbr50A7C+fuqNKajp+0rYpAzaQ170gehjWd6rrsB3VUGUmx9K9R67X6tusAOAl q19w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=MHm1/xchah81mEFay9oWCNm30KXyi7SAzdU0xTZCI9k=; b=pMRtbkXUZYm4eBN/eDq2S7QklQtqKjbya9zr3w1Z9rcA2LTxl1eDaANYOGWRupkieG yzT5NLd9AE3Mnn6TOVDeDz8hrOeocuCeoTTs/MiskcA6qVa1i/fRiddC6MetaWWdyE/u ImzhbfYD2jlXr540moLfuRCo5HdnMBSOgxZTefRiabm0razSMem33cCs8ZSR60UR5MLZ pOZXF07lYGRxhqoQPYaWGKt00Sm6Wk4ouPzGrHtcIvY6sEc7nq84KYV771k72EUmiFbe jjXXlDvgek03JXSC2yWayfK6RciL0ZUnoCc0ADDi0ICbOQU4qk19yJcNpJRa0QSwRltg 2/Hg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u36si2611775pgn.213.2018.04.22.07.38.19; Sun, 22 Apr 2018 07:38:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757298AbeDVOhP (ORCPT + 99 others); Sun, 22 Apr 2018 10:37:15 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59126 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932293AbeDVOSr (ORCPT ); Sun, 22 Apr 2018 10:18:47 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 684D8D0B; Sun, 22 Apr 2018 14:18:46 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Hogan , Matt Redfearn , Ralf Baechle , linux-mips@linux-mips.org Subject: [PATCH 4.4 82/97] MIPS: uaccess: Add micromips clobbers to bzero invocation Date: Sun, 22 Apr 2018 15:54:00 +0200 Message-Id: <20180422135309.683857392@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135304.577223025@linuxfoundation.org> References: <20180422135304.577223025@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Matt Redfearn commit b3d7e55c3f886493235bfee08e1e5a4a27cbcce8 upstream. The micromips implementation of bzero additionally clobbers registers t7 & t8. Specify this in the clobbers list when invoking bzero. Fixes: 26c5e07d1478 ("MIPS: microMIPS: Optimise 'memset' core library function.") Reported-by: James Hogan Signed-off-by: Matt Redfearn Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Cc: # 3.10+ Patchwork: https://patchwork.linux-mips.org/patch/19110/ Signed-off-by: James Hogan Signed-off-by: Greg Kroah-Hartman --- arch/mips/include/asm/uaccess.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) --- a/arch/mips/include/asm/uaccess.h +++ b/arch/mips/include/asm/uaccess.h @@ -1238,6 +1238,13 @@ __clear_user(void __user *addr, __kernel { __kernel_size_t res; +#ifdef CONFIG_CPU_MICROMIPS +/* micromips memset / bzero also clobbers t7 & t8 */ +#define bzero_clobbers "$4", "$5", "$6", __UA_t0, __UA_t1, "$15", "$24", "$31" +#else +#define bzero_clobbers "$4", "$5", "$6", __UA_t0, __UA_t1, "$31" +#endif /* CONFIG_CPU_MICROMIPS */ + if (eva_kernel_access()) { __asm__ __volatile__( "move\t$4, %1\n\t" @@ -1247,7 +1254,7 @@ __clear_user(void __user *addr, __kernel "move\t%0, $6" : "=r" (res) : "r" (addr), "r" (size) - : "$4", "$5", "$6", __UA_t0, __UA_t1, "$31"); + : bzero_clobbers); } else { might_fault(); __asm__ __volatile__( @@ -1258,7 +1265,7 @@ __clear_user(void __user *addr, __kernel "move\t%0, $6" : "=r" (res) : "r" (addr), "r" (size) - : "$4", "$5", "$6", __UA_t0, __UA_t1, "$31"); + : bzero_clobbers); } return res;