From patchwork Tue Feb 2 00:21:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keno Fischer X-Patchwork-Id: 12060273 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68CCEC433E0 for ; Tue, 2 Feb 2021 00:22:40 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E8D7464DB1 for ; Tue, 2 Feb 2021 00:22:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E8D7464DB1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=juliacomputing.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=1pglZPw/ZwK3FcN6PYcEUO1sHLi5OyezdLtBiZIaFgA=; b=St1BSDv8WWIOr6fdx3WPedSMaK DXLDInWzJlibZBBRq/HXXVReXhwa9D1OMEzcPttnZAlygxBTa2DHk0XIZvzrc8OdUG2D5HCutINn6 tUbIMWtkBsbOrOlpLvfGk71YR9L6DWSripJBYB+pZGeAhVapk7qBau4my/+L/mMvetcdXjXPqtpA9 T0abR8iPMsyT9aSFi4GQbPiyje92Ur9B9H8iz7sO27S9ZhtgBbSBQK6/Dpqp3ApPJn2gg2azgSO7G ZnN5RFPd36Ty8TDlgkhmHs+mk4dUzYnTWy9VNyf0KyF6C/sBUGpJ4AN5/ULjIXEXuknh+tIAds8nF YekHdHvg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6jRU-0006n2-6F; Tue, 02 Feb 2021 00:21:16 +0000 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6jRR-0006m5-Om for linux-arm-kernel@lists.infradead.org; Tue, 02 Feb 2021 00:21:14 +0000 Received: by mail-qk1-x736.google.com with SMTP id a19so18313200qka.2 for ; Mon, 01 Feb 2021 16:21:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juliacomputing.com; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=ONOTr66n02aQklcAksnOmMztXABPbuB2RW9M831xdnM=; b=kaeXZHzJNPpHXxxAcSHx0+xDaBq+PGN9UbaTa4eXsfbgoGZz4B7UtFxjNacxQK+598 Px9lX0i9Dsytd1qtHB36NqVrTssBJRhYND/LgBYEueQ6iH2WfXCg5JbtrOdMS20tWfF2 mi2cxyMvbwycutKdkhpx4wUObKVEVVFXGS59mZFu93S2I4tAxJ80+28UaQLJoXkCnKi/ EQh39xZ67pR76g7iJ+uhRIktqdItUhFGEKM1dJa1Hr1TDCCx5RXo/KaOXFjpdI8YP8g9 om5nO+vyw2YvqiuP9TDPRbXuvNn8VbLwKYawMqm18RLYPVZlQUlXf2dI74rUXEzYKQdw eiGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=ONOTr66n02aQklcAksnOmMztXABPbuB2RW9M831xdnM=; b=buwmj7a7dkruCxGfrgXI9gvvvp1GeODR/jmE23YpORAdklVj9/xHhxAchVmBR+X5Cy LUajzo18kh5ByhVhFpACP2pDcX4SzMV8S7qoKZrhImxOy+Aqu/P0DIA21KPlM7J8mgbk Aujg5gkNL/giFcPMO3nxiEcFFIqmEjVB/R5BM0oteDQ8z3d5diCGS0lcRi3mPiN3mUJP 0TIGnprTthhSJD2uUgiE8h2Qac7pUids5c/Q9OGHB4pLR6LcMvdVCDcX6zCky3PXxZzG +02nLzI1hfTsYRNV7IOFron+FIFaVLoFfrtd/aRujk5YsaQiq/fK8MO4um8OALXRjUyo DbNQ== X-Gm-Message-State: AOAM531ZcQxPQUAWEdNPBH+1jPqJOeILOREyDFikInQIcEJacEIbZnbx 91Rfv8dNzUe5A8kaipLfzWCOUJxaLy3njQ== X-Google-Smtp-Source: ABdhPJwNCeu4L61fIkr0qz+BLuxmxmmpN0RIMF7mRsX19za/T3sCPWuhDwdccCIIer14GgVBr61CKQ== X-Received: by 2002:a05:620a:9c3:: with SMTP id y3mr18127752qky.327.1612225271429; Mon, 01 Feb 2021 16:21:11 -0800 (PST) Received: from juliacomputing.com ([2601:184:4780:3aef:1c94:198c:8961:88d3]) by smtp.gmail.com with ESMTPSA id v19sm16092209qkj.48.2021.02.01.16.21.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Feb 2021 16:21:10 -0800 (PST) Date: Mon, 1 Feb 2021 19:21:09 -0500 From: Keno Fischer To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] arm64: ptrace: Fix missing return in hw breakpoint code Message-ID: <20210202002109.GA624440@juliacomputing.com> MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210201_192113_908444_0B424ACB X-CRM114-Status: GOOD ( 13.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: will@kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This was found by inspection - I don't work with aarch32 very much, but I believe there is a missing return in this code, since the second force_sig_fault here would override the first, thus making the whole compat code here pointless. Signed-off-by: Keno Fischer --- This was left over in my working tree from when I was working through various aarch64 ptrace weirdness last year and I don't think I ever got around to submitting it, but I just looked through my work from back then and came across this again - my apologies if I'm wrong about this - it's been a while, so I'm not really read into this code anymore. arch/arm64/kernel/ptrace.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index e7b01904f180..9309c41dbafe 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -195,6 +195,7 @@ static void ptrace_hbptriggered(struct perf_event *bp, arm64_force_sig_ptrace_errno_trap(si_errno, (void __user *)bkpt->trigger, desc); + return; } #endif arm64_force_sig_fault(SIGTRAP, TRAP_HWBKPT,