Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3074320imm; Sun, 1 Jul 2018 11:39:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL1H8capLI0XjUUMQZVyS4SmYo0FvBC6lLblmwoVkbJVED01sgGbLLVOURNpQYWo37bp/vP X-Received: by 2002:a17:902:683:: with SMTP id 3-v6mr23185699plh.291.1530470345662; Sun, 01 Jul 2018 11:39:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530470345; cv=none; d=google.com; s=arc-20160816; b=JPvbmMOu2g4BcbrRy6sFFFxpN1fiJq972fLvXjBrJdmfq3zX6mzzXACitzZmccXsLy l2SWFGDPCKuaF7s0N+DaRbo/CvkCV+9gt5OQEWsiLDVfLqzHTcgJ6UzNCQ3itE776BHl FWQqTJyB7+Imvu4l3IyReJ+AprAiCwT1ug++MMnYKN7QMcb1L8Y4ClL2tbEARSMB3vVV Xsk+wQUxOmNzgK+tLQWjuXMyP8qjTaTlXeQ9ZmY5R7qLnwF4QabaNUpfqymoT0TYTeuD bFQYIVbNpOQEam+To0Ur+SL6kdEfjONlxTpHnI4MXadzEFxZ/gWJHqV8EgjtuPp5qfnc 17SQ== 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=WFNlt23OFvS2ZFKBF5VHCnDWRqfkCv7YeMaOwb9iQO4=; b=HPgpss8+f/yJoK+1rreSFUhmJLJkmMBva9ThBjs1c5gCGMme/wxj536KgdPcgFivPD ebbZnGv8GwFndYPiLQjBxLV/owkjuDxiZGFBeN6W7d4mrLrUilEkc3dRrBPc8Oll7nNs 9faNgzGA8kCgWV2Mibn3ZE9ALrHz8hXnGk1Lkm5oCO5zeU/yYme8+HQKK1Wo8vjMHsRk zXsz45V999UiH3PXDj6xRbW6pQqD7Q1wI5HQGAngavbPcphqOy/rqUBcS9yqdAZhGA30 YwdKC6X3oA1qOP735YAAL12oA2p3G33sKXbjZQVheahFlQ8Orb+i9bK1SdDRT09NQ77v ZWMw== 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 185-v6si3797309pgj.511.2018.07.01.11.38.51; Sun, 01 Jul 2018 11:39:05 -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 S933135AbeGASiL (ORCPT + 99 others); Sun, 1 Jul 2018 14:38:11 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60448 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753021AbeGAQOz (ORCPT ); Sun, 1 Jul 2018 12:14:55 -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 9FC4C4A3; Sun, 1 Jul 2018 16:14:54 +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 3.18 60/85] powerpc/ptrace: Fix enforcement of DAWR constraints Date: Sun, 1 Jul 2018 18:02:18 +0200 Message-Id: <20180701153124.748948912@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701153122.365061142@linuxfoundation.org> References: <20180701153122.365061142@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 3.18-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 @@ -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 >