Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3528521pxf; Mon, 15 Mar 2021 11:34:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpy6yrk+att3dtOcmFLCaW7IRBEJ78ihbI8FyyD2WjIOlPAhHNibIo85Y1cEA3VKMHFznM X-Received: by 2002:a17:906:a049:: with SMTP id bg9mr25303967ejb.186.1615833247568; Mon, 15 Mar 2021 11:34:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833247; cv=none; d=google.com; s=arc-20160816; b=jzzAXjSL5TMZuE+hYAw83XMAFA0NkPaNqZZc1ZlLu2nnstXfjufxRjE+1KwEr+My2i o38VM2kOwtNGClytTusxDKzjA+40t6GKmXP3aPQOgBPT01MXvGQ/3LFTX2o6Ru/PWuYV c4h6rLjdpbss3Ydp7gJH/qXl5coOKFNOGFKD3n/+wJlri1lP+yrksKg0t+4VGESwvdW7 pn+H8+ILLOxjNq+zEyMdyxX60X1MkPcRqUfjN+f/YVngtwFZK/CtZSWmvEcHlFxKnXuA e+hcxkQL7nwQ6jseh/qOcVg09Foegx+qmSHyZSoRRlzS3xZTUhiRPWyx0Y1ISJZrexOZ vzEQ== 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=gPRCsDnckgseXZnQeudRSftMGlg3m6HEVCsIPMopjiI=; b=yKd1ZMBk6+5hCmCIoti4QrnFSY9bIOZLh3WZQAjZRJP7dci7r1WRBJU3g/cn6bb+iw sm65WzKZMN74WoVURzfCCYAmByjBJTX+ceGFCor+JAXNLJ90LkZxdILmtXkwSG23+U7A Dvo0HECX3HiX3j0cGBBAzbFNeRc9SuCrVCGM+Aj6WouT0rlOndUzKmmOeXew7AlSZvjV T6VmA1lGxe98iWhQGwMf369ltBj2Tj6ds4cKVK0bwPvTmdVfYg43Fp5UzR3TwZ6sAgCm xkR2djtMaZHeFImFxzP6w6qniZO+uh1MY3X34uUD++fhyMgDsydT7Z4eP33+On2LINhw w5XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FxrpORJt; 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 24si12153695edv.533.2021.03.15.11.33.44; Mon, 15 Mar 2021 11:34:07 -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=FxrpORJt; 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 S238869AbhCOOpj (ORCPT + 99 others); Mon, 15 Mar 2021 10:45:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:51972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234546AbhCOOER (ORCPT ); Mon, 15 Mar 2021 10:04:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9004564F38; Mon, 15 Mar 2021 14:04:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615817056; bh=Rb98AK30FXTm91FB/fPYfEtlEV6qY9o2F3vFXCJscBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FxrpORJtvXa76yzrr48QNJg/cPOzYguewzN//g/YI67bzp9Eum4AtHRhVGv9aY++i Qf7tGCxmEodJLsVGlbWxtdsvegMV18KGTxRlTr/fXpKcfK30EXb1FBwy7ucigPJVXo 8t8z13uY/VAgovjAKU6nJb0Ka38jW624JE3luVc8= 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.10 266/290] powerpc: Fix inverted SET_FULL_REGS bitop Date: Mon, 15 Mar 2021 14:55:59 +0100 Message-Id: <20210315135551.011066306@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@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 @@ -193,7 +193,7 @@ extern int ptrace_put_reg(struct task_st #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 @@ -208,7 +208,7 @@ extern int ptrace_put_reg(struct task_st #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)