Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3412778rwa; Tue, 23 Aug 2022 04:29:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR6x4RWdMvQEm1zlf8P4RKICgFBaVM2rGciGVS1OitSCYfDcuEMnDCSAEl+wVOj1M/pPHVcD X-Received: by 2002:a05:6402:1e90:b0:446:5aa1:808b with SMTP id f16-20020a0564021e9000b004465aa1808bmr3347801edf.90.1661254142535; Tue, 23 Aug 2022 04:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661254142; cv=none; d=google.com; s=arc-20160816; b=ozKHJvPNpFemQtEFHT3xfwK1alt3Yhfc7mxW8RstzP5g+OTYI0kZa3q7+02IegzGun yWUdowEBMUNpzbRYiZByPYoA+PD3b/YkMXZSG8FBmcq0woY38ElrWmaEhZsDfwGdbTsH 19VbHU8ZSBk5Pr+qC6m3mcjMFbbR69XOtaI+T+4JfJTwHs7UOKe7RroWYd5i+3pLmQam CUuCDUSZcywFBVfobSxpD31OXzKL/zBmulqGJcZetMTy4/MgQwE53MD2+EVJ+RPWnOQB 49RLebQQpXCJNtNZqbkXc9nhigOmbJ/6ZYiTt/S4AtITiCuXjiP2lefHJpBPltTsdqMA /U9Q== 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=B6zkJ5iQ1p00mM26BCxWhhJqoP+TnMKbjOgCeGuWVgw=; b=K+SkQ0OYop1IoFwlweeS1cmJj1i/5KqnNmDIYb2SjbdZQceajdjig1xSDUYKd4PBQG ShOcQB96NluJvqR36BHnc//sWBK/yLTNzuP9IKb1I4N/+QHRVDsyfpvhesl4untqXUHH sHDdKnkG2T5ruTng5b9kob+aJH8R2EP8G+4VCsjWKobD5jP9viohEQMQA1uL4gBA7j7a 37r8QaJZqpOk4L+dV3C16K26YDokgV/+VvNmZRBsk6j201ZTUqO2pupEM8vln5FciTex 4sDEpIddX8DGBq33MaaJqCYGD9lH0b5fzKmmpTPIXtWJ2jTDNjMsic6eTEIF4bcZdNJW 3xKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="UavR/g+v"; 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 b9-20020a056402278900b0043e74bbfab2si2293813ede.162.2022.08.23.04.28.36; Tue, 23 Aug 2022 04:29:02 -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="UavR/g+v"; 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 S1352809AbiHWKTh (ORCPT + 99 others); Tue, 23 Aug 2022 06:19:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352698AbiHWKIc (ORCPT ); Tue, 23 Aug 2022 06:08:32 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0E4A6DFA7; Tue, 23 Aug 2022 01:54:43 -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 ams.source.kernel.org (Postfix) with ESMTPS id A7FFDB81C54; Tue, 23 Aug 2022 08:39:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13D8EC433C1; Tue, 23 Aug 2022 08:39:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661243986; bh=NtEwKMZ/Nfx57WqXVp8dLzBoBoDtiLiAqK5M3OVyZj0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UavR/g+vJINka8Vb6ngdEe9hodN3pXydW1sTCySVhwM5WY1AfoW6tAZV9XpI7dSs9 DxtH0VyY80rBTxAo5VFXD2bQoPBsf6VBikH+RWXHf+aIHiYlk79vaXGmB+CTyQwE2Q fQ2LHPYTTa4Q53HFS2U/NP4PAm4+SNzyn+3Z94U0= 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.14 039/229] arm64: Do not forget syscall when starting a new thread. Date: Tue, 23 Aug 2022 10:23:20 +0200 Message-Id: <20220823080054.982504326@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@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 9eb95ab19924..8767f9d4ebc6 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -143,8 +143,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