Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3070485imm; Sun, 1 Jul 2018 11:33:21 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLJj536IYjSSiATrauAlpzf6lfvqbqjcovwq+VeMItdy32cCLwRUa47fDgrc84kqP8BE0Kd X-Received: by 2002:a63:6157:: with SMTP id v84-v6mr18937054pgb.390.1530470001292; Sun, 01 Jul 2018 11:33:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530470001; cv=none; d=google.com; s=arc-20160816; b=RDm81NDPv5hTT1rX816UtBf39GlgCSqdLb1e9qe4C+r257W2Lb8PR5bqbr82ptoo6v pswmlhvjrMNX3+1ythvsMROwyoJqIk50LlW3a68ITiVxN92sbB3uhG6PRjzAlkhFa6Yo 8IPHfmaWJd5Fsm28NbJl18PfhYiRIcidXNXfS5JsQ1uklAtmjy7udqyuFjFOk0uQEY2V slfChfuXp9+UL6QlApqevKNe/C8uwLf10ZlQNk9KGAoZedb4uAGGHZrzXGImJQ+kIrnK aIwGSUb9iqID3Ae8MewdGAjRbvxNbZNO20ShWQnWdfwEfoO49WmH3m0Wx2m2rOSrmtqs CMIw== 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=ePxd9h6dKoaaIdxwGN5EEE/9EQyVKV5TEAbf38Fbka4=; b=Ht2s++/XfqHnouV/nIKnFFtBCA8LYcBHcvDBC/yM2CbqILsrpr4I57YJA0S+dwJRJv D0f0Av5E7l6mhxAxR+TFkfyFS20BGx53YJKNrtzEAOm+k6Rt4x4Y6o6GWJMNQHZaBIld IbCyazaftD9KE4TwIXvzVkyJZ6cmE79DqkAc0jnwCUzR/3oaZe8zQ1WmxcBV+ouZPiIC FA2Jf4gl0aIjl1e7JuNtFtWE8xwXXlqSfv9COSWCiAU7Q0AEeTncwTE54158SnuOoFu3 T27EXCI2iUDI1yprtgoPd5EldoOg/L6Df9U1TH0rSZ93ec6afc1OTtvGiZGigA7FSTlJ y/HQ== 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 p21-v6si14493704plq.94.2018.07.01.11.33.07; Sun, 01 Jul 2018 11:33:21 -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 S933639AbeGAQRB (ORCPT + 99 others); Sun, 1 Jul 2018 12:17:01 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60900 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932920AbeGAQQv (ORCPT ); Sun, 1 Jul 2018 12:16:51 -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 BAC4F49B; Sun, 1 Jul 2018 16:16:50 +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.4 045/105] powerpc/ptrace: Fix enforcement of DAWR constraints Date: Sun, 1 Jul 2018 18:01:55 +0200 Message-Id: <20180701153152.514047409@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701153149.382300170@linuxfoundation.org> References: <20180701153149.382300170@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.4-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 >