From nobody Thu Apr 9 00:16:50 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92AABFA3744 for ; Mon, 31 Oct 2022 21:58:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229887AbiJaV6D (ORCPT ); Mon, 31 Oct 2022 17:58:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbiJaV5y (ORCPT ); Mon, 31 Oct 2022 17:57:54 -0400 Received: from smtp-fw-2101.amazon.com (smtp-fw-2101.amazon.com [72.21.196.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0B8E140D0; Mon, 31 Oct 2022 14:57:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1667253474; x=1698789474; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=lrb22HZ6Jnm7ozydurS59fLEB2TfDlJmL+nE6nHtD1o=; b=KlWg00NJzwIfwmIH+Pyqpstpz8GpgLSkSAokvqABg0aDo3WGDXCpCzLb dZXXcrM2nizSL9P5eiWnDpSXApu4mVdd3zaTNoEERy5dW5ZdnXHmCynJT sYxH7DsFMahaHW80eK+EBJHzL0EU3SwCSSqFPmBnTLBVw9SP8Y7tLeqVc w=; X-IronPort-AV: E=Sophos;i="5.95,228,1661817600"; d="scan'208";a="258282981" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-pdx-1box-2bm6-32cf6363.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-2101.iad2.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2022 21:57:50 +0000 Received: from EX13MTAUWB001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-pdx-1box-2bm6-32cf6363.us-west-2.amazon.com (Postfix) with ESMTPS id D08A681A6C; Mon, 31 Oct 2022 21:57:47 +0000 (UTC) Received: from EX19D004ANA001.ant.amazon.com (10.37.240.138) by EX13MTAUWB001.ant.amazon.com (10.43.161.207) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 31 Oct 2022 21:57:46 +0000 Received: from 88665a182662.ant.amazon.com (10.43.160.223) by EX19D004ANA001.ant.amazon.com (10.37.240.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1118.15; Mon, 31 Oct 2022 21:57:44 +0000 From: Kuniyuki Iwashima To: Catalin Marinas , Will Deacon , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann CC: Akihiro HARAI , Jiri Olsa , Kuniyuki Iwashima , Kuniyuki Iwashima , , , Subject: [PATCH] arm64/syscall: Include asm/ptrace.h in syscall_wrapper header. Date: Mon, 31 Oct 2022 14:57:28 -0700 Message-ID: <20221031215728.50389-1-kuniyu@amazon.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.43.160.223] X-ClientProxiedBy: EX13D23UWC003.ant.amazon.com (10.43.162.81) To EX19D004ANA001.ant.amazon.com (10.37.240.138) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add the same change for ARM64 as done in the commit 9440c4294160 ("x86/syscall: Include asm/ptrace.h in syscall_wrapper header") to make sure all syscalls see 'struct pt_regs' definition and resulted BTF for '__arm64_sys_*(struct pt_regs *regs)' functions point to actual struct. Without this patch, the BPF verifier refuses to load a tracing prog which accesses pt_regs. bpf(BPF_PROG_LOAD, {prog_type=3D0x1a, ...}, 128) =3D -1 EACCES With this patch, we can see the correct error, which saves us time in debugging the prog. bpf(BPF_PROG_LOAD, {prog_type=3D0x1a, ...}, 128) =3D 4 bpf(BPF_RAW_TRACEPOINT_OPEN, {raw_tracepoint=3D{name=3DNULL, prog_fd=3D4}= }, 128) =3D -1 ENOTSUPP Signed-off-by: Kuniyuki Iwashima Acked-by: Andrii Nakryiko --- Note the cited commit only exists in the tip tree for now. https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=3D94= 40c42941606af4c379afa3cf8624f0dc43a629 --- arch/arm64/include/asm/syscall_wrapper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/syscall_wrapper.h b/arch/arm64/include/= asm/syscall_wrapper.h index b383b4802a7b..d30217c21eff 100644 --- a/arch/arm64/include/asm/syscall_wrapper.h +++ b/arch/arm64/include/asm/syscall_wrapper.h @@ -8,7 +8,7 @@ #ifndef __ASM_SYSCALL_WRAPPER_H #define __ASM_SYSCALL_WRAPPER_H =20 -struct pt_regs; +#include =20 #define SC_ARM64_REGS_TO_ARGS(x, ...) \ __MAP(x,__SC_ARGS \ --=20 2.30.2