Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1863922rwb; Fri, 19 Aug 2022 10:38:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR7KtzVed6JDBfiT+NEfpqjbFlW4TOHpTgEDK2FxwgdHIgRcsAZsFEctGrndrEh2PxjLCwW9 X-Received: by 2002:a17:90b:4a87:b0:1f7:8c7b:931a with SMTP id lp7-20020a17090b4a8700b001f78c7b931amr9445131pjb.241.1660930734403; Fri, 19 Aug 2022 10:38:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930734; cv=none; d=google.com; s=arc-20160816; b=0f026y285vLmvDHya9YP/Pooh+QnxasmuaJWh9+kt/U5dHjaZCfPngHJFASUxDcuto UQI+E2pHtphFqXC8PQlvWUo85avh+blI07jxjdFiMKmbw46hJxVL6AVB7VXjxtzGzq7L xa6I0NGd/AZmYCrMMZB7x1UGbXI28wucRDnmih598xZLXr3zZ8bE8zIhoVHHwtn4BAiZ XmVqjkHNvfC5pg36C+2IYNR6QdOTNfDWQz3mqP/e2czQge/7frGa3n3N3fRumYYZNR+x 1yTiivUDWdEmtYOUVLAVHxxIfUVFwwcZRKVoYpCXCHDq5uMSJ0G4eTYunt3IJZ/Vi7ZY ebeQ== 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=ynR6+gWCz/VGEyqlRhttn5lmTbjbGqgtlJqEfG8TfFk=; b=Oxwsk0kcGfN88IsUwqNJ/cQo1SPApKpfDR9SIq+O00upzPK0oT61tj26r2qRtmXSlR Uw8Iu7sAl6xhW3Ndzs/11Beo9mAjvoUypgPlqS8rXf990Ypg5KQhfYZk6fL0ZwIm430o /Kb18BScSJIop0lMbebOZAufxDccWiizMPmoB2VsRgssRVcqDuiiAkbifbv0VPdP8/N2 /HiUwHmGBDXZ/mh9aydKIAGGdKGfzNsna10J72c4RgAUcvEHCc3ndueW+tewn2Wnafqp r1qLKti7QlO7+O0rtHpkU9CZ7niFn8OBQDwURjp+wakAIO1cFMcWlqK4pQ5mdSp3gZuU Eb0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MBre20RN; 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 j191-20020a638bc8000000b00429ea6e9438si4155516pge.224.2022.08.19.10.38.42; Fri, 19 Aug 2022 10:38:54 -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=MBre20RN; 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 S1350661AbiHSPzQ (ORCPT + 99 others); Fri, 19 Aug 2022 11:55:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350606AbiHSPy2 (ORCPT ); Fri, 19 Aug 2022 11:54:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EEEC106531; Fri, 19 Aug 2022 08:49:41 -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 D5EE761711; Fri, 19 Aug 2022 15:49:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD404C433D7; Fri, 19 Aug 2022 15:49:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924170; bh=tRMypaLnigkjeLRUmrWAejT49vT0wyzqMWkQO2IPZGc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MBre20RNS/peCzayasvICDkL1KODJ9OG20Z5Eto1GtANMOFxXNB+FpxWoUZro82sd leVEH7JqKcF4SfbYC5hk7yM9y4iD/kAtoHvJR4rBu8MfteEyCY7vngTrDYS39R92hX TSMmUn6jnOWg6CWHiR2bE1PtqlnlFsaKmOKFi7R8= 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.10 078/545] arm64: Do not forget syscall when starting a new thread. Date: Fri, 19 Aug 2022 17:37:28 +0200 Message-Id: <20220819153832.760137236@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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 fce8cbecd6bc..7c546c3487c9 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -194,8 +194,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