Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3529645pxf; Mon, 15 Mar 2021 11:35:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwERiq/TOdK4pnyrQVaVbrrtMFMqohrDXzU22ZCGKuOr3JfFzQi+laYTyGwOq+XvoLtuvMg X-Received: by 2002:aa7:c916:: with SMTP id b22mr32210919edt.299.1615833342543; Mon, 15 Mar 2021 11:35:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833342; cv=none; d=google.com; s=arc-20160816; b=DG69LXyCMEBnfhoBrJHgByJtmgpUQp/45Juat/vLdnwUQd+G+3tSUJbtUnj60e03hI bblLd1ucl7MLl1mjbFho+828mBs27RF4OwzC0cGvDnUD3CvG4AiAWNC9nYl5uTPbv9x4 OI/dIRWHD0xgbtNgEbzLY0AQT1Pc5vhFGLU+9ViJuGP4bFCvQqsvekmpbHpgVljAovVX cxGp2SCsC1IBamLtk0WtkIidTpo8Nk/9f0GirU0OiEmahfH2OL9w/IPoDCBEkz8vvJW8 mFuPXJWS5awnl0/Fqj8hKNUUYbf1uTWLIDqch1/HOvGmi0BSrL4rPwCU2n56DdkZyEXE dYGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=w9mwG/SnKI6Fjj0Igwr/E7lE/Fm5PdJDmYRFtyPeKa8=; b=YRAox/S83up5y0HRTbwkl+GBcWzU9TR0slYjjeTWL+ON89yinuICptQO7OdpA62UuE s6+/IWkE050RdahawPQQw/o2s48yZPSfRXIBifZi0HvTEw5n24oSoBGdSiouOyBJMkjA xwZ71HacSL97qU8Ro1GqsnV6RSIrCYe5aQG0t6vsByA1v6dxEPwlyg39S66i1D0r010e 59Ihefh9z4HrePzSPECSB5ToDjD9JArzk2ITL2tvyn6WJkGfYEE0iq+LoW9l6O+ogSoP wtfx2nPrm9E+uFvnXRgSc8G8OkZSoV8k+UrPe+I0FwwbsXPYQsTuJGVytQuXpRFJRX+J m5lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vAEwH1gY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f8si12011610ejw.51.2021.03.15.11.35.20; Mon, 15 Mar 2021 11:35:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vAEwH1gY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239063AbhCOOpt (ORCPT + 99 others); Mon, 15 Mar 2021 10:45:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:52486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234589AbhCOOE1 (ORCPT ); Mon, 15 Mar 2021 10:04:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9F04364EF9; Mon, 15 Mar 2021 14:04:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615817060; bh=Wv/L7dQYYmEgnEQy5a6/j0Hm8/20q6x4KkXVE12LBk0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vAEwH1gY3f6HECDKCsFLgswKZeixgDKABwPMzm89Q+HDaHRl2N3vSBYH8PgPzFZ1l F4zHRXZR7365tUfILqPeaiMeg0QkkGgmZ/wNdMwD2JLk+NIbqlJoGrg+oCrYcF2adN WGK0cs96NKfdkGjgR0uBZom5hu5lnyaTAkhtLQ9E= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicholas Piggin , Michael Ellerman Subject: [PATCH 5.11 281/306] powerpc: Fix inverted SET_FULL_REGS bitop Date: Mon, 15 Mar 2021 14:55:44 +0100 Message-Id: <20210315135517.178753846@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Nicholas Piggin commit 73ac79881804eed2e9d76ecdd1018037f8510cb1 upstream. This bit operation was inverted and set the low bit rather than cleared it, breaking the ability to ptrace non-volatile GPRs after exec. Fix. Only affects 64e and 32-bit. Fixes: feb9df3462e6 ("powerpc/64s: Always has full regs, so remove remnant checks") Cc: stable@vger.kernel.org # v5.8+ Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210308085530.3191843-1-npiggin@gmail.com Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/include/asm/ptrace.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/powerpc/include/asm/ptrace.h +++ b/arch/powerpc/include/asm/ptrace.h @@ -195,7 +195,7 @@ static inline void regs_set_return_value #define TRAP_FLAGS_MASK 0x11 #define TRAP(regs) ((regs)->trap & ~TRAP_FLAGS_MASK) #define FULL_REGS(regs) (((regs)->trap & 1) == 0) -#define SET_FULL_REGS(regs) ((regs)->trap |= 1) +#define SET_FULL_REGS(regs) ((regs)->trap &= ~1) #endif #define CHECK_FULL_REGS(regs) BUG_ON(!FULL_REGS(regs)) #define NV_REG_POISON 0xdeadbeefdeadbeefUL @@ -210,7 +210,7 @@ static inline void regs_set_return_value #define TRAP_FLAGS_MASK 0x1F #define TRAP(regs) ((regs)->trap & ~TRAP_FLAGS_MASK) #define FULL_REGS(regs) (((regs)->trap & 1) == 0) -#define SET_FULL_REGS(regs) ((regs)->trap |= 1) +#define SET_FULL_REGS(regs) ((regs)->trap &= ~1) #define IS_CRITICAL_EXC(regs) (((regs)->trap & 2) != 0) #define IS_MCHECK_EXC(regs) (((regs)->trap & 4) != 0) #define IS_DEBUG_EXC(regs) (((regs)->trap & 8) != 0)