From nobody Sun Feb 8 21:48:06 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a05:6402:358d:0:0:0:0 with SMTP id y13csp1149983edc; Tue, 8 Mar 2022 05:17:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDIXYOKg6MjOaWtT4hAGKmgEakAVypkFhnfelp5yqH3u1lU4oNEDE2ZdfiZA9p/2wtjwYi X-Received: by 2002:a81:718b:0:b0:2d6:16d6:8e54 with SMTP id m133-20020a81718b000000b002d616d68e54mr12980964ywc.377.1646745447742; Tue, 08 Mar 2022 05:17:27 -0800 (PST) Return-Path: Received: from ewr.edge.kernel.org (ewr.edge.kernel.org. [2604:1380:1:3600::1]) by mx.google.com with ESMTPS id k22-20020a25c616000000b00628ad500718si11036377ybf.546.2022.03.08.05.17.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Mar 2022 05:17:27 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-4157-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) client-ip=2604:1380:1:3600::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=mimecast20200619 header.b=czqAgxhz; arc=fail (body hash mismatch); spf=pass (google.com: domain of mptcp+bounces-4157-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-4157-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ewr.edge.kernel.org (Postfix) with ESMTPS id 41C4D1C0A47 for ; Tue, 8 Mar 2022 13:17:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC2EF48DB; Tue, 8 Mar 2022 13:17:25 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.109.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85A8348D0 for ; Tue, 8 Mar 2022 13:17:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1646745441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z0MPY+WSQNwWOyp5VgV0CTw/sHdvnUiJvFilkADeg70=; b=czqAgxhzDPcRVAQUjYUjaont1vIsx1ezD/wywgZ/Nev1WyD+gA34zRXWtR5TCsr1ely7+C nrIOo2bN6U5Zf3ib6B6hVD5OjjXGCk8/wJ3CBKf88o/FPq2ceYVf4gna0aLxybUdiubD6K /xTk0qEXow+BOQLUgbh0j1vdu1cIaTQ= Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-ve1eur03lp2053.outbound.protection.outlook.com [104.47.9.53]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-23-H5s5UxB4Mjm5ShU0166EMQ-1; Tue, 08 Mar 2022 14:17:20 +0100 X-MC-Unique: H5s5UxB4Mjm5ShU0166EMQ-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UNHLOu3o1cOd0EsSc2VcSPE+pU1tIluq95LHovIPdorYE/SZRiwvWQ22zMNFRFu9SSSXBTRWznziog21yk3OBjd0LrMEwuqBjgpqjAnC7jrFpa3xmMs8hfvs0Dg1K5xhAhsQnDQfKkWCmtxQDk1g5M/8jv7ltz8ZNrqoCJUBVL20yxK534wjcNETGekTb7h4ljDV+mP+Zws+96H7SU6wdRlrWXF+CZXpd1ePtVJqTO0E7X9wYD/oKZEPC7ri5anMtNy+RbOdMWWJwMk1O+u3ZjtS2VG5fqmvdWw0IPrWj/GV/ONwaPFlfZjRlxvUp7UyRyl3cxpwI/biUUYW+hkFfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3V/CJY3nSxaI4fRpLm5g7E3duE0JKWPCKp+lNt1FwUQ=; b=N57a5DdGWjL4Hc1b6w0ktDQjIPqjT0Sp6HvesKuvFzYFuaP+9zpZMguJ828ioH78eWQstWgewmw1Q57730HTNnjCMU9lRlUUlFaj382Ed8ANeFRSFl9DJvRvfpRSz7qy7mjrCBwg+JE/tHm9UPU/Ts+FsCA3mpPf9GjG9bvIRLiKr2c29xNxK1PK7OqkXYS6kGdB0/2xi+aUWEiRsNoS6uN1qOY5j8bgLUu6oaVqLSEMeYTuK/jIHEJSqvHkliYt/ZMplxJwAhJLkcvc635KlNbb3VCR9BMYpoyoXFuxzG8vOjt+ffzoSIVbFB3uTSXEpLI62DM5J2g3ApgDtjVwkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by PAXPR04MB8142.eurprd04.prod.outlook.com (2603:10a6:102:1ce::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.15; Tue, 8 Mar 2022 13:17:19 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::b110:cb51:e09f:bb05]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::b110:cb51:e09f:bb05%6]) with mapi id 15.20.5038.027; Tue, 8 Mar 2022 13:17:19 +0000 From: Geliang Tang To: mptcp@lists.linux.dev CC: Geliang Tang Subject: [PATCH mptcp-next v9 2/5] Revert "bpf: add 'bpf_mptcp_sock' structure and helper" Date: Tue, 8 Mar 2022 21:16:55 +0800 Message-ID: <5d0f38a0fb220bae4f170f2debf5a8b8a031ba7e.1646745228.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HKAPR04CA0007.apcprd04.prod.outlook.com (2603:1096:203:d0::17) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4a76dadb-8c8a-4ad5-7ff7-08da0105f931 X-MS-TrafficTypeDiagnostic: PAXPR04MB8142:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pHiuaZF45Nhor6pDzszMbKB7BXd6pSIuP77IsXiOHuVsWCw9rY0PJA3140fKBQT3EH+PEqLGKaLF211NTb6qzC6L7wFYRfcbVBXagbOGlsCTlH+XM5VqSCQEqZkcubs8HQ3xCU/1GHZROAj4NpFhwomynqE4d89vx8GfoF8qVNJgXckiMPvIGSK8d2carjgpzUxGuZ1i1DZXUqUvvvece2VYs3AuHn3pdSIkfzJGoVPV8BjdHS5jVwcn21JsgFS/CU33mvv9VvYyuFL9/dzlgcERV7Ze5JyszjcX6Xs6BkQk+Uloo5gnCrol5/iOCRKYCqSA3kcbz2JGhEp9BXHjH205/1Z3EJkw1f6+148/Q8UKYuRRBZqdi9r/ZZxUGo/6qaWD6YIFNCgIPbrUltDUw81QXGQq40xigG1itnpwtdgnXrIPwgwId5sPvxSu+fRfW+rpAXmQOsfQ8BheagFfm+n60LMK7AdyI9TNI2rUo80/jhqOnWZoj/REwZ4/VjUBLkHky8oZ3uRkAeotNeDwLr/XHu9JT/dD6l7fNAWs1j0Z4a8CAY4to9jrmbt0iozz+L+E1nR2jE7unv/0QJOTJUhNfBuRphQ9QlYxAn8PRXvj9sSBfbX8o1TFGsDFGN0VHVyuJuKJ1ys25WCpt2ROY0i+xIW/3LJrn/RlVEOC+gEB1gqyl1udfvVH4A3lyIy/gH4NaaY3juwGcqmGr+231A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(186003)(316002)(6916009)(2616005)(6512007)(107886003)(44832011)(30864003)(36756003)(2906002)(8936002)(5660300002)(26005)(4326008)(66476007)(66556008)(508600001)(6666004)(66946007)(38100700002)(86362001)(6506007)(6486002)(83380400001)(8676002)(13296009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?SGrGksL6Pv5Eg6XhwKM57bCxgUe05WilIl9e24IiznZfmQAhS+uvziChsT3P?= =?us-ascii?Q?ZLBpQzfF7P9btIQzdAqFw1cFo6kVGCt8WU8IeBeuYlQDJiqxCWXcLRetJWH8?= =?us-ascii?Q?lCKLyCJWGIOCh1MdHu2noyGfZ7TSyvkLZK7ihOm4ZcstPFMMjrDzRUBSpZSP?= =?us-ascii?Q?YNU2p6IfOe911Pkx30nsQC/Z4m7ZvL+aTvnbZGVFm5i/GCDnjMqtUpyCgFv+?= =?us-ascii?Q?vXVuwznI51TKN947w4okxFqwKrHTqQsqmhPPD6iBbXm2UIHiMmIhGOmuXK2q?= =?us-ascii?Q?wQgFkO37M+r2mA27kjKp8rGDba1fbRIkz9Q9yQxTanYiEUGKb9LIxzexBsvt?= =?us-ascii?Q?pBKvmdlq4YZgRrOPXW+XpmKTHuIkoYhy/DDDfaet7wa0hfPPuwaNzkSm2vVz?= =?us-ascii?Q?T2gyWRf4TIdNn/H2FfMMAy1w5T4C7WSyo6OQVL8hNrZcKBC8bUe8SBlmgcTC?= =?us-ascii?Q?isY61RBY8ndy4PVh/pGvB+NLJUHcXhkiV6qh8Iyun9VA7o+aILSNTmx6Fvui?= =?us-ascii?Q?CmlB+Vo8fS210LcC6qMXYKiAigglhFkQEVDqU18eQRLUiYzYyK4IlMOqOrXc?= =?us-ascii?Q?WCY4wjyAlLTj4j1gLwcH1OrMX/i9wDittgJG2NDOpZEJpiS33n9hlFUR8iyh?= =?us-ascii?Q?ct4+Yazak86A3MoNsMzWTYEZQCMUE9wMK64kueU+PoBXm2FkA7HOk+GupRQO?= =?us-ascii?Q?ycHasRQ8SUZ6ZlJWFZx0vfN+gLmA44y+v6c4Nn/hkmtHKGSfIgy3Ez5EmO1k?= =?us-ascii?Q?Xcd8CWCGbUs4ulnFWJyQWzePq8GhPFmx3Q0IGNBRMuCvZ82OneBsV7egpMeC?= =?us-ascii?Q?g+J1q5SSVA9dXcFaomh22iYk4CREZyAqAXYSJJCC0/cqN+ZTPaGEcVOYkuZ5?= =?us-ascii?Q?eMW1XenMv7b16qt1RYiSmCZXVrYb+KiAH8f+EA0trliMIZLR9Y0FIxs5Lxvn?= =?us-ascii?Q?gRVUHiPBoiTcIAzhI7hhnGlDFq8XTJCpv83ORGvLa1gAK3BvIV029qFm/tC0?= =?us-ascii?Q?ccmd2otbFkK9WwOaj/iWf0w55EqXQXq+0aInPydwtm8KcM7GQzPwDRU3JtQn?= =?us-ascii?Q?jv9SW1t/9L/O3SV7SQnDfmRxi9kN+3aXHNgFkQoum7UEM2eDzCSXYH9bejHK?= =?us-ascii?Q?9WIJGKTj+0sGvSul/L95ZL5rxx732XwIIsNmiPIBmuqzcdKmBOW8vS4iAY6q?= =?us-ascii?Q?Fq6DxiYkftKx5t2fMWeognJx4wIDATKTHj4kobnByUhRFBbVb7UQOVUs2mjN?= =?us-ascii?Q?98H+4i4np+IVB/GioTFkXNV/azH0SgB2hiEbT0KNoYc/sgcNFkj8JfraNdim?= =?us-ascii?Q?VzcKJmClIBDA7AXjPFxwClJogpFXEVqUUAnh7wZJzBx3sogAPqf+GgMFDaG5?= =?us-ascii?Q?KCKV2Fk+9EnW4vlJAmpESq/fFhS0JgPt7JHwNvVUwo7ZBvJjfYVeK4Dif4Ba?= =?us-ascii?Q?ciDC3mDMJ8bTeEbtxa28AesX2yfYFpn0a7MzFgV2sHfZWlYsC/JyDkzTyEwf?= =?us-ascii?Q?vLq1/O2mpTFXOdto9lbHl01VgUS9J69W1Dag72W3VAuoEdMqsC/UCRzXaoAo?= =?us-ascii?Q?P59s9R/SVOtyMZjoA2oq/bI0LkVuAEqYFnlJh+H1LOj4EmM/rvwQ45/PpmYn?= =?us-ascii?Q?73i0kYjdq1jHkbAofl27V2I=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4a76dadb-8c8a-4ad5-7ff7-08da0105f931 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2022 13:17:19.5456 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5Ru7McW9oy6gkiTocKkI0IEnJScMBMiDxtGXGtDrBeSGw/uqlsQxLscRoQ8r3RO09i4e2/DIjo3geoQNWW7Fcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8142 Content-Type: text/plain; charset="utf-8" This reverts commit 2ee22ce38ed4c7a416ce887eb6379aaf157634f9. --- include/linux/bpf.h | 34 ---------------- include/uapi/linux/bpf.h | 13 ------ kernel/bpf/verifier.c | 20 ---------- net/core/filter.c | 4 -- net/mptcp/Makefile | 2 - net/mptcp/bpf.c | 72 ---------------------------------- scripts/bpf_doc.py | 2 - tools/include/uapi/linux/bpf.h | 13 ------ 8 files changed, 160 deletions(-) delete mode 100644 net/mptcp/bpf.c diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 5a17c1e3a6bc..f19abc59b6cd 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -407,7 +407,6 @@ enum bpf_return_type { RET_PTR_TO_MAP_VALUE, /* returns a pointer to map elem value */ RET_PTR_TO_SOCKET, /* returns a pointer to a socket */ RET_PTR_TO_TCP_SOCK, /* returns a pointer to a tcp_sock */ - RET_PTR_TO_MPTCP_SOCK, /* returns a pointer to mptcp_sock */ RET_PTR_TO_SOCK_COMMON, /* returns a pointer to a sock_common */ RET_PTR_TO_ALLOC_MEM, /* returns a pointer to dynamically allocated memo= ry */ RET_PTR_TO_MEM_OR_BTF_ID, /* returns a pointer to a valid memory or a btf= _id */ @@ -418,7 +417,6 @@ enum bpf_return_type { RET_PTR_TO_MAP_VALUE_OR_NULL =3D PTR_MAYBE_NULL | RET_PTR_TO_MAP_VALUE, RET_PTR_TO_SOCKET_OR_NULL =3D PTR_MAYBE_NULL | RET_PTR_TO_SOCKET, RET_PTR_TO_TCP_SOCK_OR_NULL =3D PTR_MAYBE_NULL | RET_PTR_TO_TCP_SOCK, - RET_PTR_TO_MPTCP_SOCK_OR_NULL =3D PTR_MAYBE_NULL | RET_PTR_TO_MPTCP_SOCK, RET_PTR_TO_SOCK_COMMON_OR_NULL =3D PTR_MAYBE_NULL | RET_PTR_TO_SOCK_COMMO= N, RET_PTR_TO_ALLOC_MEM_OR_NULL =3D PTR_MAYBE_NULL | MEM_ALLOC | RET_PTR_TO_= ALLOC_MEM, RET_PTR_TO_BTF_ID_OR_NULL =3D PTR_MAYBE_NULL | RET_PTR_TO_BTF_ID, @@ -499,7 +497,6 @@ enum bpf_reg_type { PTR_TO_SOCKET, /* reg points to struct bpf_sock */ PTR_TO_SOCK_COMMON, /* reg points to sock_common */ PTR_TO_TCP_SOCK, /* reg points to struct tcp_sock */ - PTR_TO_MPTCP_SOCK, /* reg points to struct mptcp_sock */ PTR_TO_TP_BUFFER, /* reg points to a writable raw tp's buffer */ PTR_TO_XDP_SOCK, /* reg points to struct xdp_sock */ /* PTR_TO_BTF_ID points to a kernel struct that does not need @@ -528,7 +525,6 @@ enum bpf_reg_type { PTR_TO_SOCKET_OR_NULL =3D PTR_MAYBE_NULL | PTR_TO_SOCKET, PTR_TO_SOCK_COMMON_OR_NULL =3D PTR_MAYBE_NULL | PTR_TO_SOCK_COMMON, PTR_TO_TCP_SOCK_OR_NULL =3D PTR_MAYBE_NULL | PTR_TO_TCP_SOCK, - PTR_TO_MPTCP_SOCK_OR_NULL =3D PTR_MAYBE_NULL | PTR_TO_MPTCP_SOCK, PTR_TO_BTF_ID_OR_NULL =3D PTR_MAYBE_NULL | PTR_TO_BTF_ID, =20 /* This must be the last entry. Its purpose is to ensure the enum is @@ -2221,7 +2217,6 @@ extern const struct bpf_func_proto bpf_get_local_stor= age_proto; extern const struct bpf_func_proto bpf_strtol_proto; extern const struct bpf_func_proto bpf_strtoul_proto; extern const struct bpf_func_proto bpf_tcp_sock_proto; -extern const struct bpf_func_proto bpf_mptcp_sock_proto; extern const struct bpf_func_proto bpf_jiffies64_proto; extern const struct bpf_func_proto bpf_get_ns_current_pid_tgid_proto; extern const struct bpf_func_proto bpf_event_output_data_proto; @@ -2309,7 +2304,6 @@ struct sk_reuseport_kern { u32 reuseport_id; bool bind_inany; }; - bool bpf_tcp_sock_is_valid_access(int off, int size, enum bpf_access_type = type, struct bpf_insn_access_aux *info); =20 @@ -2360,34 +2354,6 @@ static inline u32 bpf_xdp_sock_convert_ctx_access(en= um bpf_access_type type, } #endif /* CONFIG_INET */ =20 -#ifdef CONFIG_MPTCP -bool bpf_mptcp_sock_is_valid_access(int off, int size, - enum bpf_access_type type, - struct bpf_insn_access_aux *info); - -u32 bpf_mptcp_sock_convert_ctx_access(enum bpf_access_type type, - const struct bpf_insn *si, - struct bpf_insn *insn_buf, - struct bpf_prog *prog, - u32 *target_size); -#else /* CONFIG_MPTCP */ -static inline bool bpf_mptcp_sock_is_valid_access(int off, int size, - enum bpf_access_type type, - struct bpf_insn_access_aux *info) -{ - return false; -} - -static inline u32 bpf_mptcp_sock_convert_ctx_access(enum bpf_access_type t= ype, - const struct bpf_insn *si, - struct bpf_insn *insn_buf, - struct bpf_prog *prog, - u32 *target_size) -{ - return 0; -} -#endif /* CONFIG_MPTCP */ - enum bpf_text_poke_type { BPF_MOD_CALL, BPF_MOD_JUMP, diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index f2e5c7bd4f10..3f6dcdf4b915 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -5086,14 +5086,6 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. On error * *dst* buffer is zeroed out. - * - * struct bpf_mptcp_sock *bpf_mptcp_sock(struct bpf_sock *sk) - * Description - * This helper gets a **struct bpf_mptcp_sock** pointer from a - * **struct bpf_sock** pointer. - * Return - * A **struct bpf_mptcp_sock** pointer on success, or **NULL** in - * case of failure. */ #define __BPF_FUNC_MAPPER(FN) \ FN(unspec), \ @@ -5288,7 +5280,6 @@ union bpf_attr { FN(xdp_load_bytes), \ FN(xdp_store_bytes), \ FN(copy_from_user_task), \ - FN(mptcp_sock), \ /* */ =20 /* integer value in 'imm' field of BPF_CALL instruction selects which help= er @@ -5637,10 +5628,6 @@ struct bpf_tcp_sock { __u32 is_mptcp; /* Is MPTCP subflow? */ }; =20 -struct bpf_mptcp_sock { - __u32 token; /* msk token */ -}; - struct bpf_sock_tuple { union { struct { diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 1bb1b5d0419d..d7473fee247c 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -430,7 +430,6 @@ static bool type_is_sk_pointer(enum bpf_reg_type type) return type =3D=3D PTR_TO_SOCKET || type =3D=3D PTR_TO_SOCK_COMMON || type =3D=3D PTR_TO_TCP_SOCK || - type =3D=3D PTR_TO_MPTCP_SOCK || type =3D=3D PTR_TO_XDP_SOCK; } =20 @@ -438,7 +437,6 @@ static bool reg_type_not_null(enum bpf_reg_type type) { return type =3D=3D PTR_TO_SOCKET || type =3D=3D PTR_TO_TCP_SOCK || - type =3D=3D PTR_TO_MPTCP_SOCK || type =3D=3D PTR_TO_MAP_VALUE || type =3D=3D PTR_TO_MAP_KEY || type =3D=3D PTR_TO_SOCK_COMMON; @@ -454,7 +452,6 @@ static bool reg_type_may_be_refcounted_or_null(enum bpf= _reg_type type) { return base_type(type) =3D=3D PTR_TO_SOCKET || base_type(type) =3D=3D PTR_TO_TCP_SOCK || - base_type(type) =3D=3D PTR_TO_MPTCP_SOCK || base_type(type) =3D=3D PTR_TO_MEM || base_type(type) =3D=3D PTR_TO_BTF_ID; } @@ -554,7 +551,6 @@ static const char *reg_type_str(struct bpf_verifier_env= *env, [PTR_TO_SOCKET] =3D "sock", [PTR_TO_SOCK_COMMON] =3D "sock_common", [PTR_TO_TCP_SOCK] =3D "tcp_sock", - [PTR_TO_MPTCP_SOCK] =3D "mptcp_sock", [PTR_TO_TP_BUFFER] =3D "tp_buffer", [PTR_TO_XDP_SOCK] =3D "xdp_sock", [PTR_TO_BTF_ID] =3D "ptr_", @@ -2778,7 +2774,6 @@ static bool is_spillable_regtype(enum bpf_reg_type ty= pe) case PTR_TO_SOCKET: case PTR_TO_SOCK_COMMON: case PTR_TO_TCP_SOCK: - case PTR_TO_MPTCP_SOCK: case PTR_TO_XDP_SOCK: case PTR_TO_BTF_ID: case PTR_TO_BUF: @@ -3671,9 +3666,6 @@ static int check_sock_access(struct bpf_verifier_env = *env, int insn_idx, case PTR_TO_TCP_SOCK: valid =3D bpf_tcp_sock_is_valid_access(off, size, t, &info); break; - case PTR_TO_MPTCP_SOCK: - valid =3D bpf_mptcp_sock_is_valid_access(off, size, t, &info); - break; case PTR_TO_XDP_SOCK: valid =3D bpf_xdp_sock_is_valid_access(off, size, t, &info); break; @@ -3830,9 +3822,6 @@ static int check_ptr_alignment(struct bpf_verifier_en= v *env, case PTR_TO_TCP_SOCK: pointer_desc =3D "tcp_sock "; break; - case PTR_TO_MPTCP_SOCK: - pointer_desc =3D "mptcp_sock "; - break; case PTR_TO_XDP_SOCK: pointer_desc =3D "xdp_sock "; break; @@ -6762,9 +6751,6 @@ static int check_helper_call(struct bpf_verifier_env = *env, struct bpf_insn *insn } else if (base_type(ret_type) =3D=3D RET_PTR_TO_TCP_SOCK) { mark_reg_known_zero(env, regs, BPF_REG_0); regs[BPF_REG_0].type =3D PTR_TO_TCP_SOCK | ret_flag; - } else if (base_type(ret_type) =3D=3D RET_PTR_TO_MPTCP_SOCK) { - mark_reg_known_zero(env, regs, BPF_REG_0); - regs[BPF_REG_0].type =3D PTR_TO_MPTCP_SOCK | ret_flag; } else if (base_type(ret_type) =3D=3D RET_PTR_TO_ALLOC_MEM) { mark_reg_known_zero(env, regs, BPF_REG_0); regs[BPF_REG_0].type =3D PTR_TO_MEM | ret_flag; @@ -7479,7 +7465,6 @@ static int adjust_ptr_min_max_vals(struct bpf_verifie= r_env *env, case PTR_TO_SOCKET: case PTR_TO_SOCK_COMMON: case PTR_TO_TCP_SOCK: - case PTR_TO_MPTCP_SOCK: case PTR_TO_XDP_SOCK: verbose(env, "R%d pointer arithmetic on %s prohibited\n", dst, reg_type_str(env, ptr_reg->type)); @@ -10854,7 +10839,6 @@ static bool regsafe(struct bpf_verifier_env *env, s= truct bpf_reg_state *rold, case PTR_TO_SOCKET: case PTR_TO_SOCK_COMMON: case PTR_TO_TCP_SOCK: - case PTR_TO_MPTCP_SOCK: case PTR_TO_XDP_SOCK: /* Only valid matches are exact, which memcmp() above * would have accepted @@ -11385,7 +11369,6 @@ static bool reg_type_mismatch_ok(enum bpf_reg_type = type) case PTR_TO_SOCKET: case PTR_TO_SOCK_COMMON: case PTR_TO_TCP_SOCK: - case PTR_TO_MPTCP_SOCK: case PTR_TO_XDP_SOCK: case PTR_TO_BTF_ID: return false; @@ -12810,9 +12793,6 @@ static int convert_ctx_accesses(struct bpf_verifier= _env *env) case PTR_TO_TCP_SOCK: convert_ctx_access =3D bpf_tcp_sock_convert_ctx_access; break; - case PTR_TO_MPTCP_SOCK: - convert_ctx_access =3D bpf_mptcp_sock_convert_ctx_access; - break; case PTR_TO_XDP_SOCK: convert_ctx_access =3D bpf_xdp_sock_convert_ctx_access; break; diff --git a/net/core/filter.c b/net/core/filter.c index a07b28997ad3..f64454722a7e 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -7850,10 +7850,6 @@ sock_ops_func_proto(enum bpf_func_id func_id, const = struct bpf_prog *prog) case BPF_FUNC_tcp_sock: return &bpf_tcp_sock_proto; #endif /* CONFIG_INET */ -#ifdef CONFIG_MPTCP - case BPF_FUNC_mptcp_sock: - return &bpf_mptcp_sock_proto; -#endif /* CONFIG_MPTCP */ default: return bpf_sk_base_func_proto(func_id); } diff --git a/net/mptcp/Makefile b/net/mptcp/Makefile index 0a0608b6b4b4..48a9d978aaeb 100644 --- a/net/mptcp/Makefile +++ b/net/mptcp/Makefile @@ -11,5 +11,3 @@ obj-$(CONFIG_INET_MPTCP_DIAG) +=3D mptcp_diag.o mptcp_crypto_test-objs :=3D crypto_test.o mptcp_token_test-objs :=3D token_test.o obj-$(CONFIG_MPTCP_KUNIT_TEST) +=3D mptcp_crypto_test.o mptcp_token_test.o - -obj-$(CONFIG_BPF) +=3D bpf.o diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c deleted file mode 100644 index 5332469fbb28..000000000000 --- a/net/mptcp/bpf.c +++ /dev/null @@ -1,72 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* Multipath TCP - * - * Copyright (c) 2020, Tessares SA. - * - * Author: Nicolas Rybowski - * - */ - -#include - -#include "protocol.h" - -bool bpf_mptcp_sock_is_valid_access(int off, int size, enum bpf_access_typ= e type, - struct bpf_insn_access_aux *info) -{ - if (off < 0 || off >=3D offsetofend(struct bpf_mptcp_sock, token)) - return false; - - if (off % size !=3D 0) - return false; - - switch (off) { - default: - return size =3D=3D sizeof(__u32); - } -} - -u32 bpf_mptcp_sock_convert_ctx_access(enum bpf_access_type type, - const struct bpf_insn *si, - struct bpf_insn *insn_buf, - struct bpf_prog *prog, u32 *target_size) -{ - struct bpf_insn *insn =3D insn_buf; - -#define BPF_MPTCP_SOCK_GET_COMMON(FIELD) \ - do { \ - BUILD_BUG_ON(sizeof_field(struct mptcp_sock, FIELD) > \ - sizeof_field(struct bpf_mptcp_sock, FIELD)); \ - *insn++ =3D BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct mptcp_sock, FIELD), \ - si->dst_reg, si->src_reg, \ - offsetof(struct mptcp_sock, FIELD)); \ - } while (0) - - if (insn > insn_buf) - return insn - insn_buf; - - switch (si->off) { - case offsetof(struct bpf_mptcp_sock, token): - BPF_MPTCP_SOCK_GET_COMMON(token); - break; - } - - return insn - insn_buf; -} - -BPF_CALL_1(bpf_mptcp_sock, struct sock *, sk) -{ - if (sk_fullsock(sk) && sk->sk_protocol =3D=3D IPPROTO_TCP && sk_is_mptcp(= sk)) { - struct mptcp_subflow_context *mptcp_sfc =3D mptcp_subflow_ctx(sk); - - return (unsigned long)mptcp_sfc->conn; - } - return (unsigned long)NULL; -} - -const struct bpf_func_proto bpf_mptcp_sock_proto =3D { - .func =3D bpf_mptcp_sock, - .gpl_only =3D false, - .ret_type =3D RET_PTR_TO_MPTCP_SOCK_OR_NULL, - .arg1_type =3D ARG_PTR_TO_SOCK_COMMON, -}; diff --git a/scripts/bpf_doc.py b/scripts/bpf_doc.py index 6ef5c44a2a9e..096625242475 100755 --- a/scripts/bpf_doc.py +++ b/scripts/bpf_doc.py @@ -623,7 +623,6 @@ class PrinterHelpers(Printer): 'struct udp6_sock', 'struct unix_sock', 'struct task_struct', - 'struct bpf_mptcp_sock', =20 'struct __sk_buff', 'struct sk_msg_md', @@ -683,7 +682,6 @@ class PrinterHelpers(Printer): 'struct socket', 'struct file', 'struct bpf_timer', - 'struct bpf_mptcp_sock', } mapped_types =3D { 'u8': '__u8', diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index f2e5c7bd4f10..3f6dcdf4b915 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -5086,14 +5086,6 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. On error * *dst* buffer is zeroed out. - * - * struct bpf_mptcp_sock *bpf_mptcp_sock(struct bpf_sock *sk) - * Description - * This helper gets a **struct bpf_mptcp_sock** pointer from a - * **struct bpf_sock** pointer. - * Return - * A **struct bpf_mptcp_sock** pointer on success, or **NULL** in - * case of failure. */ #define __BPF_FUNC_MAPPER(FN) \ FN(unspec), \ @@ -5288,7 +5280,6 @@ union bpf_attr { FN(xdp_load_bytes), \ FN(xdp_store_bytes), \ FN(copy_from_user_task), \ - FN(mptcp_sock), \ /* */ =20 /* integer value in 'imm' field of BPF_CALL instruction selects which help= er @@ -5637,10 +5628,6 @@ struct bpf_tcp_sock { __u32 is_mptcp; /* Is MPTCP subflow? */ }; =20 -struct bpf_mptcp_sock { - __u32 token; /* msk token */ -}; - struct bpf_sock_tuple { union { struct { --=20 2.34.1