Received: by 10.192.165.148 with SMTP id m20csp2434569imm; Sun, 22 Apr 2018 07:03:24 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/4Q3yQsj0WqHMuWye53246VHKxByVwHZlKKJsTZWaU0g6bq1ZFmj/98bbyhmPhlztbAK9q X-Received: by 2002:a17:902:9a44:: with SMTP id x4-v6mr17840584plv.312.1524405804202; Sun, 22 Apr 2018 07:03:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524405804; cv=none; d=google.com; s=arc-20160816; b=IQnnYV7aCVXk1bFbj6TaaSHWQoe/dCWmdouK0C2XItxx+meC0kmsYmSMPgiVd+BgFG Rz2BdMIOSz2gWdqqnz95Hvti/r7q2DIXf35TV64NRSfbFwhiESehlRSncdhw9UT1GBhe p4xIQ0V/dfAQmX88DYRLiue0AlO3J67t/Ikbn5IzUiHA9F26KAleDhWECBfDPwTiA7LK MMZwIUgGyknDyEM6n49wHD122fd0i9vziA4nE69KwWP2VKYZ3bHcZ89DDOdIVNMuMBCK lVNeuGABeFkFLGL0ZH+jI0ok6PjPuLIU2kcT9Ijh4UZXO3ErTW7GZ+3stA+GbihbiXxW /8/w== 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=B2Z6jrr50MzBKxwv/fg2uBFq4mfctJ/WGXGXBzI3P4M=; b=z9FcilDOFLRZ0HynMpBV0km7XmHHIXiPXIAMMrKnmoifylT6LvjXbN4/G5WmHOiltt JBk6RY3Hmk2kCta4/DFbcdjngaooBSyKeSjCXN09kgxuiXFxS34v8E5CKazcYbv0OSPf D5B/0iHiDXrSdfzIb5NjFRnR/ghOOkU3fZcMsMmAAPGjJ6bLGpoLb0Fknf0vwOwzcuqk e8Ba9hU8Phf6QZvo/2X8p0CC/4Yj+o6iGuWDvjP8pFWXzuYckh1P5t8hpBCRFLlKRRs0 e0F1+O6yeQDgS57h2bV017nerr7gwmbS1EY6Vo5RGW/ZT2vfEVt2i9k3dfTBsEyy1qeX i2Ng== 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 b38-v6si10157867pla.124.2018.04.22.07.03.10; Sun, 22 Apr 2018 07:03:24 -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 S1754804AbeDVOCK (ORCPT + 99 others); Sun, 22 Apr 2018 10:02:10 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48314 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754568AbeDVOCH (ORCPT ); Sun, 22 Apr 2018 10:02:07 -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 31214941; Sun, 22 Apr 2018 14:02:06 +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.16 173/196] MIPS: uaccess: Add micromips clobbers to bzero invocation Date: Sun, 22 Apr 2018 15:53:13 +0200 Message-Id: <20180422135113.201192144@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@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.16-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 @@ -654,6 +654,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" @@ -663,7 +670,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__( @@ -674,7 +681,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;