Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2885222rwb; Mon, 15 Aug 2022 13:17:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR7UAvfAzTWclstxSmVAJKSpFY/KPqZm66eRqMd9ZjrWdctZ5pE+5MHumPJkUaO5KFfLxIDj X-Received: by 2002:aa7:d292:0:b0:43d:7923:66cd with SMTP id w18-20020aa7d292000000b0043d792366cdmr15173146edq.403.1660594669723; Mon, 15 Aug 2022 13:17:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594669; cv=none; d=google.com; s=arc-20160816; b=YJf6Pv8kj6qs2Kem6fDKW+NsAhEJSDqFsGj/KvTvR3gyGaju7GeAnRov3uK419xZk8 Zo4xPsmPwmIBVdNNz2XYroFRNP/szUcdgJHzy8+li5jxi/ncCKZAbb5OMlBU4cyOnw4M eyU74fYg+7fZwChc8zF1uUt5Rx1cZgNlUX1vJjJdmZMMckKyUI9ae2P6PO9QwhByZulb AkM2MJMrMn0xfPiDFd1HLKfBtMrzRF0AHFID2vRXnzWir251fOjimLxJN5R1U63zcb1F +0djYGuAwrasPdwxiFMMaosbGTocI07eBBk1AqaFf5pwSBWpaQotSVh5s++11Ta1ANpT QIZg== 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=V+4zl7v0kMPA0M91Eja/VFclClziu0hb5qOCZv+NLvk=; b=rjUfUDCX1X3cxbX18PcFfVbFA5lzoLqtjZd9qjCyk4Br6tNx0JYvO/j0W5boo9GerQ D6NwgFsothqvLNmYM1Rf6i0YFZv2w+g6hxYP6jBzMocy+Dz8kU4FBbYENy5WikosTCAs VN8YtOiyly7hnCYF9h0QrF854W7/t/pFaWzWjemiMYac9LCAtGisDxa05dqgvM+ZVoHc ryeXyKuI1bhH2Z11kyVZNHG3ThvVoYLbUQDhzyG3fE7hEq5WMoKoa0lIAQMvrVEHPFvo srr5pREKpbHxXVPjUt430WUYEpj5FseD/t8EoeE0EgJletnppiBRgARCoIxX65D7IEfJ 0WuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fgTSBiVj; 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 l19-20020a50d6d3000000b0043cae183e35si9032603edj.422.2022.08.15.13.17.22; Mon, 15 Aug 2022 13:17:49 -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=fgTSBiVj; 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 S241812AbiHOS1t (ORCPT + 99 others); Mon, 15 Aug 2022 14:27:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242757AbiHOS00 (ORCPT ); Mon, 15 Aug 2022 14:26:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 257A930F46; Mon, 15 Aug 2022 11:19:25 -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 164A7B81077; Mon, 15 Aug 2022 18:18:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DF83C433D7; Mon, 15 Aug 2022 18:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660587530; bh=1sPZN9zAK9b0nXMwsiefYVa2gH9pSAB6Wy3GSLMBpQU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fgTSBiVjqM3IYcQghKckCVYJzYKeM4fxsIcbqTOaamSMIDHCKvtcsxHuRa+6mrnUt umkYMwxF20KrD7vZ5I3jqaHuRJCQdpEpS+PJiJiChmCN/LiwQxKv339X/KEgnRM8PR DnXiygkuiXJXnjCJ0ykpS+JXrTxk4Ev05xPY8gwc= 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.15 113/779] arm64: Do not forget syscall when starting a new thread. Date: Mon, 15 Aug 2022 19:55:57 +0200 Message-Id: <20220815180342.160664688@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 5e73d7f7d1e7..d9bf3d12a2b8 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -204,8 +204,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