Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3065831imm; Sun, 1 Jul 2018 11:26:36 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcMZG7Rwev41TGShJ+QO16Am3LeHCG2bferx6pckSRc4juAmv/GTGRJ6g7Z7dkay3FfR3NO X-Received: by 2002:a62:93d4:: with SMTP id r81-v6mr5188483pfk.55.1530469595964; Sun, 01 Jul 2018 11:26:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530469595; cv=none; d=google.com; s=arc-20160816; b=xTyQJa2Jhi3CtjxNn6aFLDqO7vgtetuQd+hzEfndwddWr6XDkNInlbaHoo2Ipbzeoh NLb2S/hnkAQ+5eL5XxX5i2eDHQ9Fj5x1H06ytwY1fTaT+YDoFV5jL9+QDv1lc92+V2SR JPrP+owm811kd2vPspgC3faudwzurL/AZdupUoK1LubLNDSoYVTwaIRZH7OtCVLWaMdy QlsEogmnRf161ra7UJ39K4XwmgCGLBiLoJ9hkXTjS+hTVAV/1zPqMbuWwxGMbX8asW75 x+3YNkSrUpEXEKL+mSRinr2neMjv0MU1uK0dx+5Zg5/hociYtZJC47dTK24AkNxkFIT5 Rf4g== 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=kIMGEp/FnWWAHaGVYnaJ1jp7qTYZRLijpHM4RjkOA34=; b=N1gdSxsxxZ3xZoatfLn8zNkwRywlTM88qwT9NeexfrQy5jK69RNqAoSVTFP5PiW6xy aZdcvDS0taLxHU3K9KW+9EIZPZeAt1FSzS8FtxAAmVuhExaQiSQEqkGJ5IBbXo4EvvaL G0yRT+VHe92qiv8L6Z9ZZgNJAn+jpwfi+Czo7rYM8n2WYbtM36a1UuNrNh6Ns4x6WLeI BTnYGZ0QffU7o2IMJgeizSU3wgyEmO4cFK396LunDd9jsadecnDxJxTJOTtuyt+azbDS sYr6P/Dx7W12sto8i9RS+uOmKNtlSAms0j00aKzjO0TP5cYeRyXHG7HHw7GxD91Vr1nf YY0Q== 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 o3-v6si15076829pld.50.2018.07.01.11.26.21; Sun, 01 Jul 2018 11:26: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 S1753362AbeGAQSk (ORCPT + 99 others); Sun, 1 Jul 2018 12:18:40 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33034 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753217AbeGAQSe (ORCPT ); Sun, 1 Jul 2018 12:18:34 -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 2B86049B; Sun, 1 Jul 2018 16:18:33 +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 044/105] powerpc/ptrace: Fix setting 512B aligned breakpoints with PTRACE_SET_DEBUGREG Date: Sun, 1 Jul 2018 18:01:54 +0200 Message-Id: <20180701153152.448967347@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 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);