From nobody Sun Feb 8 22:58:25 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