Received: by 10.213.65.68 with SMTP id h4csp666793imn; Fri, 6 Apr 2018 07:02:04 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/4TxRgMCsgIfrUsSackEGJ2xmt2ncHmvJoyfOatk4bh+LFBIlQYEYYwcnzUAuvZ/PbZS3S X-Received: by 2002:a17:902:a701:: with SMTP id w1-v6mr27174610plq.109.1523023324756; Fri, 06 Apr 2018 07:02:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523023324; cv=none; d=google.com; s=arc-20160816; b=oGjSSkqkfY0J/vyA6LUHsAfyplqYQDPzAXppR0afvsiH9z3ee2XNLWyn90eLuFVien N5YYmkc73X5jZZ6rFjRKwFWRsjsFtX/M+N/SwBXfZBbRuoxD1Q8ElNsS5/N4hoyjA7fa SnzGjhSpQUED4qe6r3y4uUzCvWmdPNTKfq8OTs4NikciivMaNM45rLoWmze8qnWB82Rs xGfZHQ4210k6jraOy6Ry9joEQK/x24EUaVpQ2JKpb2UD9VHYEZkjjE9Y7R9/Em1r8Dqa iMh6PPmC/ii0hDQrdxUh+4PNfiP9CTPsyzKgRausd/lLZFmZdzi4FT7pVTBIanJ8tGDy ftaA== 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=ia6k1I8n668hnHD3OTrUNhpku4FwYs4LbWEGE9oNcRA=; b=JtNcI7sdnLTVv4O03wyple+shD84GHcXEYTTz3ZXo+t0yviMEMnN+1wdgdQpRydXkZ ldGTfr8TpLHtYfHO5mteXwJ2wWNi52s7vnn2Ut+zgPsmwmVwUJkE4aOJaTYZZwQaWDIo oUzNst/DIQdKU1mfEDbTTcaXUBs8UX93TkWyRY8EzSSWWNJ72aU5HG8QKMJim+tuBwgk 0xXo6kHkSZqP9RG+BKp17p5bZmvwjRuokno1mwRmbRVLf+ABEeslajHgPNuTXmA9vYOD Dya2G/AC0w3linZV6wCCIJJBru4Q3pWBIEDkC0cnEme/pcUuTriret+j6al96j8/L0Rt wRPg== 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 az10-v6si8906914plb.145.2018.04.06.07.01.48; Fri, 06 Apr 2018 07:02:04 -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 S1753029AbeDFOA1 (ORCPT + 99 others); Fri, 6 Apr 2018 10:00:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37014 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752759AbeDFNma (ORCPT ); Fri, 6 Apr 2018 09:42:30 -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 01148C64; Fri, 6 Apr 2018 13:42:29 +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.15 18/72] powerpc/64s: Fix i-side SLB miss bad address handler saving nonvolatile GPRs Date: Fri, 6 Apr 2018 15:23:53 +0200 Message-Id: <20180406084350.948403208@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084349.367583460@linuxfoundation.org> References: <20180406084349.367583460@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.15-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 @@ -706,7 +706,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