Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2972647imm; Sun, 1 Jul 2018 09:27:35 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfr73XykV09FksPtBm8wckY9ZjeTdyixHMZGaV3Yka6wxWeEPSS/gw+fG6QmrF3NeqpB1or X-Received: by 2002:a62:5383:: with SMTP id h125-v6mr22336834pfb.142.1530462455192; Sun, 01 Jul 2018 09:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530462455; cv=none; d=google.com; s=arc-20160816; b=B0Kim/cbgUIhDAv7rhLFkE1qg8Qvo1VEYk1v09YTGyoTQLRENIZHU+rN/PCRDQYNat Lio6qOqmlE7ycW6lNxG/j7p2h3ASH1BbRj8h47fnjp4DZBnBOn4X8xVCah+Nax80eINa V2yGDPQjxtIWZ87nTv+SCSOr3RsXJ/i+t73IvNRbjSEZddR0ZQQf/WOcVAPJGrDq+OB4 0tH3mznjkbAn1rbzaBK0m794TqMILtH7BLzMvn9GsZI+JkeV7yoMSOBWBRLK7+KzBoWr 24ORgI/ZES3QFP9Z4NRMrloP+em1suvDrMivUz4x7FkMIpYDWAkVjVkO2YNkE7bx3Npo LDYQ== 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=U3v6J/gxrSjWMvuh+U2xTYCiAZDoz/tyDNLqd9qpWJA=; b=CSMfsVx5Xv6ICEwAhkPJIhFEsGaryOv71inTSuIIEQ3zzDh5BOlMDxSgZqKJATVHyl oiKO+x7Ik36YA3jOlxo6Fx4TyRoB8OXCX/AUK+IwY2QGSFnpOIUiGmbiPLRJvjWyoSmj HY8fY3a1RdCK3kcMGNLlrZGYhztO/0B9vn/6VX9akEYnrRZFMmveoG4RVqLlJms7BfX2 A4m4ikZvh7TpjL6PDXhMNw0aSo/2MwaTfcWOzvEEY9VkrW/Q+r5LL2N3uS79faxZF2rG Qfl0RFxmk45qboXDkL4Aur+ta9uI1V1Dr44R1nnmNREQxUlZSGfN4WJXImtaR3VbVigv ks6Q== 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 z10-v6si9877571pgo.412.2018.07.01.09.27.20; Sun, 01 Jul 2018 09:27:35 -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 S1753105AbeGAQZT (ORCPT + 99 others); Sun, 1 Jul 2018 12:25:19 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33638 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933428AbeGAQZM (ORCPT ); Sun, 1 Jul 2018 12:25:12 -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 AD737AD8; Sun, 1 Jul 2018 16:25:11 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Neuling , Michael Ellerman Subject: [PATCH 4.9 026/101] powerpc/ptrace: Fix enforcement of DAWR constraints Date: Sun, 1 Jul 2018 18:21:12 +0200 Message-Id: <20180701160758.190665542@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160757.138608453@linuxfoundation.org> References: <20180701160757.138608453@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: Michael Neuling commit cd6ef7eebf171bfcba7dc2df719c2a4958775040 upstream. Back when we first introduced the DAWR, in commit 4ae7ebe9522a ("powerpc: Change hardware breakpoint to allow longer ranges"), we screwed up the constraint making it a 1024 byte boundary rather than a 512. This makes the check overly permissive. Fortunately GDB is the only real user and it always did they right thing, so we never noticed. This fixes the constraint to 512 bytes. Fixes: 4ae7ebe9522a ("powerpc: Change hardware breakpoint to allow longer ranges") Cc: stable@vger.kernel.org # v3.9+ Signed-off-by: Michael Neuling Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/hw_breakpoint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/powerpc/kernel/hw_breakpoint.c +++ b/arch/powerpc/kernel/hw_breakpoint.c @@ -175,8 +175,8 @@ int arch_validate_hwbkpt_settings(struct if (cpu_has_feature(CPU_FTR_DAWR)) { length_max = 512 ; /* 64 doublewords */ /* DAWR region can't cross 512 boundary */ - if ((bp->attr.bp_addr >> 10) != - ((bp->attr.bp_addr + bp->attr.bp_len - 1) >> 10)) + if ((bp->attr.bp_addr >> 9) != + ((bp->attr.bp_addr + bp->attr.bp_len - 1) >> 9)) return -EINVAL; } if (info->len >