mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan@cryspen.com>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Joel Fernandes <joelagnelf@nvidia.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Josh Triplett <josh@joshtriplett.org>,
	Frederic Weisbecker <frederic@kernel.org>,
	Neeraj Upadhyay <neeraj.upadhyay@kernel.org>,
	Boqun Feng <boqun@kernel.org>,
	Uladzislau Rezki <urezki@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Zqiang <qiang.zhang@linux.dev>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	rcu@vger.kernel.org
Subject: Re: [PATCH] rcuscale: Constify struct rcu_scale_ops
Date: Tue, 10 Nov 2026 08:06:59 +0300	[thread overview]
Message-ID: <avKmc-690MOAGJc5@stanley.mountain> (raw)
In-Reply-To: <730e60cb-30fd-43a3-8152-543b4ba5878e@paulmck-laptop>

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.

regards,
dan carpenter


      reply	other threads:[~2026-11-10  5:07 UTC|newest]

Thread overview: 7+ 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 [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=avKmc-690MOAGJc5@stanley.mountain \
    --to=dan@cryspen.com \
    --cc=boqun@kernel.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --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®