Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3074193imm; Sun, 1 Jul 2018 11:38:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpchjndX0wBQiyLxZj7Q4utuRQQLiEhzFUA+9NspdAZfMuSOUVCuFhdopV9yPbC/Bx47JTaC X-Received: by 2002:a62:e0d5:: with SMTP id d82-v6mr5500995pfm.59.1530470333295; Sun, 01 Jul 2018 11:38:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530470333; cv=none; d=google.com; s=arc-20160816; b=edzDsvsZJXivFMVYVC+vgkrga6zfSJA8Pm5tV/T1+5okjd+CUKVs6AwsCQFvyD96pM lLDY5ePD6NMxm+akkLm8Iiopz6Bdngd/VjzEYI83/bdBRbW76l0TcOLKaDUTKpT/ttWO BalyFspWk27Lf09BUmOFdaAoLDfVEVminT47jwd0rgFrVPLy5XEN0R8qsFHIkXnFKiag mHSUWQeusMmMsLXBmgPxnjxMiMlXydF+ooFpL9DCkoJlUz8sqAd2ZapaTGaVXDKig0f8 GFoIpufbkTuSXXSiSk7+yh2CaZTpnGv7IxF81n94iM4S7fVxErrH38Tss+2NxqyMDOte NkSg== 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=y3NAvrY2L/XyoOs1fLq+liKAqfIjbDR4GlT7gqpgu4U=; b=Xng7wEhc8J2+JOQlzV7p8FZb7Uc5Fpwr0eoqtrPG5oTYw3KgNCq/eLj1EUaShIxxd5 SxFIzjKCWPVrwHWeXaOK/lwr5g/dDBKEkvgVsrg6d0+YhpqTDRP/GkduxjX3xYDsX2Up Mn/1SbqMPs9pWFQsJXwrVq+NuvtCZsmJM1S9+Kz2+Vm9ve2+pAWBCDPbcPUZtXF2RsBw 7GSo4x/FgqBK5p0FB4LVEq/wq1SNCXK35pVLcvJgvk0oRwAw1Vbmz7amYtw6pVvapvND kPRoSa6acaBebQVoNl2Dt5LvbVE0whmSJ00VLv3fhRVVCTWCNAvROjGkk1YIyELaVnSb k/Ng== 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 a72-v6si12670804pge.497.2018.07.01.11.38.39; Sun, 01 Jul 2018 11:38:53 -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 S932868AbeGAQO4 (ORCPT + 99 others); Sun, 1 Jul 2018 12:14:56 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60438 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752898AbeGAQOw (ORCPT ); Sun, 1 Jul 2018 12:14:52 -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 D23B986A; Sun, 1 Jul 2018 16:14:51 +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 59/85] powerpc/ptrace: Fix setting 512B aligned breakpoints with PTRACE_SET_DEBUGREG Date: Sun, 1 Jul 2018 18:02:17 +0200 Message-Id: <20180701153124.709389266@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 4f7c06e26ec9cf7fe9f0c54dc90079b6a4f4b2c3 upstream. In commit e2a800beaca1 ("powerpc/hw_brk: Fix off by one error when validating DAWR region end") we fixed setting the DAWR end point to its max value via PPC_PTRACE_SETHWDEBUG. Unfortunately we broke PTRACE_SET_DEBUGREG when setting a 512 byte aligned breakpoint. PTRACE_SET_DEBUGREG currently sets the length of the breakpoint to zero (memset() in hw_breakpoint_init()). This worked with arch_validate_hwbkpt_settings() before the above patch was applied but is now broken if the breakpoint is 512byte aligned. This sets the length of the breakpoint to 8 bytes when using PTRACE_SET_DEBUGREG. Fixes: e2a800beaca1 ("powerpc/hw_brk: Fix off by one error when validating DAWR region end") Cc: stable@vger.kernel.org # v3.11+ Signed-off-by: Michael Neuling Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/ptrace.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c @@ -1004,6 +1004,7 @@ static int ptrace_set_debugreg(struct ta /* Create a new breakpoint request if one doesn't exist already */ hw_breakpoint_init(&attr); attr.bp_addr = hw_brk.address; + attr.bp_len = 8; arch_bp_generic_fields(hw_brk.type, &attr.bp_type);