Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3313222imu; Sun, 11 Nov 2018 12:09:33 -0800 (PST) X-Google-Smtp-Source: AJdET5eZqQOiGE6pdG6/M6/2ylpkPNnl3YvzZhyn+EAta8ELHkWS4CjvwFXL6YptUz3d3u6VqPNS X-Received: by 2002:a63:c00b:: with SMTP id h11mr15294025pgg.429.1541966973872; Sun, 11 Nov 2018 12:09:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541966973; cv=none; d=google.com; s=arc-20160816; b=nZV6OPJ4aIxQXXSiAp2VNO2DGJ36YkyGMlvXLJ5hb1XXM+AotjoNYqeHrChkcjzslS TyyHmUvgYmdQ1WkErkubSMlJXmz5/AHzZQ2n0JBaZtdrXvBMZ9eqP1ZM1nGqR9a+YGb+ bTr0mMVGDm02+z3Y/IDtJqGhYoLL7r3eqAaWiEzVD9+T6v8JMVwp+IYljSMxvZ87jzj1 k28ZtbXVNk+wXCqfkq1ziN8ad5TSIkUDKIc43JXmHjPrxS2PPMXgFPBoaHINwtMpG//c 7zxpAnb/vdzvVaQVmW7zydtE7rJQGsdPTp+I7dwMKaJrG9Apwr2+36PSO/GtEInWxU/z zIPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=h8uWmRg7KXDHe3JFPqii9smCG9jaINllZgvTbh46EMs=; b=mRBtTBhto31nj5DaioYfhZURVeIDLWJEp6JD+7/+eSKDUsKPfNPxRfGlRDkwwoA7D4 pyhhLGbRXK7VwTtgX8uN0CvfLZtgoo+4+C9xGngu/H54axG0YYbJsF87hpOkhUe+QJFd jSue4QWPX1CiOHHWmPZ0auPixF75qTJbOmTbNZ5yx87Vb5EzmG1pUwCn8x12I2Un8hx1 f3Ugs7JGLuHWI1sxr+yUeFLxGGRco82C6N5JAxPNnOzAtUhJC96X/cwT0zV+CzTO1Q83 4XrvSjN1vskvyyNqWSCmgvihj3oPnEHY0xb69IdvveEw/QKAMlIKU/Ka6r7eHJAoCzbo kNLQ== 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 59-v6si16280369pla.195.2018.11.11.12.09.18; Sun, 11 Nov 2018 12:09:33 -0800 (PST) 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 S1731569AbeKLF5P (ORCPT + 99 others); Mon, 12 Nov 2018 00:57:15 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:52200 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731209AbeKLF5O (ORCPT ); Mon, 12 Nov 2018 00:57:14 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvt9-0000lM-7N; Sun, 11 Nov 2018 19:59:19 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsP-0001Ra-Lr; Sun, 11 Nov 2018 19:58:33 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Michael Ellerman" , "Michael Neuling" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 069/366] powerpc/ptrace: Fix enforcement of DAWR constraints In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 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") Signed-off-by: Michael Neuling Signed-off-by: Michael Ellerman Signed-off-by: Ben Hutchings --- 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 @@ -174,8 +174,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 >