Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3470629rwa; Tue, 23 Aug 2022 05:25:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR4y9qrzsz+DWV84mosSQc5J8p8qLgSLImtzRfs34eY4F7rrE9XGmi9vdj/jTZZdVahvf/H1 X-Received: by 2002:a62:158b:0:b0:536:460d:80a5 with SMTP id 133-20020a62158b000000b00536460d80a5mr16318614pfv.26.1661257511546; Tue, 23 Aug 2022 05:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257511; cv=none; d=google.com; s=arc-20160816; b=wZ3LZWUSSXgTvPfUgX8434pQXGaqODXTwPeT16w7Mk7WXuZa9m39hcCNhb5JKZhFHQ +Ywm3CY1bBmLonwtpDuBXS0h2EF7UnZ+grHsI6I9PM0j44dZQvpYd+w4CzQQVT7wXWuc 00fXY06sWagtpUIXmb2xhY21CC1sZpkogoxr0L7/+fmVVkUuPJPcUdGKgpnmrHkVa/TE jIdaabZsXLsdwSxye3Bu7SrB3FZ+s1XWY9sduxs9gZSR/83fHLsHLjYtNYDXC+IM8psb adH4aboxz5JHT1a7tI8HzZuoJx3YNj+3Hm5a9j8MPae2oITscXApLzMtlXsW/Px2aXLO OjGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=G+Bp58E5ZJSK+KvF7+1KN1ZgW8W9/Qwhj1ZiRu0wISw=; b=VFm/NAzRdB3fhgSaBVjDasc5xHj1MF1JQlBeyx9Jfo/qZJmFvBbxjYcTIc76Ig0wjU wDu6Eks5pd9z0B7H5blEvmMahgGA7fu4QbJL2hdpwLgqnBoyJb0xtcYErq1jxJvmJzr4 Y+ND8iBAhI6LlvbzrLjD39qlW8O4Llb+RY3ZGhU2hWHZ+eXBzcvtar6bpSYPe2nu8SDo 0m7hMKiIA/e4XB7ZIdJiat65EG0sxLdVawEY6JqqPRpQT0QYZvoNf2PMgCDS5Ewu8brO OjfoSI3OaHu1vuXHSEXJRFHv7LDIWebLcoLrYOrhVj9FHezsGrjl/JLZfWr/c4SHejuy EKGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PtF1ZWLH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d2-20020a056a00244200b0052d90409c2csi15211221pfj.226.2022.08.23.05.25.00; Tue, 23 Aug 2022 05:25:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PtF1ZWLH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350308AbiHWKhD (ORCPT + 99 others); Tue, 23 Aug 2022 06:37:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354797AbiHWKWO (ORCPT ); Tue, 23 Aug 2022 06:22:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F20F0B1E3; Tue, 23 Aug 2022 02:03:29 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 187B561580; Tue, 23 Aug 2022 09:03:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B7E5C433D6; Tue, 23 Aug 2022 09:03:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245408; bh=qLA7A5Br4kr6XCh5cM4QAi+8idAHdklGHyK/3mm2rt8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PtF1ZWLHX+lb0fBC229uxPfp31AUNIbihNHApTF/Np7r3C6rfp3Ignh/SEcXyMLxb m2eR80BnsxSlkSU33rW0qMl4Cf5rvY9HB+aOzFHAd7JMgjkt5QUAex47G4msRG9WTD n2+l28eusqTSYSXCZQ2JE8rEk4PCwGlSWWPTYXhQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Francis Laniel , Will Deacon , Sasha Levin Subject: [PATCH 4.19 039/287] arm64: Do not forget syscall when starting a new thread. Date: Tue, 23 Aug 2022 10:23:28 +0200 Message-Id: <20220823080101.584936413@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Francis Laniel [ Upstream commit de6921856f99c11d3986c6702d851e1328d4f7f6 ] Enable tracing of the execve*() system calls with the syscalls:sys_exit_execve tracepoint by removing the call to forget_syscall() when starting a new thread and preserving the value of regs->syscallno across exec. Signed-off-by: Francis Laniel Link: https://lore.kernel.org/r/20220608162447.666494-2-flaniel@linux.microsoft.com Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- 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 773ea8e0e442..f81074c68ff3 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -172,8 +172,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; regs->pc = pc; } -- 2.35.1