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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 90504C43217 for ; Sat, 19 Nov 2022 02:18:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nBIuU9iWEGVJ3KTdTCiiV/qmp8I3HrS0ZpCCsRx+QuU=; b=YhOOuJt78OxVaA aKrIdER9t1XaqOT1k0TqNdP2KM7KxCGIKguMQ5leQff3X6Wr1NmBRdrD3rGA4/HVykA1jDgyGLkPS JpfIMBKTGWfGndsOc5YluDNKBbe/ixLCR3wKAJZmTxeEJBHN4YnTyvN/vR8FMO0fOA4y8UUd2ZjxK 7YADW2GPQBIS9TonJ1p7WRhoouoS4BwH2dV6RjlKDGvkdWRQc7W/tkYd+Msp9GOaESMxowcUhYdQG VTbIdRBP62XQbBPWT2wuPDxHuxc08f0o5XDiZSw0FnuEiHTlLhF+rVEz7LemZGyP+D7ba4TaX6JDt 7X6bgDJONmREcksOfqzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1owDPt-00AHvO-46; Sat, 19 Nov 2022 02:17:13 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1owDOj-00AHKu-EG for linux-arm-kernel@lists.infradead.org; Sat, 19 Nov 2022 02:16:03 +0000 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 CB3ED62832; Sat, 19 Nov 2022 02:16:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56AB7C433D6; Sat, 19 Nov 2022 02:15:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668824159; bh=eTIar0q5yTH0PjFlwz1Yo2cBoRr9/VhWQ+C9Y1j1S2Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BiRGQSEFpYMd9YQdWWlR6A39q7wbAlYiIEmXZLphLiON5U4wpjpSLoBIWoMGa78Vd HycjrF84GOiU+zvjIm/k4/SVAJ5B8BsNOVjo4pJl15O/6Xpv7bpoIHvfp+iftfhygE lbnZMlYZ5+Oy3DZCrFG3QB3hb4H+rER0wTGp4HLOBrFw7cuq2i23V+OIBYhj4mZXDX ENSvRgMVId1lLqORz/RhJ+jAIl/XDPKXqCiaWgjQYiDLxtOkv2vXBcHnO7/NlYpOGx WCk7TZ1WZR5QIB+l7ZcJROSFgSmTzs3GlNCtUCFKjeO1e4hH+0/MmlaK2ZLPkUGi80 sZETXhBGCsgtg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Kuniyuki Iwashima , Andrii Nakryiko , Catalin Marinas , Sasha Levin , will@kernel.org, linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 09/11] arm64/syscall: Include asm/ptrace.h in syscall_wrapper header. Date: Fri, 18 Nov 2022 21:15:41 -0500 Message-Id: <20221119021543.1775315-9-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221119021543.1775315-1-sashal@kernel.org> References: <20221119021543.1775315-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221118_181601_574111_93ED58A7 X-CRM114-Status: GOOD ( 12.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Kuniyuki Iwashima [ Upstream commit acfc35cfcee5df419391671ef1a631f43feee4e3 ] 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 Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20221031215728.50389-1-kuniyu@amazon.com Signed-off-by: Catalin Marinas Signed-off-by: Sasha Levin --- 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 06d880b3526c..43a20888bf19 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.35.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel