From: Bradley Morgan <bradley.morgan@linux.dev>
To: paulmck@kernel.org
Cc: boqun@kernel.org, christophe.jaillet@wanadoo.fr, dan@cryspen.com,
dave@stgolabs.net, frederic@kernel.org, jiangshanlai@gmail.com,
joelagnelf@nvidia.com, josh@joshtriplett.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
mathieu.desnoyers@efficios.com, neeraj.upadhyay@kernel.org,
qiang.zhang@linux.dev, rcu@vger.kernel.org, rostedt@goodmis.org,
urezki@gmail.com
Subject: Re: [PATCH] rcuscale: Constify struct rcu_scale_ops
Date: Tue, 10 Nov 2026 19:01:36 +0000 [thread overview]
Message-ID: <CE48A881-9AAF-467F-A0FF-C8F853643888@linux.dev> (raw)
In-Reply-To: <b6f19ac5-1336-43f4-8bb3-a891984adb19@paulmck-laptop>
On 10 November 2026 18:34:00 GMT, "Paul E. McKenney" <paulmck@kernel.org>
wrote:
>On Tue, Nov 10, 2026 at 08:06:59AM +0300, Dan Carpenter wrote:
>> On Mon, Nov 09, 2026 at 10:44:16AM -0800, Paul E. McKenney wrote:
>> > On Mon, Nov 09, 2026 at 06:32:15PM +0100, Christophe JAILLET wrote:
>> > > Le 09/11/2026 à 00:06, Joel Fernandes a écrit :
>> > > > On Sat, Nov 07, 2026 at 10:02:25PM +0100, Christophe JAILLET
>wrote:
>> > > > > 'struct rcu_scale_ops' is not modified in this driver.
>> > > > >
>> > > > > Constifying these structures moves some data to a read-only
>section, so
>> > > > > increases overall security, especially when the structure holds
>some
>> > > > > function pointers.
>> > > > >
>> > > > > On a x86_64, with allmodconfig:
>> > > > > Before:
>> > > > > ======
>> > > > > text data bss dec hex filename
>> > > > > 45585 24946 2816 73347 11e83 kernel/rcu/rcuscale.o
>> > > > >
>> > > > > After:
>> > > > > =====
>> > > > > text data bss dec hex filename
>> > > > > 46545 23986 2816 73347 11e83 kernel/rcu/rcuscale.o
>> > > > >
>> > > > > Signed-off-by: Christophe JAILLET
><christophe.jaillet@wanadoo.fr>
>> > > > > ---
>> > > > > Compile tested only.
>> > > >
>> > > > rcuscale is a test kernel module, is it worth adding boilerplate
>for
>> > > > non-production code sighting security reasons?
>> > >
>> > > Oups, now I better understand Bradley Morgan comments.
>> > >
>> > > I didn't notice it was a test module.
>> > > My patch makes no more sense, as it is not hardening runtime, so
>feel free
>> > > to just drop it.
>> > >
>> > > Sorry for the noise and not seeing it by myself.
>> >
>> > Although the header comment does say "Read-Copy Update module-based
>> > scalability-test facility", maybe there is something that should be
>> > done to more clearly mark code that is not to be used in production.
>> > And maybe to inform the LLM review bots of this.
>> >
>> > But this is bigger than just RCU.
>>
>> Christophe has been constify things for years and years. There is
>> an argument to be made that it's just the right thing to do whether
>> this is test code or not. Someone might copy and paste it, for
>> example.
>>
>> Of course, everyone is overloaded with AI. I feel like normal cleanup
>> patches are more likely to get NAKed because everyone is just totally
>> overwhelmed.
>
>Fair enough, though rcutorture.c (in the same directory as rcuscale.c)
>*does* write to its counterpart to this structure. The point being that
>this is an optimization-like thing rather than a prohibition-like thing.
>
>So we might want some way to differentiate between these two cases.
Well, I'm not saying "no this shouldn't happen", but the benefits are
negligible ISH. Well, Paul, what do you reckon? I'm not fussed, just a bit
"ehhh..."
>
> Thanx, Paul
>
>
--- Thanks!
prev parent reply other threads:[~2026-11-10 19:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-07 21:02 Christophe JAILLET
2026-11-07 23:25 ` Bradley Morgan
2026-11-08 20:21 ` Christophe JAILLET
2026-11-08 23:06 ` Joel Fernandes
2026-11-09 17:32 ` Christophe JAILLET
2026-11-09 18:44 ` Paul E. McKenney
2026-11-10 5:06 ` Dan Carpenter
2026-11-10 18:34 ` Paul E. McKenney
2026-11-10 19:01 ` Bradley Morgan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CE48A881-9AAF-467F-A0FF-C8F853643888@linux.dev \
--to=bradley.morgan@linux.dev \
--cc=boqun@kernel.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dan@cryspen.com \
--cc=dave@stgolabs.net \
--cc=frederic@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=joelagnelf@nvidia.com \
--cc=josh@joshtriplett.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=neeraj.upadhyay@kernel.org \
--cc=paulmck@kernel.org \
--cc=qiang.zhang@linux.dev \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=urezki@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®