Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3018555rwb; Mon, 15 Aug 2022 16:15:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR6v5fgH2brV9OdD982fM9i9LO3q8oKKY0O8hRrQyeFN5aiWY36VnBgyotsCQPT6bELlqHyf X-Received: by 2002:a17:907:2c42:b0:730:aacf:1b69 with SMTP id hf2-20020a1709072c4200b00730aacf1b69mr11629326ejc.381.1660605322873; Mon, 15 Aug 2022 16:15:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605322; cv=none; d=google.com; s=arc-20160816; b=FZaDjt+bLcvFwdnDwhbuCh3nwTvWgNORChSjygAAh1//K6TcbGx8lzQgdY8u9+zTUD JL0w1KxesKCLMy9gK1jEt4K7UBu4lo2+v2gVKjdQW2BsBbhKM7lGg1b4bhnL4RPd+t6O g7GgdXmJ+aXUQsMFAfTDmsgBplXArDKLLUyo23T86u2sXBT0CY24x0oC/Axvh9VJEOVf xw6QLvu5J2qLXQxYW/51KvH2ds8ZlFsApGetryr/8ZlSNh9Np9o3+QkpjaBQTp1WDvCg Z2vLETTqoudEMNRKyRkOuOHiOuYRT9nfKSXorov69rjyNTAx7AaQK8yru22+gAfg/cmd qkPA== 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=X295pPudRLkhypgDCp258tw1aH5j/0sIKl75tR7TvwI=; b=UauAmUnX960yXxvJMZgghjrzlboH748dVVgzVcQDOLeSN/INVPKpMeu5khqAVVExzf zY6MIUxMiY7MEahUX9551oah1YhclikM+PYylCcNNCZsGQGFOv39uFXvS4AsKC64UkBK ONDHejSZDEKX4CnMakAszH6xjtjy++VD9fPnOT1iujM6/jVohX6HaYH+o4q9LL7MYM25 OmfOs3atsczf/vUEeW78zQyjh9gVuzdo/SKRc1uk6Im09gh4ht+clqsmQJH5yWAEbIn1 KdqWqRNAbW2Jk1yyNjChYS9G96MokSs8w0iA+ofsP8zHxwjOw8xCR8quf8UBratyLE3j nUyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hQp01WhQ; 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 gu20-20020a170906f29400b00715867834e3si7422778ejb.506.2022.08.15.16.14.57; Mon, 15 Aug 2022 16:15:22 -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=hQp01WhQ; 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 S1350062AbiHOWbV (ORCPT + 99 others); Mon, 15 Aug 2022 18:31:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349951AbiHOW0M (ORCPT ); Mon, 15 Aug 2022 18:26:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF39D127BF7; Mon, 15 Aug 2022 12:44: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 0F080610A3; Mon, 15 Aug 2022 19:44:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0807EC433C1; Mon, 15 Aug 2022 19:44:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660592695; bh=VnNBqVs1pLaOy6COvbcSfRz66B+e9FtCkBJlFPM059I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hQp01WhQ2HeeYxcnaxWGhxYLnKqeptt5JSIZinR9YP0WZv5vk2cg1tXn+VqZz7T/A dfd0PZJzzPZCJL4rLgSNsOQj0ooIaGncoO/2GQmGwr3b9PrgiKqtvLCoK1Uq5ZAhcS REWJmT46rR7y6GAJaYHo/YSzbUzAg44PXcy6Q8iU= 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.19 0151/1157] arm64: Do not forget syscall when starting a new thread. Date: Mon, 15 Aug 2022 19:51:47 +0200 Message-Id: <20220815180445.702380652@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 9e58749db21d..86eb0bfe3b38 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -272,8 +272,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