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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 55758C43334 for ; Tue, 28 Jun 2022 13:59:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=u+fcrUZWZf0ciJUmFj31DDwIzKR4ATsdfvdTIS7IX7c=; b=jq9Grz2e4CnARR 14tTBoYKc3rHFeV7Q0sD1a7PjeR3YoQqeynHm45uikqodRY2fb4LnP1qsz2RUAdMx5HTwY6xfSsTX Sv0AyE9R2ck/X+fsjmVrceW57Wr89hwnrgbOwWuh4uEYaEDS9KvpDKK0G+OWuA6WYWhcOLW06o4vP hsmk5GBh4UW4MWMFgWSWBww4TKGbslgCh2A4f7u90lJrXnoaW5Ls8T+QG6i+SvWB6NyLAxbBN5K/V ZoC4Nt48A3P2YdAJI0OKy5OuJZQV23/ZtFgnP1Np2ro+fqRyWi6rJipHHqInT3PM1h2sOgnHImBsv us+d8miY5irXTyltHERQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6Bju-006am7-St; Tue, 28 Jun 2022 13:58:51 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6Bjo-006ajc-9I for linux-arm-kernel@lists.infradead.org; Tue, 28 Jun 2022 13:58:45 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EF094B81E05; Tue, 28 Jun 2022 13:58:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52FAAC341CA; Tue, 28 Jun 2022 13:58:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656424721; bh=CWQNxDDBP/tNZ4n4DV0ftah0XCTJRVxQi9UavitD9Gk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=L861fPLThL71cmpBDM+iagVfpZ4YUJMReqNc/E2Cn44ZMGZ2ILrMewBPwSD113LpB 1OB5GIBhyn0EGhyU9KS7onCHLYdRdXP0geJGUVM76csBPY9oImn2DyDVIQ39tI+Q4Y PWN/bq/SRwma2nKOk2IQi36hVHRZVpq1YJppAkN+rtOz/M8B7xBBmE9yhpTIqhrRpU KaXiAVUA80WuyVRKRA2sdWrhbk0jhLjC+0IPAWFyXNoYEhhypiU60Pynt6JxvHLAIB W0b0TjxwxUHf4Q9rVSKOFcbUcoPfvmTknPBvAVs5V4SVOtnWXSLY5yakA7QNo1GPqW VXj3rUxExJB0w== Date: Tue, 28 Jun 2022 14:58:35 +0100 From: Will Deacon To: Francis Laniel Cc: linux-trace-devel@vger.kernel.org, James Morse , Daniel Kiss , Catalin Marinas , Mark Brown , Peter Collingbourne , Kees Cook , Mark Rutland , Christophe Leroy , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/1] arm64: Do not forget syscall when starting a new thread. Message-ID: <20220628135834.GA24116@willie-the-truck> References: <20220608162447.666494-1-flaniel@linux.microsoft.com> <20220608162447.666494-2-flaniel@linux.microsoft.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220608162447.666494-2-flaniel@linux.microsoft.com> 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-20220628_065844_499412_E15DAD3E X-CRM114-Status: GOOD ( 23.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 08, 2022 at 05:24:46PM +0100, Francis Laniel wrote: > This patch enables exeve*() to be traced with syscalls:sys_exit_execve > tracepoint. > Previous to it, by calling forget_syscall(), this tracepoint would not > print its information as syscall is -1. > So, this patch removes call to forget_syscall() and set regs->syscallno > to its previous value. > > Signed-off-by: Francis Laniel > --- > arch/arm64/include/asm/processor.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h > index 9e58749db21d..86eb0bfe3b38 100644 > --- a/arch/arm64/include/asm/processor.h > +++ b/arch/arm64/include/asm/processor.h > @@ -272,8 +272,9 @@ void tls_preserve_current_state(void); > > static inline void start_thread_common(struct pt_regs *regs, unsigned long pc) > { > + s32 previous_syscall = regs->syscallno; > memset(regs, 0, sizeof(*regs)); > - forget_syscall(regs); > + regs->syscallno = previous_syscall; I'm still unsure about this. Even if we preserve the syscall number here, won't all the arguments be reported as 0? I also looked quickly at the 32-bit arch/arm/ code and it looks like the same behaviour exists there (module CONFIG_BINFMT_ELF_FDPIC). Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel