Received: by 10.213.65.68 with SMTP id h4csp694311imn; Fri, 6 Apr 2018 07:24:34 -0700 (PDT) X-Google-Smtp-Source: AIpwx49WyAqzCyFWheCjwuQRgjT5G+k60UBiYumEyFPIy4w7/mG2bAPYzB5GoOKKdRL940OHlRDy X-Received: by 2002:a17:902:28c4:: with SMTP id f62-v6mr27697792plb.19.1523024674640; Fri, 06 Apr 2018 07:24:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523024674; cv=none; d=google.com; s=arc-20160816; b=LejRcUbKqGdZiZ3KNqtzyHa+agbCA/KHxSUNqP6QMqYeRpf9LdmVHQiWE7y1ff3k+b 8YIUEMEUjxX1alXEuwPvHkN7ZsKx3shuznkQ66kXLiWZf2b3/Lm1l1dNXb9LckXNmxbb vg+dPp6PWnNNUIVmdI0F/kUFYn406BdSaRqawlM5wqT9C4lwCCvnGs8D/Q5/s22BttLc 9yVuoSkm0alXlXefVwre4KiHDcQW6jfZbWA+Kk7AxZspP+7M/X81KCvnkYzcXYYKXRyJ N1qfe5jf54vHf7DLkMM5exU0Un+6WhhGxCfOJ3CvASRQD+MOEMYt8AeYxR+5OAUDu3n5 HTOA== 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=12UodKDCVl5J0MGmsevoAOTi+rmGPm2Dg127a7tau2w=; b=a+5UJ9LkFrtP3D73DWOptNnsLo+EoWSVWpMIlY/5d8dj0dFUTYsYQqxe0zDuLjufh5 s4lEZ0vYrcxVwQNGA7VYeHPGYPHuxPvD4htWsGqUdTY3mOB/2PVfXUECNVOPaLWuVE8f KUthjyCGuhyxNupVtFr0RZceMeZ9nF61LPQhvZE+ZQ+sfSdcGgIMV68GMCBroaceyP4H 5L90+FQdK76EA2psVrmEQgu0E/C3cPHAvRuq6OVOWKINHyL4DyPhKEsDX9N+Ok6IjndK zAflSyFByZ/luSaz0pxkPvFDbLhTx7Gi8Blzy1/59J1NnIV2bwInPJpLBKkIR/bdlHfC 1IQA== 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 k64si7201448pge.113.2018.04.06.07.24.20; Fri, 06 Apr 2018 07:24:34 -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 S1756671AbeDFOXU (ORCPT + 99 others); Fri, 6 Apr 2018 10:23:20 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33062 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932309AbeDFNhp (ORCPT ); Fri, 6 Apr 2018 09:37:45 -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 F1CC62D; Fri, 6 Apr 2018 13:37:44 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicholas Piggin , Michael Ellerman Subject: [PATCH 4.14 16/67] powerpc/64s: Fix i-side SLB miss bad address handler saving nonvolatile GPRs Date: Fri, 6 Apr 2018 15:23:46 +0200 Message-Id: <20180406084343.451696008@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084341.225558262@linuxfoundation.org> References: <20180406084341.225558262@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nicholas Piggin commit 52396500f97c53860164debc7d4f759077853423 upstream. The SLB bad address handler's trap number fixup does not preserve the low bit that indicates nonvolatile GPRs have not been saved. This leads save_nvgprs to skip saving them, and subsequent functions and return from interrupt will think they are saved. This causes kernel branch-to-garbage debugging to not have correct registers, can also cause userspace to have its registers clobbered after a segfault. Fixes: f0f558b131db ("powerpc/mm: Preserve CFAR value on SLB miss caused by access to bogus address") Cc: stable@vger.kernel.org # v4.9+ Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/exceptions-64s.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S @@ -704,7 +704,7 @@ EXC_COMMON_BEGIN(bad_addr_slb) ld r3, PACA_EXSLB+EX_DAR(r13) std r3, _DAR(r1) beq cr6, 2f - li r10, 0x480 /* fix trap number for I-SLB miss */ + li r10, 0x481 /* fix trap number for I-SLB miss */ std r10, _TRAP(r1) 2: bl save_nvgprs addi r3, r1, STACK_FRAME_OVERHEAD