From mboxrd@z Thu Jan 1 00:00:00 1970 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 2ABC9C4332F for ; Sat, 19 Nov 2022 02:15:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233166AbiKSCPJ (ORCPT ); Fri, 18 Nov 2022 21:15:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234562AbiKSCNd (ORCPT ); Fri, 18 Nov 2022 21:13:33 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A8F87DCAF; Fri, 18 Nov 2022 18:12:28 -0800 (PST) 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 9A61B6281A; Sat, 19 Nov 2022 02:12:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2829CC433D6; Sat, 19 Nov 2022 02:12:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668823947; bh=G02EEvcYH5gnTW8yQ8yQBaC17QixYgFD0fZ0pWxC4Qg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iv/t+bsO5HT6+ZRet7KQWLNSIP8eK9cF/s6BMJkX5Njr5tajvHEKSi41n55++XdmR qrp2d7KLxYXJOlQ5Tnw2NCZcEJsUnDx/7puYBI2OJm6WIJtRBpj6Bsmg1eylUPyuyv 6QTph62pp/fYq74z4e2VM4YOvIZ1p/NAXDZwE0fxJktzTELdsS7d+ogUBC0MeGKxU1 S2vEOPolNFo9p/Qqx7rGvf7lUzyamEeA+hv+34/FF/49HUtslhFHPPaIjVGCuxV1hn ATX6Ce6nGxZrN3e8g4lFNKhDhYnID9CzXBoBotiCiLPvtEsck4GG8JZHGFPIo5kjUA nPXXrOw+ch7Jw== 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 6.0 30/44] arm64/syscall: Include asm/ptrace.h in syscall_wrapper header. Date: Fri, 18 Nov 2022 21:11:10 -0500 Message-Id: <20221119021124.1773699-30-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221119021124.1773699-1-sashal@kernel.org> References: <20221119021124.1773699-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.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 From mboxrd@z Thu Jan 1 00:00:00 1970 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 6AE78C4321E for ; Sat, 19 Nov 2022 02:13:23 +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=xuqHoIyLIxgUVi djqyjlVEc3lH/A22W+Rk8tBNhwEaxmEqQAsKifgjhdX61L9LeozhdhVskFT9t3EBtxiFX1R5L3wz+ Rvh7YNYQ+sGzMCv5Y9XO9++CdLBuljmCkbabCmSRM/Diw3zJz7uWDnHVHUNLTvb2QflUB8TFWzIeH 22OAmy/K7NT/wQKjQEraFJH0OSM7OXyKORWg96FcBKQeInoFYnOHBW/3o2Fnb4gYviRhnaXBF9Phz 723X14imJbhFwfv5IWtEhIReBDMGsJXiU9/CmrwQ+/XdE6eBb28BmxITPxYUvEtPkzD0W22GVTGDr bd1p3G8Mo4HNGpJVU95Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1owDLL-00AFOL-O7; Sat, 19 Nov 2022 02:12:31 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1owDLI-00AFMU-N3 for linux-arm-kernel@lists.infradead.org; Sat, 19 Nov 2022 02:12:30 +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 ams.source.kernel.org (Postfix) with ESMTPS id 5860EB82672; Sat, 19 Nov 2022 02:12:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2829CC433D6; Sat, 19 Nov 2022 02:12:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668823947; bh=G02EEvcYH5gnTW8yQ8yQBaC17QixYgFD0fZ0pWxC4Qg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iv/t+bsO5HT6+ZRet7KQWLNSIP8eK9cF/s6BMJkX5Njr5tajvHEKSi41n55++XdmR qrp2d7KLxYXJOlQ5Tnw2NCZcEJsUnDx/7puYBI2OJm6WIJtRBpj6Bsmg1eylUPyuyv 6QTph62pp/fYq74z4e2VM4YOvIZ1p/NAXDZwE0fxJktzTELdsS7d+ogUBC0MeGKxU1 S2vEOPolNFo9p/Qqx7rGvf7lUzyamEeA+hv+34/FF/49HUtslhFHPPaIjVGCuxV1hn ATX6Ce6nGxZrN3e8g4lFNKhDhYnID9CzXBoBotiCiLPvtEsck4GG8JZHGFPIo5kjUA nPXXrOw+ch7Jw== 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 6.0 30/44] arm64/syscall: Include asm/ptrace.h in syscall_wrapper header. Date: Fri, 18 Nov 2022 21:11:10 -0500 Message-Id: <20221119021124.1773699-30-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221119021124.1773699-1-sashal@kernel.org> References: <20221119021124.1773699-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_181228_922689_10FDA757 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 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