Re: [PATCH] rcuscale: Constify struct rcu_scale_ops

From: Christophe JAILLET

Date: Mon Nov 09 2026 - 12:37:27 EST


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@xxxxxxxxxx>
---
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.

CJ


Do you mind runtime testing it too if you still feel we should do it (and
provide reasons why)?

thanks,

Joel Fernandes