Received: by 2002:a05:622a:1442:b0:3a5:28ea:c4b9 with SMTP id v2csp844190qtx; Mon, 31 Oct 2022 15:33:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4hZomkvRSA6wCSa+FRVF1/tT1dPH+UBqjzl8R7Pwx3cf1KOEv4OsTd2wJLqgNd//zGVOUY X-Received: by 2002:a17:907:2bd5:b0:76f:591c:466b with SMTP id gv21-20020a1709072bd500b0076f591c466bmr14709053ejc.504.1667255608179; Mon, 31 Oct 2022 15:33:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667255608; cv=none; d=google.com; s=arc-20160816; b=CNOSlhDsftGwnRENVxLZKklN5346KMlSvH1OqTJ6PkIThm8w0y3h2pzmGStEN6lzHL Sli04+fBL17/BK5yJK9liu+h6nGyadAcTIPbOYacuBGonurZrM4sffWpHLzdCGkRyLnT sGd/jzyecyv7nNOme8FH8Jd0cPbQYWRhgchYYGzb/eTHkUwSSjLbzDPwz/XvDwzGAX4T iJNX8hxkdRyjrI+oKUkTpb3Mz3ncljw3T3wAVKTROJttmY/1RVGEf4U4EYLigK+NNDcd fpoI7lhxtNX99flCMMdfZP1MvSMllPO73dxhhB73X+vjkWQpqTx4B1oDUoW8vD6jEpn0 L2/w== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=lrb22HZ6Jnm7ozydurS59fLEB2TfDlJmL+nE6nHtD1o=; b=h3kZo6d2sC11FwapRbx7zqb6i8AEh8+yyJFvuu/szxKOhJf9iUQL3t57pxEDF8ICar K69Og1PEOEczW3aq6jifraqy8J171Pk41lQZz76M6iwg6MR9oypZMChAfmO3/Oy2MNk3 WAzt9hxlNuNUiwV6wNG3/ElVjSiVD6p4corsEJ9CHSAVjOHRTqxCAt+zcqxSrqdoJLHf BtVyqRZVp/ltmVtXb0H1Fu3tT6NuP16vu/cEOdUuz8QctuS1Wh1WSlppZvIhzsfVhL4i S7IUMlpARdlA86QTGtToRPcKXXpjafoxeSEd/8pT+dvaAUsR6WDgNXQ3WvFNM5h9MhUn qxmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=KlWg00NJ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a19-20020a50e713000000b0045beaf03ddesi8286140edn.411.2022.10.31.15.33.03; Mon, 31 Oct 2022 15:33:28 -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=@amazon.com header.s=amazon201209 header.b=KlWg00NJ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229881AbiJaV6A (ORCPT + 98 others); Mon, 31 Oct 2022 17:58:00 -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: 8bit Content-Type: text/plain 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) X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS 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 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=0x1a, ...}, 128) = -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=0x1a, ...}, 128) = 4 bpf(BPF_RAW_TRACEPOINT_OPEN, {raw_tracepoint={name=NULL, prog_fd=4}}, 128) = -1 ENOTSUPP Signed-off-by: Kuniyuki Iwashima --- 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=9440c42941606af4c379afa3cf8624f0dc43a629 --- 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 -struct pt_regs; +#include #define SC_ARM64_REGS_TO_ARGS(x, ...) \ __MAP(x,__SC_ARGS \ -- 2.30.2