From mboxrd@z Thu Jan 1 00:00:00 1970 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=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=no 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 5C88BC433E1 for ; Fri, 15 May 2020 12:13:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 2FDCC20657 for ; Fri, 15 May 2020 12:13:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="aJpgX0RG"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="OsxPPfg8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2FDCC20657 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: 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: List-Owner; bh=G9VJNDpB1BCTS9y5S0Oop2gikCJEEXGOGjp6BK5Bv+o=; b=aJpgX0RGjLFZSI LPEo9xsobNXwAn0z9XEykw2gm8XIZhsKxST+3Pje6tB8FPpKO0WNKs+jLly8BlA6b7gFF3i76q9AG jhbDgJd/F9MxrjeFBCJEtg8FEvfAGeDaljdKJIYxVq+yj7rG5NPrEiyT8H1/AMIdWzFJlDKB0N3Q/ BXJQZHh3cpYXoozX99xAS4CpgvB671jsWFWfnV8rc9jCqlkvqtMPtyuvwlpwRzsI3EuZzzAotTh+o xtAVFylTud46tyuQtprnN7XsPzwP3gkysciTeeOhDf6jtW0rdl+RSvWSovdUDnzhayx2WOPJMVWFW Gp2xeTS/v2PKLiPpmLrg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZZDv-0008LR-RS; Fri, 15 May 2020 12:13:55 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZZDs-0008KI-G9 for linux-arm-kernel@lists.infradead.org; Fri, 15 May 2020 12:13:53 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 610E220657; Fri, 15 May 2020 12:13:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589544831; bh=wO3WfBzz3sXFu/UmGn0py5JO3lUtLdiDwLGHsADKYzQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OsxPPfg8b47Ez+Exn/r04LsRNi/MOD4RC8HIxKVhYoBXCknPhrB81UTnuY82bTnST xjZFUoU/z4q1C6LQ2OtKCL9UCkY8wFJqidpfGSwzLxp3GbF9pGYjx0i+hlHR1148wq h56oGW78rqtJVj2ZPA/uRZnJIASubirSvGrbrUtg= Date: Fri, 15 May 2020 13:13:47 +0100 From: Will Deacon To: Keno Fischer Subject: Re: PTRACE_SYSEMU behavior difference on arm64 Message-ID: <20200515121346.GA22919@willie-the-truck> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200515_051352_558483_F410CCC0 X-CRM114-Status: GOOD ( 15.80 ) 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: Catalin Marinas , Will Deacon , Linux Kernel Mailing List , Oleg Nesterov , Sudeep Holla , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Keno, On Fri, May 15, 2020 at 07:15:35AM -0400, Keno Fischer wrote: > The behavior of PTRACE_SYSEMU on arm64 > appears to differ substantially from that of x86 and powerpc > (the other two architectures on which this feature is implemented). > In particular, after PTRACE_SYSEMU the syscall will always > be skipped on x86 and powerpc, but executed on arm64 unless > the syscall-entry stop was again continued using PTRACE_SYSEMU. > The skipping behavior is also documented in the manpage, > so I suspect this may just be a bug (the skipping behavior > makes sense to me and is what I would expect). > The reason this happens is that `syscall_trace_enter` > re-checks TIF_SYSCALL_EMU after the ptrace stop, but at that > point it may have already been superseded by a new ptrace > request. x86 and power save the original value of the flag, > rather than acting on the new value. I can submit a patch to > fix this, but wanted to check first whether this was intentional. > If it is, I can fix the man page instead. Please send a patch, since this looks like a silly bug to me. But it also means that nobody is using this on arm64, so we could also consider removing it entirely. Did you spot this because you are trying to use it for something or just by inspection/unit-testing? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel