From nobody Sat Feb 7 17:04:33 2026 Received: from mail-qv1-f98.google.com (mail-qv1-f98.google.com [209.85.219.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B71C026529A for ; Wed, 31 Dec 2025 17:37:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.98 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767202645; cv=none; b=YDOfhDInSbYJsCLvSdfoxfhJjcLoQHqzEtiYIg5DSTk7pzWddrfYfguo239q8sH68m3AKdkHnxhn59p9CWCGEXvcnS/4PqUXM3pwW72OaDjHBXwt9TU+jyow1inmCS50MLi/UYV56pJjch7ARd/nIKIpNYJYTi6O1hHAJMN/jCM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767202645; c=relaxed/simple; bh=7sztx2cWvWIz9TKeoZ7WJJeq8MyUlFzC//jJbHulVpU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Mfgrwm1/XdXFX8VDvHTY+NOvAqNLtHDHj0W/Tiec1SloxZ754KIyEu8xFyEYpzTeq2FBDg0HTYxohKV4LgCBBQtBYeq7UDCCq/+8h7mTra5tNCPCEco0qfcl8zO7uvDH6YHOO+E/O2vhHUcEjG3KSTdWanhl1Q7rQdoe/eyJZoo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=P2mJbFiI; arc=none smtp.client-ip=209.85.219.98 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="P2mJbFiI" Received: by mail-qv1-f98.google.com with SMTP id 6a1803df08f44-88a390056e1so4183206d6.0 for ; Wed, 31 Dec 2025 09:37:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1767202643; x=1767807443; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=f/dTXIrnjBfrtWAAe53M4yTIg6PHJwwBbAiaJAY560g=; b=P2mJbFiIjxyvdqq/JX2llGW/WJojGB4kayCihusbAmL/yNlDIjsOKRLWjRyPWI3DLQ 2CtA7ap8gGYXNq84Y6oj9Mu6UZcTaq+e5TMThl8Xb14mvo+olG8oZ516c19DahmPmXd2 HdRU/B3SF2w8HaiHu8sFSN4Emg8DGyxDx28yRrZY6tRBPMshz+mgTha/6tpLs/DGoFD4 8/kh/QbLbSbe0bKmG2pkNdWssaIwZ8MMMM/OQDrVjy0sw/eSHReM/UvSf/POjb18OOnG xdGuC9qHSgN+Y/8no06Ff/Q17rMSad4HBKIVUdAralaCrnDcWBheu4icsbsd4lR2Oxc5 C0SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767202643; x=1767807443; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=f/dTXIrnjBfrtWAAe53M4yTIg6PHJwwBbAiaJAY560g=; b=NKxbdVOuWPNs2gjwMOayL7wMVEPUczV7qX3aqtczSM43LwG/I6ujHYPbHqOGrl+rER 2nqV4HU08dBNmJ07V69syHhfM5y0QqlU9s+5clt0PtAM+DP2bHj4YmHpxRp1fhDPR3YN iCHCAX/+9BPrpse7nawBEKQ10cZxLVh8BswKR/32W8kQLMxTWifqJFbGYU6l0LnPJCbZ 3SFAt4Gi/dRcYCwkG1u7Bfyq4KOhjA3heLc1W1cCxG8IT+Y0jIUAI9juiKF4c86nLxV/ ruvsOCl/Jvuc2D8Yj9AbQ0BRuJ6EfCtl2wznLsqPEmem9fCqEAXcHrAuzUYnygOmDUCt xvAw== X-Forwarded-Encrypted: i=1; AJvYcCV6eyZSe/Dyzauuub+YpI8byF3t55KwV2fE76B3PjbsK/ihHnjp+aoiwGHiXSQvHD6FhEGC+6316N7Hetc=@vger.kernel.org X-Gm-Message-State: AOJu0Ywfu6V1E8/sLomkkXCAgtsHR1vpQqapR7l1gaCgS/sfk9seZ+Jp jtjlfTImjWeQw5ZbP0PxAxst6qCAhadWVnFwjeVW5TDLACekrNAlp2iNH0MDNCyGtXRCkVUqOuF 8oPoSh7t4QghX+XisbHCmAxQtysXUXl0xK59Pfw2QleiHCor/yiai X-Gm-Gg: AY/fxX6eM1APV+jx/xLK0oaJOluRiTHuVRhUXWVQcmiHOjwymrwrAyrcgNXADpw9Yti 6bUwwh4raEegwJfyTbB2XCNa0RMzKJMPdraQiOguQCEoFmumYq6PzP6cQoDMHr7msBytZDLN0MW U4cvt0U3XLZQY1Qgrli51S0uS1XUERUDAZmc2ubjELxy7i1Y66IirCrk3pDLXosZQkVygP5ZWZs kbgsk0Ggwee6KUTwLFoBHPIBsVzcBZgSZ3FYqvuPwXG2KEPzJMt5qxSgrdOy0zmCqJQh+NeA6Yc nWPYM5uA5g3KNUP+OolnfkeaLOZGo/IQMIj73ejBjsx+tAPKGViVq8i2LV7zvI3JmOn9FJI4o39 CNte0l3EbpO+n9PM2+1zu3sOsR0I= X-Google-Smtp-Source: AGHT+IEwtYVxzJM5e94yPY3BVIRxsLzn9rKk7vTIuxyQqU0ow24Nub5lypi+z+bUWbmSnwSzc3qVcPo88ZOY X-Received: by 2002:a05:6214:1c05:b0:880:6fa4:f55c with SMTP id 6a1803df08f44-88d8404da77mr466260576d6.6.1767202642560; Wed, 31 Dec 2025 09:37:22 -0800 (PST) Received: from c7-smtp-2023.dev.purestorage.com ([2620:125:9017:12:36:3:5:0]) by smtp-relay.gmail.com with ESMTPS id 6a1803df08f44-88d97a82a66sm46301936d6.16.2025.12.31.09.37.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Dec 2025 09:37:22 -0800 (PST) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (dev-csander.dev.purestorage.com [10.49.34.222]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id 79CB9340681; Wed, 31 Dec 2025 10:37:21 -0700 (MST) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id 71A47E4234A; Wed, 31 Dec 2025 10:37:21 -0700 (MST) From: Caleb Sander Mateos To: Jiri Kosina , Benjamin Tissoires , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Tejun Heo , David Vernet , Andrea Righi , Changwoo Min , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , David Ahern , Jamal Hadi Salim , Cong Wang , Jiri Pirko , "D. Wythe" , Dust Li , Sidraya Jayagond , Wenjia Zhang , Mahanta Jambigi , Tony Lu , Wen Gu , Shuah Khan , Maxime Coquelin , Alexandre Torgue Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, sched-ext@lists.linux.dev, linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Caleb Sander Mateos Subject: [PATCH 1/5] bpf: use const pointer for struct_ops cfi_stubs Date: Wed, 31 Dec 2025 10:36:29 -0700 Message-ID: <20251231173633.3981832-2-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20251231173633.3981832-1-csander@purestorage.com> References: <20251231173633.3981832-1-csander@purestorage.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" struct bpf_struct_ops's cfi_stubs field is used as a readonly pointer but has type void *. Change its type to void const * to allow it to point to readonly global memory. Change the void ** casts of cfi_stubs to void * const * accordingly. Signed-off-by: Caleb Sander Mateos --- include/linux/bpf.h | 2 +- kernel/bpf/bpf_struct_ops.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 4e7d72dfbcd4..d74189ea1066 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -1977,11 +1977,11 @@ struct bpf_struct_ops { void *kdata, const void *udata); int (*reg)(void *kdata, struct bpf_link *link); void (*unreg)(void *kdata, struct bpf_link *link); int (*update)(void *kdata, void *old_kdata, struct bpf_link *link); int (*validate)(void *kdata); - void *cfi_stubs; + void const *cfi_stubs; struct module *owner; const char *name; struct btf_func_model func_models[BPF_STRUCT_OPS_MAX_NR_MEMBERS]; }; =20 diff --git a/kernel/bpf/bpf_struct_ops.c b/kernel/bpf/bpf_struct_ops.c index c43346cb3d76..42cfc3e0bc68 100644 --- a/kernel/bpf/bpf_struct_ops.c +++ b/kernel/bpf/bpf_struct_ops.c @@ -321,11 +321,11 @@ static bool is_module_member(const struct btf *btf, u= 32 id) return !strcmp(btf_name_by_offset(btf, t->name_off), "module"); } =20 int bpf_struct_ops_supported(const struct bpf_struct_ops *st_ops, u32 moff) { - void *func_ptr =3D *(void **)(st_ops->cfi_stubs + moff); + void *func_ptr =3D *(void * const *)(st_ops->cfi_stubs + moff); =20 return func_ptr ? 0 : -ENOTSUPP; } =20 int bpf_struct_ops_desc_init(struct bpf_struct_ops_desc *st_ops_desc, @@ -444,11 +444,11 @@ int bpf_struct_ops_desc_init(struct bpf_struct_ops_de= sc *st_ops_desc, mname, st_ops->name); err =3D -EINVAL; goto errout; } =20 - stub_func_addr =3D *(void **)(st_ops->cfi_stubs + moff); + stub_func_addr =3D *(void * const *)(st_ops->cfi_stubs + moff); err =3D prepare_arg_info(btf, st_ops->name, mname, func_proto, stub_func_addr, arg_info + i); if (err) goto errout; @@ -833,11 +833,11 @@ static long bpf_struct_ops_map_update_elem(struct bpf= _map *map, void *key, *pksym++ =3D ksym; =20 trampoline_start =3D image_off; err =3D bpf_struct_ops_prepare_trampoline(tlinks, link, &st_ops->func_models[i], - *(void **)(st_ops->cfi_stubs + moff), + *(void * const *)(st_ops->cfi_stubs + moff), &image, &image_off, st_map->image_pages_cnt < MAX_TRAMP_IMAGE_PAGES); if (err) goto reset_unlock; =20 --=20 2.45.2 From nobody Sat Feb 7 17:04:33 2026 Received: from mail-ed1-f99.google.com (mail-ed1-f99.google.com [209.85.208.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BEC222BDC3D for ; Wed, 31 Dec 2025 17:37:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.99 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767202648; cv=none; b=WLu40SEBvoHxJNhOQfEHIvlUUigrr3m5i9DK5pNq2tnM1NfquOH9f4RpdpPSKN76sitOnI3dyVts6zbbT/O/cCezKhCwiLJqj0t9CIdlK+hc0tBHZ98oMRvA2JJt8I4BxIa7G+7XX2ongPqLy1r43Bo8bRseB5pdNEhVH+W4gkI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767202648; c=relaxed/simple; bh=WVYQGhpSvliDxHIS3oLwubflGM55eX6MoNuxuho0+Uc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dU4PeM+S9GxLOfHxOiGRqytSW5ntsGRG2FaEDoGBVVBy9QzI6qbU+I9uAe3t/QnbMbjpjEK0tGgP8eSn5bL3InhIrqUchoMdH6C++xApyOwaI+nnT8W5H8U4VmxDdDmz73feGuFcHkyQkzzP7dZq6CFdKMflGTxfPhPk/T11wUI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=PeLjBzk6; arc=none smtp.client-ip=209.85.208.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="PeLjBzk6" Received: by mail-ed1-f99.google.com with SMTP id 4fb4d7f45d1cf-64b5eb14e88so2484215a12.2 for ; Wed, 31 Dec 2025 09:37:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1767202643; x=1767807443; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CPtJoM4BdsW1AWCT74nIdjccEavCkJ/nIFp8Za4jgwE=; b=PeLjBzk6HD/l348HM8MLW1j5beEB21RZ112O4uvyZIZLMA55gblkaKZ2+Mb91hFnY5 3xyXEyfKbkFaEORoDTeGujBGvo9Mgde/bR0k4fKNzUS85UwkKgp3W5G4IWKl/0Yt8686 aGl8ymFQekBTdTHyUb7uPi+WekMbyjU8IfBgsPor4YDI1E+PS5EKR5VYt4xEARUdsEG6 Cb2SRjHTdMhPk5pvMjOOO25PIByS+KZaJmPUfT8OTpglbwB7dzhmMz9mcJNd0PEjCHyK ETY4LqgN3btjlMPs9EUGii6evKaTJ36XHobXs1b3Ubn4MCXySU0QB2d2dDRgXN3fWOaH r36w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767202643; x=1767807443; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=CPtJoM4BdsW1AWCT74nIdjccEavCkJ/nIFp8Za4jgwE=; b=Whoup/6LXgpeZlsFfJp4thavsN4sRKXfmkcctqXUuLcGwOAvQ4N1CJC4NX3epL0sVH 1h7NbqCpIUSwIcFb/GN0Bv2RrQRNssewu8DwZL9JLu+WlLunO/31PzsnRKIq61oNpcYi +Y+K7MnzoUWn6NCsZPpXPSw2N3KCl5+NwZZzIsVQysFn2DCSPhgDlTjbBZBKAnwNZroX jBf4WXm0/DF8fMcv+Wjime5z0RV/FB8odOSULnpsCsld832CnR0QNtZsSp2rgJ5UYa3w iW7nqZuUc5dBGJX7+u+W7YflDohHrVotkhE8/JBeg6rykvCuQxhYgNMO2HR5cVRKbbh0 zouA== X-Forwarded-Encrypted: i=1; AJvYcCXee12IxJGw2m+h2Lki4LIKA1U6/fsnYirgH9BgUx2gDuKMaJwqHuuhxoFbCB2J4vEgdvKJke/VXp7iO20=@vger.kernel.org X-Gm-Message-State: AOJu0YwGtsoGEebOaF0Dx0xXIUJ0MrfgAxvdk715FFBkb7G3UuH/h5LH /EryiGj+vXB7Vpic5IdlT7OuT2/iCezPaOv4Y6ETigmugzU9nmSUVo6p44XtSuCqLsD+Zr62f9Z 1t/Dtnxm61QLwMu4w6iFgDvhSOEanqFcF1/mf X-Gm-Gg: AY/fxX7VOB5UGWlH4+VwGDBIofbKUTPhVSjOd9CtFddhguUT7EBF9qtA52PrxCzetpC IAu5QmxiJdrrSSPSOWZA4a15B+JjvYdgw2SDvEr11eHC1q04f+AfL/cLfBMxT+ULG9XdYAxxM5d 6knTxxj9dBASvmLSyYHym7C5iYpB1QjfxL5he0T/+yVAlm9TrD6DGmBWFdZDjVKSbCuEY/gi4dv c8kNSm5ysDm0I6qdQWThPQWBoU5BGeMiz8YzcGUX6eXrzjgSvay8salPHhoWtx62c8srZi7v9It Oincz4RyJ1t01nCgR3CMtwFf+RRKFdnR1MFZVXb2n95JVcJXMO/Qg883lj6Yz1Swra/lfbU2a3d MPTGVhKvOcmCw0cUa/KUwYWTBjrb0xl4VwKq9Z9ItbA== X-Google-Smtp-Source: AGHT+IEi03ZQZjXAnQiEZTFYKeIsY3RuVDBYnomwpJqWJlLI46xo1bUhyzXBcQMLZiL4Tr8s0Id0tWh610wS X-Received: by 2002:a17:907:7209:b0:b76:3548:c34c with SMTP id a640c23a62f3a-b80372602eamr1981571766b.8.1767202643158; Wed, 31 Dec 2025 09:37:23 -0800 (PST) Received: from c7-smtp-2023.dev.purestorage.com ([208.88.159.129]) by smtp-relay.gmail.com with ESMTPS id a640c23a62f3a-b8037d637fasm499254166b.58.2025.12.31.09.37.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Dec 2025 09:37:23 -0800 (PST) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (dev-csander.dev.purestorage.com [10.49.34.222]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id CA50C34076F; Wed, 31 Dec 2025 10:37:21 -0700 (MST) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id C307BE4234A; Wed, 31 Dec 2025 10:37:21 -0700 (MST) From: Caleb Sander Mateos To: Jiri Kosina , Benjamin Tissoires , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Tejun Heo , David Vernet , Andrea Righi , Changwoo Min , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , David Ahern , Jamal Hadi Salim , Cong Wang , Jiri Pirko , "D. Wythe" , Dust Li , Sidraya Jayagond , Wenjia Zhang , Mahanta Jambigi , Tony Lu , Wen Gu , Shuah Khan , Maxime Coquelin , Alexandre Torgue Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, sched-ext@lists.linux.dev, linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Caleb Sander Mateos Subject: [PATCH 2/5] HID: bpf: make __bpf_hid_bpf_ops const Date: Wed, 31 Dec 2025 10:36:30 -0700 Message-ID: <20251231173633.3981832-3-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20251231173633.3981832-1-csander@purestorage.com> References: <20251231173633.3981832-1-csander@purestorage.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now that struct bpf_struct_ops's cfi_stubs field is a const pointer, declare the __bpf_hid_bpf_ops global variable it points to as const. This allows the global variable to be placed in readonly memory. Signed-off-by: Caleb Sander Mateos --- drivers/hid/bpf/hid_bpf_struct_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/bpf/hid_bpf_struct_ops.c b/drivers/hid/bpf/hid_bpf= _struct_ops.c index 702c22fae136..30ddcf78e0ea 100644 --- a/drivers/hid/bpf/hid_bpf_struct_ops.c +++ b/drivers/hid/bpf/hid_bpf_struct_ops.c @@ -286,11 +286,11 @@ static int __hid_bpf_hw_request(struct hid_bpf_ctx *c= tx, unsigned char reportnum static int __hid_bpf_hw_output_report(struct hid_bpf_ctx *ctx, u64 source) { return 0; } =20 -static struct hid_bpf_ops __bpf_hid_bpf_ops =3D { +static const struct hid_bpf_ops __bpf_hid_bpf_ops =3D { .hid_device_event =3D __hid_bpf_device_event, .hid_rdesc_fixup =3D __hid_bpf_rdesc_fixup, .hid_hw_request =3D __hid_bpf_hw_request, .hid_hw_output_report =3D __hid_bpf_hw_output_report, }; --=20 2.45.2 From nobody Sat Feb 7 17:04:33 2026 Received: from mail-lj1-f226.google.com (mail-lj1-f226.google.com [209.85.208.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8981126F0A for ; Wed, 31 Dec 2025 17:37:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.226 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767202651; cv=none; b=JuTA6TBzICxp2rksA5JN0/pQueFCCS8XYLexjKPAOJdUFTwzjqGG5ykn9fc5BgzTJEifySvREWsaRCVqX+XXySuBky4ymBkccj4elY/JKTovhXeaQjUneuyvX5wdNwhvAPP8lgSf/T9f3raNLqkv2rgl+QxW18aD8kwZADWVkuY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767202651; c=relaxed/simple; bh=b8KXgdkuB2rBCBMKoOj23zAGkLun2ndQut4LRQn9YLA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sSZeC7h5qj0DHXqLx7mZW0S7Oy633lsr7cE8GPv2TffnUcPRbsvDmmoJ0UPMkPmA9Eb/0BFsxTK4TTSSxioa6rfsQ76JeWSKi/Q8LAoZz9GBAkWcKKy8N2dYrJsbVAkfiQOYZ/WzUVGM0SqwhnIbmgZv5O/bWVbvShH9E6NknTI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=B65Bki7b; arc=none smtp.client-ip=209.85.208.226 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="B65Bki7b" Received: by mail-lj1-f226.google.com with SMTP id 38308e7fff4ca-380091744caso11509571fa.0 for ; Wed, 31 Dec 2025 09:37:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1767202646; x=1767807446; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z65KNwFWdBB4vKMl4Q2RH4hcwYRlqC7hzCG8+fs8pqw=; b=B65Bki7bNr5asR8gLT4UQO5QpsWvo24HYhFuxdOGrbh73k/Zr92fazIv6voAUW/2PU NRPRaa4XHs2xXve3L2aLfmP/X3GSNnom4rxPzZrxyrixO6Ux7nOIe8iYhtQ1ssVInkFM iAp3yel9cShgORh0d//av01ytc7Rj2cNdxJvUhhQHfIos3TiTrVRDeOu1/02104vqjtG RRS0sSH3EaSEgt6jotTfiemRL79/aQhhbmW0ch3pRyntq2bKZpwNL8WVuqLaJLpRtFGy ldEpIkoNzRCn8ozbNaHEkZRfejpnWZArPOsmBAtc2jDNT1N+OMNTUhmTxc0XZcfCIgaE gYww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767202646; x=1767807446; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Z65KNwFWdBB4vKMl4Q2RH4hcwYRlqC7hzCG8+fs8pqw=; b=pW82wOUE8wmGhNnuwtqaXs/Nqojmu2c7g50AoDjK6T0xiaRqnAu+ZcEq/t6dEGCjy2 HoVwwiFebBn1MmMmmOibmDWRDdeSUshuSip7FT6G3a9wFW2//xsWTZOpj5Buoh2VDwLj oBDFDKVE82eqt5ZSrcyxWhEsS6AiWMo55dRqaxUhWFJEuUDFG2S2btVunu7kHUH+BHn5 Hx5c5g+Lt2/wsLS2WErCDgrP43n6Fri/sRiH72a16aLYpyqL8PI2FsXei/d+XVhSshw6 nnheRvcTiXciqYU7Z+zNJPPVXK0IDxeuU6fH8UuZEj+sO63gZhewUBzZhDypUpGjOKmR piRw== X-Forwarded-Encrypted: i=1; AJvYcCVILMHMmKc4u/ocGiT0JZCrXRHW4tdwRlL0ygxvWN4gKPBazADWeojEPD3RZG0LJncx0RDBISM7Oe0B+jk=@vger.kernel.org X-Gm-Message-State: AOJu0YxV2YKiyNu6v1Sfr5nl8o6YzGgeGvMloHghJZmmzVlai4lyXpJU OrLZeCiqrZV604YeeOumVSEjy2wBEfo1bR7uzgJkTfPaAymAbRAv2wMn7TfTjzW8wHYODLAjMfh xrT4DZFePldaSWUga7+YjK77FEXh1fXNPDGzA X-Gm-Gg: AY/fxX449Ts4tjkvO7E+zoC3h7QNWGiuRrTbWNBvj408U9/lCUfI4HRQKnCwMe5c0fS ooTjPA2vPp/pcWVoRqAv26RSEtFta5o5FS6efiqutNRRlEv3c0KjUPxIe+zraKSkE/raXtZADxG 5vi5R6ywTHg1PcaBKvciILh4nbc8A0D381DSvMFh5Z4PiqrqE5EIhvqfZ64FqgY7tf9qVvtchHl iv281KAndxEYgq+1l4EIHXRbAzMF1xVqwT7vZ454cf3cl12purjH6gemV2NA9//S6lxQ45qiARS BMeoYeaiEpglSs5p/x3hJxFIwQbTV7KEJGHIQthq9bpvKNctvINQtxx3YFcllv5NFFD9k3nnP2O JBE5CXjwQEY7sr08CIqJG+lD5ImKllZT0wX8VJ1GAjg== X-Google-Smtp-Source: AGHT+IHDF3ca8umxceWHVP6etyuOqrKJuvP7YcuUqaxQdob64KBatF2Z5P+pEZdYR5Wycxsg5VpsXr4tuz+m X-Received: by 2002:a05:6512:3a84:b0:592:f383:3aad with SMTP id 2adb3069b0e04-59a17df4092mr7765992e87.8.1767202645513; Wed, 31 Dec 2025 09:37:25 -0800 (PST) Received: from c7-smtp-2023.dev.purestorage.com ([208.88.159.128]) by smtp-relay.gmail.com with ESMTPS id 2adb3069b0e04-59a18637640sm7186949e87.29.2025.12.31.09.37.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Dec 2025 09:37:25 -0800 (PST) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (dev-csander.dev.purestorage.com [10.49.34.222]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id 293C9341FB6; Wed, 31 Dec 2025 10:37:22 -0700 (MST) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id 22C62E4234A; Wed, 31 Dec 2025 10:37:22 -0700 (MST) From: Caleb Sander Mateos To: Jiri Kosina , Benjamin Tissoires , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Tejun Heo , David Vernet , Andrea Righi , Changwoo Min , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , David Ahern , Jamal Hadi Salim , Cong Wang , Jiri Pirko , "D. Wythe" , Dust Li , Sidraya Jayagond , Wenjia Zhang , Mahanta Jambigi , Tony Lu , Wen Gu , Shuah Khan , Maxime Coquelin , Alexandre Torgue Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, sched-ext@lists.linux.dev, linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Caleb Sander Mateos Subject: [PATCH 3/5] sched_ext: make __bpf_ops_sched_ext_ops const Date: Wed, 31 Dec 2025 10:36:31 -0700 Message-ID: <20251231173633.3981832-4-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20251231173633.3981832-1-csander@purestorage.com> References: <20251231173633.3981832-1-csander@purestorage.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now that struct bpf_struct_ops's cfi_stubs field is a const pointer, declare the __bpf_ops_sched_ext_ops global variable it points to as const. This allows the global variable to be placed in readonly memory. Signed-off-by: Caleb Sander Mateos --- kernel/sched/ext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c index 94164f2dec6d..af8250b64f47 100644 --- a/kernel/sched/ext.c +++ b/kernel/sched/ext.c @@ -5336,11 +5336,11 @@ static s32 sched_ext_ops__init(void) { return -EINV= AL; } static void sched_ext_ops__exit(struct scx_exit_info *info) {} static void sched_ext_ops__dump(struct scx_dump_ctx *ctx) {} static void sched_ext_ops__dump_cpu(struct scx_dump_ctx *ctx, s32 cpu, boo= l idle) {} static void sched_ext_ops__dump_task(struct scx_dump_ctx *ctx, struct task= _struct *p) {} =20 -static struct sched_ext_ops __bpf_ops_sched_ext_ops =3D { +static const struct sched_ext_ops __bpf_ops_sched_ext_ops =3D { .select_cpu =3D sched_ext_ops__select_cpu, .enqueue =3D sched_ext_ops__enqueue, .dequeue =3D sched_ext_ops__dequeue, .dispatch =3D sched_ext_ops__dispatch, .tick =3D sched_ext_ops__tick, --=20 2.45.2 From nobody Sat Feb 7 17:04:33 2026 Received: from mail-yx1-f98.google.com (mail-yx1-f98.google.com [74.125.224.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE24D2BD033 for ; Wed, 31 Dec 2025 17:37:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.98 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767202648; cv=none; b=QVP5ad694Xn5BAATaJrkPDn2Cy8+0BE59iCK7vRNe5uAReUegAy5T1MJXVNSK1v0FZRjG2yKnJJaS25cV+o99Kdkby+4EawuNv5aPQv8AccW1zduvl6+8ZN4KzjdzB1S4+erzhD6kaWiqxrUTfzRnwjE1mRv/Amt9FoG1HvzmGM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767202648; c=relaxed/simple; bh=j34IflS+eKTJabK0NTs8ebKaiD8zpNvLHhM3IHbHvyM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=scwm9BB6s+dStcG+CEYn79BuXh5kP7X9HTPQgP5czWzrU8r5L49mWL6vdwrouIUJja4oKz882LPDIBSBJEevmHeC9nP6OT9Lit3+ILgT7U/y/QNbcjbIbEPhz7gYwwuhvGztVpYTKZlZZkxiVJNGA5GwgalxxeSxtIl8kcahkBM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=aMZ0FO8e; arc=none smtp.client-ip=74.125.224.98 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="aMZ0FO8e" Received: by mail-yx1-f98.google.com with SMTP id 956f58d0204a3-6447a204210so1570037d50.0 for ; Wed, 31 Dec 2025 09:37:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1767202644; x=1767807444; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mnMrXoOdHpUw8dswWZLzwCvPJsKuA+x+IPeEnhc/WiU=; b=aMZ0FO8eE1ThIaxDlcweBOpkPbQXQynRdRZz9HbAePBd6TuFenODEQ1b/bVzry7W94 WW2E1+MWmmXR65vJ8OzpXntfG3slaxcCvgmoBYSJjTjwRl+c4LDSo1rehO3z/yNfGsQq N0vMsKzGvmtafdCEO97d30auvv1z3sbN9tWUCawyigEykxJuFMS68HN3V8UEOSFd+81z tljzvFesn1+clmFE2E6Df+IdZfygCc1mgY4g6ZuN02IA4YBEdNiGnHykh6oWc4VoiFBS nXcgO9fRKcKWPlSQbLI5flFEBOnCQQDI5GCEso0++yp9k436pOJyjnvRWfwXbfIzHNyi z95A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767202644; x=1767807444; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=mnMrXoOdHpUw8dswWZLzwCvPJsKuA+x+IPeEnhc/WiU=; b=V3IxWwqmA7U79kyiVt8uGe5uM3z+QBBDNHnZSnJoRYqjddz1DCSyPwznfAvKmzkmNp oFbiuDn6fSwYjYwrQPrL5jL5YjOpMBZlGnMkGTklqxlXs+PkHVbWZmRUplpA6SmI0mEK BHn9FY1Q0P//CLuphPMQk0Vv8rJS92+hqLWCEw3hdR/WQ3vrht7bcqeYbVrXayQCIQdR 4NAsZi6FuhSIk9GEuIHbzoT/D91VM4NrlWeA0k9cjti7YT6OLX8KqCEJ7/jZOJQf87Sd uPJWK9PfPYJ1MxEKAh83PVLoDJOJmbOm6vji2sOG5oUoz/sB+fbG6G/nDHn5MuBqXCmi mSEg== X-Forwarded-Encrypted: i=1; AJvYcCVeolXAbXBM9Z/DrlRYM38H1frV1fuNLLoluUEuXtYaim8+Q4KutxYOmUUMMuBlVVjYRqZ22PoTJgr5P88=@vger.kernel.org X-Gm-Message-State: AOJu0YzKrndXnMbcUzIsPRVhzSbepOt8surmCR2MqxEqjcQTW1FeZD+R izXSfPLHIemLZhS2C77HAa022voZKCGJ5lt3G01U7M1ZuMNtwhR+8b0t90pOR9UtAb9tovJ9wM+ WV550Xxgfp8BAmdllM2qbreVEBd61iYT8iZDIbTM10MF6KftP6ioV X-Gm-Gg: AY/fxX6ZYz0eyDbWPkd5M1DIJqPXdzgNgzZieCfKGMf3c2X0ivOjNRpWzhVpWTEPwZ4 EhgCrPSar2CauRA390CoE6kZWCDGxjf6wdQX8Zv6NrHaaINM+RLBko6x+kgaXhQkZIApX/bVzaI qw0+kDuH3WeNIroWWzUbPdBreILnSXv6MPtYG4ugnk7r7i/t/jXr2uZFraSwrAt0vdrjUzfjVH7 XlCU5x5WTzlNKY+cHueEK/VgWmMs2YsKYxdr+yD8Wyc7ppViSRc62t6XyNgYfw3U1IVuAe1M0nh /NhfRdx0MQ3oGsKSwzwXAIAdK20VdqBK2Vev+5vT9lLo0MfOt8SA9oCMUErGUGFQNFqeSNnamSY TsF5iG9U80qUxl5ngCIZrgZo+PH8= X-Google-Smtp-Source: AGHT+IGMlV6Wi+eGoWgPSuCkcnDiX+llPw/Yxuw1WalLbJ19UweEl9/hcQpJmEfRSWezvyZ75uRmTz4c8mpi X-Received: by 2002:a05:690c:387:b0:790:1669:d796 with SMTP id 00721157ae682-7901669d995mr128786567b3.1.1767202643785; Wed, 31 Dec 2025 09:37:23 -0800 (PST) Received: from c7-smtp-2023.dev.purestorage.com ([2620:125:9017:12:36:3:5:0]) by smtp-relay.gmail.com with ESMTPS id 00721157ae682-78fc994a092sm16171307b3.6.2025.12.31.09.37.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Dec 2025 09:37:23 -0800 (PST) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (dev-csander.dev.purestorage.com [10.49.34.222]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id 738753420F4; Wed, 31 Dec 2025 10:37:22 -0700 (MST) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id 6E501E4234A; Wed, 31 Dec 2025 10:37:22 -0700 (MST) From: Caleb Sander Mateos To: Jiri Kosina , Benjamin Tissoires , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Tejun Heo , David Vernet , Andrea Righi , Changwoo Min , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , David Ahern , Jamal Hadi Salim , Cong Wang , Jiri Pirko , "D. Wythe" , Dust Li , Sidraya Jayagond , Wenjia Zhang , Mahanta Jambigi , Tony Lu , Wen Gu , Shuah Khan , Maxime Coquelin , Alexandre Torgue Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, sched-ext@lists.linux.dev, linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Caleb Sander Mateos Subject: [PATCH 4/5] net: make cfi_stubs globals const Date: Wed, 31 Dec 2025 10:36:32 -0700 Message-ID: <20251231173633.3981832-5-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20251231173633.3981832-1-csander@purestorage.com> References: <20251231173633.3981832-1-csander@purestorage.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now that struct bpf_struct_ops's cfi_stubs field is a const pointer, declare the __bpf_bpf_dummy_ops, __bpf_ops_tcp_congestion_ops, __bpf_ops_qdisc_ops, and __smc_bpf_hs_ctrl global variables it points to as const. This allows the global variables to be placed in readonly memory. Signed-off-by: Caleb Sander Mateos --- net/bpf/bpf_dummy_struct_ops.c | 2 +- net/ipv4/bpf_tcp_ca.c | 2 +- net/sched/bpf_qdisc.c | 2 +- net/smc/smc_hs_bpf.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/bpf/bpf_dummy_struct_ops.c b/net/bpf/bpf_dummy_struct_ops.c index 812457819b5a..198152dbce9a 100644 --- a/net/bpf/bpf_dummy_struct_ops.c +++ b/net/bpf/bpf_dummy_struct_ops.c @@ -296,11 +296,11 @@ static int bpf_dummy_test_2(struct bpf_dummy_ops_stat= e *cb, int a1, unsigned sho static int bpf_dummy_test_sleepable(struct bpf_dummy_ops_state *cb) { return 0; } =20 -static struct bpf_dummy_ops __bpf_bpf_dummy_ops =3D { +static const struct bpf_dummy_ops __bpf_bpf_dummy_ops =3D { .test_1 =3D bpf_dummy_ops__test_1, .test_2 =3D bpf_dummy_test_2, .test_sleepable =3D bpf_dummy_test_sleepable, }; =20 diff --git a/net/ipv4/bpf_tcp_ca.c b/net/ipv4/bpf_tcp_ca.c index e01492234b0b..bd2ce4ff1762 100644 --- a/net/ipv4/bpf_tcp_ca.c +++ b/net/ipv4/bpf_tcp_ca.c @@ -306,11 +306,11 @@ static void __bpf_tcp_ca_init(struct sock *sk) =20 static void __bpf_tcp_ca_release(struct sock *sk) { } =20 -static struct tcp_congestion_ops __bpf_ops_tcp_congestion_ops =3D { +static const struct tcp_congestion_ops __bpf_ops_tcp_congestion_ops =3D { .ssthresh =3D bpf_tcp_ca_ssthresh, .cong_avoid =3D bpf_tcp_ca_cong_avoid, .set_state =3D bpf_tcp_ca_set_state, .cwnd_event =3D bpf_tcp_ca_cwnd_event, .in_ack_event =3D bpf_tcp_ca_in_ack_event, diff --git a/net/sched/bpf_qdisc.c b/net/sched/bpf_qdisc.c index adcb618a2bfc..8f9a6440f113 100644 --- a/net/sched/bpf_qdisc.c +++ b/net/sched/bpf_qdisc.c @@ -427,11 +427,11 @@ static void Qdisc_ops__reset(struct Qdisc *sch) =20 static void Qdisc_ops__destroy(struct Qdisc *sch) { } =20 -static struct Qdisc_ops __bpf_ops_qdisc_ops =3D { +static const struct Qdisc_ops __bpf_ops_qdisc_ops =3D { .enqueue =3D Qdisc_ops__enqueue, .dequeue =3D Qdisc_ops__dequeue, .init =3D Qdisc_ops__init, .reset =3D Qdisc_ops__reset, .destroy =3D Qdisc_ops__destroy, diff --git a/net/smc/smc_hs_bpf.c b/net/smc/smc_hs_bpf.c index 063d23d85850..5c562e2a15be 100644 --- a/net/smc/smc_hs_bpf.c +++ b/net/smc/smc_hs_bpf.c @@ -60,11 +60,11 @@ static int __smc_bpf_stub_set_tcp_option_cond(const str= uct tcp_sock *tp, struct inet_request_sock *ireq) { return 1; } =20 -static struct smc_hs_ctrl __smc_bpf_hs_ctrl =3D { +static const struct smc_hs_ctrl __smc_bpf_hs_ctrl =3D { .syn_option =3D __smc_bpf_stub_set_tcp_option, .synack_option =3D __smc_bpf_stub_set_tcp_option_cond, }; =20 static int smc_bpf_hs_ctrl_init(struct btf *btf) { return 0; } --=20 2.45.2 From nobody Sat Feb 7 17:04:33 2026 Received: from mail-lj1-f228.google.com (mail-lj1-f228.google.com [209.85.208.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0A8B2BE622 for ; Wed, 31 Dec 2025 17:37:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.228 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767202650; cv=none; b=W3SYT7A1rqQuTVbpBoIB5PNwFTWxFPqltqdiKmk49B0SWr7wHeH+xDw3KZkA4hAdPm5ZCqnPuyab/6UlY3DRl+BFhIdIuunoK6r9cI01354nyBdVmpp1xlMbcXRPY4uR5x4t3D7MbcHYQ/vnuuUUdmTZnwcuEoC0Xj8Z55Y+1GI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767202650; c=relaxed/simple; bh=+qs2O0p6JSmasUPfUb0PrNjt2zEzZFmnX/PzeN+aGlM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s4icu0p4Jar0xBZ8BcpgXHUN2qiq+1WQyZYpnglWTZWTaeBVun33D00ZnZOBX4lKzEjcX2yzEQG0OpHRaZdIxUYh1G+4EI6sI/m4c343uc7VC7dPyBS5taHHCgsnzz6mrc97qM6Jjuow0r5tqaNDDo82XVwRTWi8pvUTEmsqF+s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=SWgzDxwL; arc=none smtp.client-ip=209.85.208.228 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="SWgzDxwL" Received: by mail-lj1-f228.google.com with SMTP id 38308e7fff4ca-37f8cc9a9feso12947611fa.0 for ; Wed, 31 Dec 2025 09:37:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1767202645; x=1767807445; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=evGP5W8eaS0gGQmtryNYpPPxNCoy7QWmqYRyuLboZRo=; b=SWgzDxwLxk4IHhdqL7am7ZWGGW/UgDtLxQpB+RB2EAoNRxqgf0pqEqmrgtUSkdLEOs s3Kz+33lY+oL4kuEITZl7eHMAgn7Z0tA8qWlvOJW/g5YHix/fJvLf7GxnpeR/5Wx+loX EqeygASMuZJ+/kDPe0vQKeT6WA2TTwLacxgqR7Z6n9C8JQIDlN9eWnMNIegX6MwfmQKC /no0mibjlmypLz4CcnP/45nRK40FnjnrNvXp7r0oy0nHxRMYUbu6hAVFmlqkbnpFcnnp SRgM6+mle0M2/xjOs2M+YzOw9VAQqBl48FtLV8KP9ptlwe46UYXjP5i/SSXaeqELQypW UrQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767202645; x=1767807445; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=evGP5W8eaS0gGQmtryNYpPPxNCoy7QWmqYRyuLboZRo=; b=PBVB7lEXSscdDw+xI5d4e+EXk4aAnBhx4C/8qG2C2CNzuwO4oT52GvsNOpspn3l8Vh QqzydnFpfWka+xYl/u4wVYP63pDwHaNO1UNb3xvohi+G023QcOZ9b+hzFv5rB7Z+L7ZR o4iE5po7YmgavHvgl+6a4FiBkrvyD1ouWtqS6h9mK4aMmp6Y6xA/UziKuhsddeFobVcR Kb7TzejsM5lnocewBN20ERg6iO6Tlo64IrsZp/AiYtzyiRseCS7CZ5ys91RtJmClDMrr ZvQzE5Jg/DirgAJuukKjhfeQtUfiFf4+a82WnoocDFCHwKnZTRx+VhQW9IFSt7uMFwuC fD6A== X-Forwarded-Encrypted: i=1; AJvYcCXm+LZCcCK7yshAVXnB8Euli0/lwc3fqwHpaGSI6+vIPYycV2ygZTSIEncyUGioMh15zllbGFQx4HCLe8g=@vger.kernel.org X-Gm-Message-State: AOJu0YwHc854IqKaGpVmncTW1HSzjhIZu5H1Iija0KpVPQYluYNgV1r2 M7QL3K2ZDUlZFm6AsCWtkqHybeGWF2v2wp1XGIZ1OZE8sVX0BlXRr1uK3PXqRw6DK06b73ZoxDh eC34GJhejAGRtOQVagihDllgAlk02HxZ1SPe2 X-Gm-Gg: AY/fxX6BbOOFbkWUFvFGBzkq2lBfj1Z5t7nSQfNkiHWxhvbHzjQSLSRunq31LchfQqy 0E689ch9qVcQJnx60AhSZ21Xz6JcgYlr7RF3MivNj3YN5QkPpR2NUhyi/ru48jUnbgQPifvF2yM FgH7n/YPMtMQmUUyYf8VbeNspJaQvtwPIUSrcKanolrMw8txwW2UG56UIBsgefbVss6Qw4du5PL nJLDYxEcSuHNwfQvM80vzA/YUB1vwk946mB/sKReOLbWU6jNDd8+lCDcW3q6E1k62sQyi3HssQv KYRGO6bNzr5UbiYgubl49CmeEaXzxwNXbnMRUCzdt/3fn4gqBhTOUYh1jcbkk8feeib28uZaOSQ 0a+s56Ws9QCNw44XSaT/hx07yUtpkp9Sy1maosKKOOA== X-Google-Smtp-Source: AGHT+IH27R9QYE1O2Ywp3/SP9pHkjO2yXz4EIipzqt9GsBoAsX+S1qf9N7p0ezxigbjNdJtb7dYT0W/PMzz9 X-Received: by 2002:a05:6512:2388:b0:598:e3ed:b43e with SMTP id 2adb3069b0e04-59a17d75aacmr7318962e87.6.1767202644708; Wed, 31 Dec 2025 09:37:24 -0800 (PST) Received: from c7-smtp-2023.dev.purestorage.com ([208.88.159.129]) by smtp-relay.gmail.com with ESMTPS id 2adb3069b0e04-59a18641fe3sm7185875e87.60.2025.12.31.09.37.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Dec 2025 09:37:24 -0800 (PST) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (dev-csander.dev.purestorage.com [10.49.34.222]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id C9BEB342241; Wed, 31 Dec 2025 10:37:22 -0700 (MST) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id C3D39E4234A; Wed, 31 Dec 2025 10:37:22 -0700 (MST) From: Caleb Sander Mateos To: Jiri Kosina , Benjamin Tissoires , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Tejun Heo , David Vernet , Andrea Righi , Changwoo Min , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , David Ahern , Jamal Hadi Salim , Cong Wang , Jiri Pirko , "D. Wythe" , Dust Li , Sidraya Jayagond , Wenjia Zhang , Mahanta Jambigi , Tony Lu , Wen Gu , Shuah Khan , Maxime Coquelin , Alexandre Torgue Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, sched-ext@lists.linux.dev, linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Caleb Sander Mateos Subject: [PATCH 5/5] selftests/bpf: make cfi_stubs globals const Date: Wed, 31 Dec 2025 10:36:33 -0700 Message-ID: <20251231173633.3981832-6-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20251231173633.3981832-1-csander@purestorage.com> References: <20251231173633.3981832-1-csander@purestorage.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now that struct bpf_struct_ops's cfi_stubs field is a const pointer, declare the __test_no_cif_ops, __bpf_testmod_ops*, st_ops_cfi_stubs, and multi_st_ops_cfi_stubs global variables it points to as const. This tests that BPF struct_ops implementations are allowed to declare cfi_stubs global variables as const. Signed-off-by: Caleb Sander Mateos --- .../testing/selftests/bpf/test_kmods/bpf_test_no_cfi.c | 2 +- tools/testing/selftests/bpf/test_kmods/bpf_testmod.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/bpf/test_kmods/bpf_test_no_cfi.c b/too= ls/testing/selftests/bpf/test_kmods/bpf_test_no_cfi.c index 948eb3962732..1d76912f1a45 100644 --- a/tools/testing/selftests/bpf/test_kmods/bpf_test_no_cfi.c +++ b/tools/testing/selftests/bpf/test_kmods/bpf_test_no_cfi.c @@ -39,11 +39,11 @@ static void bpf_test_no_cfi_ops__fn_1(void) =20 static void bpf_test_no_cfi_ops__fn_2(void) { } =20 -static struct bpf_test_no_cfi_ops __test_no_cif_ops =3D { +static const struct bpf_test_no_cfi_ops __test_no_cif_ops =3D { .fn_1 =3D bpf_test_no_cfi_ops__fn_1, .fn_2 =3D bpf_test_no_cfi_ops__fn_2, }; =20 static struct bpf_struct_ops test_no_cif_ops =3D { diff --git a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c b/tools/t= esting/selftests/bpf/test_kmods/bpf_testmod.c index 90c4b1a51de6..5e460b1dbdb6 100644 --- a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c +++ b/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c @@ -295,11 +295,11 @@ static int bpf_testmod_test_3(void) static int bpf_testmod_test_4(void) { return 0; } =20 -static struct bpf_testmod_ops3 __bpf_testmod_ops3 =3D { +static const struct bpf_testmod_ops3 __bpf_testmod_ops3 =3D { .test_1 =3D bpf_testmod_test_3, .test_2 =3D bpf_testmod_test_4, }; =20 static void bpf_testmod_test_struct_ops3(void) @@ -1273,11 +1273,11 @@ bpf_testmod_ops__test_return_ref_kptr(int dummy, st= ruct task_struct *task__ref, struct cgroup *cgrp) { return NULL; } =20 -static struct bpf_testmod_ops __bpf_testmod_ops =3D { +static const struct bpf_testmod_ops __bpf_testmod_ops =3D { .test_1 =3D bpf_testmod_test_1, .test_2 =3D bpf_testmod_test_2, .test_maybe_null =3D bpf_testmod_ops__test_maybe_null, .test_refcounted =3D bpf_testmod_ops__test_refcounted, .test_return_ref_kptr =3D bpf_testmod_ops__test_return_ref_kptr, @@ -1300,11 +1300,11 @@ static int bpf_dummy_reg2(void *kdata, struct bpf_l= ink *link) =20 ops->test_1(); return 0; } =20 -static struct bpf_testmod_ops2 __bpf_testmod_ops2 =3D { +static const struct bpf_testmod_ops2 __bpf_testmod_ops2 =3D { .test_1 =3D bpf_testmod_test_1, }; =20 struct bpf_struct_ops bpf_testmod_ops2 =3D { .verifier_ops =3D &bpf_testmod_verifier_ops, @@ -1547,11 +1547,11 @@ static const struct bpf_verifier_ops st_ops_verifie= r_ops =3D { .gen_prologue =3D st_ops_gen_prologue, .gen_epilogue =3D st_ops_gen_epilogue, .get_func_proto =3D bpf_base_func_proto, }; =20 -static struct bpf_testmod_st_ops st_ops_cfi_stubs =3D { +static const struct bpf_testmod_st_ops st_ops_cfi_stubs =3D { .test_prologue =3D bpf_test_mod_st_ops__test_prologue, .test_epilogue =3D bpf_test_mod_st_ops__test_epilogue, .test_pro_epilogue =3D bpf_test_mod_st_ops__test_pro_epilogue, }; =20 @@ -1715,11 +1715,11 @@ static void multi_st_ops_unreg(void *kdata, struct = bpf_link *link) static int bpf_testmod_multi_st_ops__test_1(struct st_ops_args *args) { return 0; } =20 -static struct bpf_testmod_multi_st_ops multi_st_ops_cfi_stubs =3D { +static const struct bpf_testmod_multi_st_ops multi_st_ops_cfi_stubs =3D { .test_1 =3D bpf_testmod_multi_st_ops__test_1, }; =20 struct bpf_struct_ops testmod_multi_st_ops =3D { .verifier_ops =3D &bpf_testmod_verifier_ops, --=20 2.45.2