Received: by 10.213.65.68 with SMTP id h4csp723043imn; Fri, 6 Apr 2018 07:52:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/CbKGzATE/gIR6IUhJXzK5THWjqd+2gwVkTbDJCsRo4feMHvLi8BXSGU93fXrIoEEnkMfc X-Received: by 2002:a17:902:4481:: with SMTP id l1-v6mr27845554pld.43.1523026362483; Fri, 06 Apr 2018 07:52:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523026362; cv=none; d=google.com; s=arc-20160816; b=if7RXyXciktc8Z47U0KJ3ygZgAL9ckf2fU5v7Sem1ffVcvqd6T2sSW6NQvVsIg7cPV +GfOlryfXFM3Gk5gdN2zRqupEqwLvyavHAs9CKf7e8UWhtAtNZsX62t9vub0//nBx4l3 +VMool2+QXhivFAMYHpbQl+o2qeXD8Z6prYYzT8RI6/S5BWgJaF1wCKgnV+lTULnme69 sSDnVa6gZ355uYRLhAenHPDjONp0T6ak0C+aP0ITfv1R/FQXkWHQp/CkymNNZLO2g4nr e+g6U6vpKt3f8hgy3gEFU8yH1JDcTZDKndyL0G/m6raw/6EcMYBKHc0q7on8E3pY1Cm6 6wmA== 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=asmBrGXG2eqg88KpLp5A0y9objq4BhSg+pltcHW+lFs=; b=wT+Vf52a7e4zPWH32qVEqjnYqyD1Zgt+KY1QDBSWD/uM+38XClyd+ViyxX9byei377 rR4tNyrv9T8+cJZWgy0o8QlqAVBqR7/pQuLpDSLRizCcmD8qr6R8IDHlAa3T+rKi3SAi 1gZUi3eM0luLMzmKs8R37yPh4aicw3ImM1UWDPUj7e2U/HBDp0YX6+nqxjIbPjDALdnW 7ofHuSozQTKTHhtpWg9CKeqq00FX7OS4yD7W97CsFOgIfB9jauEBiMndqkHgGePMrw8B ZVieDcjKtqwjMZ67EdnvqWi8kEkIgd7HNpec/UioG5aFtVXbqAAtrl5W82fr/AW4N0L5 thtw== 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 l84si8151468pfj.344.2018.04.06.07.52.28; Fri, 06 Apr 2018 07:52:42 -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 S1755433AbeDFNcs (ORCPT + 99 others); Fri, 6 Apr 2018 09:32:48 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57644 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755363AbeDFNco (ORCPT ); Fri, 6 Apr 2018 09:32:44 -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 1D104C7C; Fri, 6 Apr 2018 13:32:43 +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.9 010/102] powerpc/64s: Fix i-side SLB miss bad address handler saving nonvolatile GPRs Date: Fri, 6 Apr 2018 15:22:51 +0200 Message-Id: <20180406084333.042021081@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084331.507038179@linuxfoundation.org> References: <20180406084331.507038179@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: 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 @@ -723,7 +723,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