Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3007888rwb; Mon, 15 Aug 2022 16:03:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR7k4LDRnyWYOaKtfuTvxJ1HdfdOYHbJx9a4dzy+VwXVFQKPU9NXFAiFhwqR5MWJnQ6ltk1u X-Received: by 2002:a17:907:2bd6:b0:730:a2f7:f885 with SMTP id gv22-20020a1709072bd600b00730a2f7f885mr11672137ejc.214.1660604591374; Mon, 15 Aug 2022 16:03:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660604591; cv=none; d=google.com; s=arc-20160816; b=jwCYQ0yjZCeR2504OFfImRiCWE6OWrunQdUXt/hem89n4YiSZJylGLjG/A3y9am+r8 GOQX6f97sfXDlv4Z5cF0t8Y6d4UFEwqYm/UTKxxjz7xo+XVH1eCUc7Vv0dP/LSuzjOCs LlSa+WUgcMEAaojE5tZxfgQyXaQxQBu/nKs/vQcNVD4eLnYJWcav8yuRUlto7GyqMEiv SLFYeZochVBzJe33Dc1k+0DnnG1dkUHoPDeWuKvfV5fDXClYiCBH+8mvqzxBlTHhz4Nu 4WENicrpvPQaLjjTd9bswx8QO/QBwHK7m3cO0Gn+QLWyXnrVzfttp5MmtjFyIgMsgItB cW7A== 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=a22pwTkk5AKowNfZvVUxN9vBxCpLAOzLIpg1nOoXBlA=; b=mS8hFksqwmL/wEIaOzwiH93LGDRXGQ7oFXicrKr9DahXlbm3jGyT1TqmZlEc6bolKv KIlWgXlewrr9Nq/ClraSbpTHCGS/q6/G0sg8f3/3ddE31NAPmjkkn7ZnIaHLGjab/jsT ux4zrfxDEl9GiixnbpGQeLsirA32DlS4XOrJx+sWJgkZdTIi8rPhBSICZI8NlMFNz39R MjaS275AxrJ0lfS1leiIxz1rKGQaLM99g7UI3c5agart4cixlgK4k6vlIapGTtKWmQFA /SySZQOE1g2Br8/u9KL5a1mfilIxRuyExv1zxtTyox97LbRRWqKqXKXo0hrn884njx5H /GmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aN1BkbY+; 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 s20-20020a056402521400b0043c96460dbfsi10339398edd.62.2022.08.15.16.02.44; Mon, 15 Aug 2022 16:03: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=aN1BkbY+; 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 S1347774AbiHOU0h (ORCPT + 99 others); Mon, 15 Aug 2022 16:26:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346705AbiHOUU6 (ORCPT ); Mon, 15 Aug 2022 16:20:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01EFF98593; Mon, 15 Aug 2022 12:00:56 -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 5478661296; Mon, 15 Aug 2022 19:00:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64917C433D7; Mon, 15 Aug 2022 19:00:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590055; bh=OXZCHrkyCbLkl9jdNZjncEsvl/fTVJvTADUZUqZjCQU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aN1BkbY+KLSQkrTgvUEdYovoo16s5rceueAAgF3lQGRh3NBZKlEqgy+3QCNUbZqad dJ4RkAwJ9BeeRmdg+PdJFXp85KDe2bPlfYTiiKcdIckA7wnr/fHjl+as69LDyWfwJ8 ccAhNdp5Zhdwr6lPtK4TjvoV4lZQ3xgQkOy8hTSo= 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 5.18 0137/1095] arm64: Do not forget syscall when starting a new thread. Date: Mon, 15 Aug 2022 19:52:16 +0200 Message-Id: <20220815180435.259796503@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 6b1a12c23fe7..7058bf047fa5 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -250,8 +250,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; if (system_uses_irq_prio_masking()) -- 2.35.1