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 1D1B3C43217 for ; Sat, 19 Nov 2022 02:17:02 +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=p+0wNwuJZ0tPnWCn6elBxZpHMqoisasNl/1wl/Gm2VM=; b=Tftj9o1vWpkZdH car8eVEPfNcDg3yurStbHUpFTJoXG+o8pUaPeZo4pprsNgrtckJDAGe0YD3BJkAE21cf/cer44pBU aATPwk8PiBv0hIyO4/w/seIxR73Rj5G7zzEUFTuHLSv8yvA/l5Nm2yVO293T9VMI1a0XsUT3U/Wlz eyciHc4VeMwzouLifsxropKA6TyiR4VyVJu2bkc/JwPzXgSGVYf6isWEpZzpEPb4FJsWIQKt9ku9e UaxpxAra+63EA7aiGF4CHWCe3JiIzIiHXCYlIbjKZaY9Zj36nqRBCv4Iqf1g/FZgShOuz2pLYjJQm nx8yne052iJ59V7ePTAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1owDOi-00AHIK-60; Sat, 19 Nov 2022 02:16:00 +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 1owDOH-00AH3v-Dj for linux-arm-kernel@lists.infradead.org; Sat, 19 Nov 2022 02:15:35 +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 BAAAE62840; Sat, 19 Nov 2022 02:15:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 190BBC433D6; Sat, 19 Nov 2022 02:15:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668824131; bh=G02EEvcYH5gnTW8yQ8yQBaC17QixYgFD0fZ0pWxC4Qg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HHVZaQrhAJAqleI/XzufJhrtubR8a2RSDUR1PqjKmPpZZnq4ycdJZ6/F9P+0G5AgF urVfOGrdOPlh3k08qLMOZmH0x5hJaZ+l+vBqa7+7/5yVG3y1E6mWwyRY+WUxEI3c5T 1rK3izcKnX5NqH83YV8V1xcid96FQhI084ZJzKG9e+IGlxrtzSshFSuRpArrzT9yi/ NWh+qTaKZ2KMQ5Nt98uTnvnIZi/o2W7AEUvKncSqlJtcDl+8tw+slU9ojEzXJann0z Xn51qnu1tqt9Lr5RXeS4lCRTd66lvDh+p8vFh+cGaTo++xKHVBKv4SNXrBf8XYDkqE IWT2lK17/CjhA== 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.10 16/18] arm64/syscall: Include asm/ptrace.h in syscall_wrapper header. Date: Fri, 18 Nov 2022 21:14:57 -0500 Message-Id: <20221119021459.1775052-16-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221119021459.1775052-1-sashal@kernel.org> References: <20221119021459.1775052-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_181533_525413_DA83CDF0 X-CRM114-Status: GOOD ( 12.76 ) 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 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.35.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel