Received: by 10.192.165.148 with SMTP id m20csp2480027imm; Sun, 22 Apr 2018 07:56:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/niDv6dPgsGq2gYOwVVyw51dMbqgl7dAcjzjyFxY+PoLI9jp7VFaSZAcS4pB1njGTIer7q X-Received: by 10.99.174.73 with SMTP id e9mr14132901pgp.38.1524408968102; Sun, 22 Apr 2018 07:56:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524408968; cv=none; d=google.com; s=arc-20160816; b=kx1npsoNhncrp9LrRe8h8aUvXvP5DS9/O6X0DmsHGiNDP3cXBSIB74Rn8iq8u4Amgp hQmqQJcb25K1kjOvYZXVI1pnWsb8pPg070kuJOvIBEgU+tZdLwMz/EqtUh8yoR+bUVN3 1kPh7/nY1r28CSUiGlRPsxo8Cyi12ZDGpp2s/NCnmMJqKiLqc+MS2hNnInw87UeF3VRq C5h/lF/R6dZwOlCLmaBQSYr4ZgXzqpeg2kfcrS7tl37W6JtjKpzmf865fsk9H4nYh2Qs Zpv6Cb3jVbw/BKoIWoK0aAWmWcJgkACjGPo/7oEFiA2lp6OhjvCMEDOm9Wvn1JlW3VrV JcVA== 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=STAQkNma3d/hiwRa9ALX5Yg2OUQJZqldljdOFHmqyx4=; b=ARov6BEeN9T06Smhf83e/t41Dxg5k9EkkZUwS348ofcQffPSFN6FKpYbrqw0M4suZp kM0JhBA2EeajXhBI6t3TM8nWbUqKDPU7QuYNOhXBbaPkGHfS4EmhOyhXLfQ99gLHyMxv QXQNgb8RZVmVIyA33Abwhm6oz6uFF1OaFvshKftPIgGIw4qJYsXe37c0F1+yHE8rJmuX aZ1ab4FRxaN0qbRp2b1pIYMp88wqwdvZar3Ke0JfPhpBKeg632RpqQKczQ8qME6m4Czj o9ebqgd01KLP/qJmagJxV+XNKix4+U6Nk4CrFJJVo75cAGDrum4MktRMne+2efpw3n5c a1Pw== 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 p13-v6si10059269pll.416.2018.04.22.07.55.54; Sun, 22 Apr 2018 07:56:08 -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 S1756995AbeDVOOY (ORCPT + 99 others); Sun, 22 Apr 2018 10:14:24 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56362 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756977AbeDVOOU (ORCPT ); Sun, 22 Apr 2018 10:14:20 -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 4F7CA4A5; Sun, 22 Apr 2018 14:14:19 +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.9 79/95] MIPS: uaccess: Add micromips clobbers to bzero invocation Date: Sun, 22 Apr 2018 15:53:48 +0200 Message-Id: <20180422135213.660341092@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135210.432103639@linuxfoundation.org> References: <20180422135210.432103639@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.9-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 @@ -1257,6 +1257,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" @@ -1266,7 +1273,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__( @@ -1277,7 +1284,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;