Linux Hardening
 help / color / mirror / Atom feed
* Re: [PATCH] gpiolib: Mark gpio_devt, gpiolib_initialized and gpio_stub_drv as __ro_after_init
       [not found] <20260516105737.45174-1-len.bao@gmx.us>
@ 2026-05-25  8:10 ` Linus Walleij
  2026-05-30 10:08   ` Len Bao
  0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2026-05-25  8:10 UTC (permalink / raw)
  To: Len Bao
  Cc: Bartosz Golaszewski, linux-gpio, linux-kernel,
	open list:KERNEL HARDENING (not covered by other areas):Keyword:b__counted_by(_le|_be)?b,
	Kees Cook

Hi Len,

thanks for your patch!

On Sat, May 16, 2026 at 12:58 PM Len Bao <len.bao@gmx.us> wrote:

> The 'gpio_devt' and 'gpiolib_initialized' variables are initialized only
> during the init phase in the 'gpiolib_dev_init' function and never
> changed. So, mark these as __ro_after_init.
>
> The 'gpio_stub_drv' variable is initialized only in the declaration and
> never changed. So, this variable could be 'const', but using the
> 'driver_register' and 'driver_unregister' functions discards the 'const'
> qualifier. Therefore, as an alternative, mark it as a __ro_after_init.
>
> Signed-off-by: Len Bao <len.bao@gmx.us>

Patches like this should be CC to linux-hardening.

Anyways it looks good to me!
Reviewed-by: Linus Walleij <linusw@kernel.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gpiolib: Mark gpio_devt, gpiolib_initialized and gpio_stub_drv as __ro_after_init
  2026-05-25  8:10 ` [PATCH] gpiolib: Mark gpio_devt, gpiolib_initialized and gpio_stub_drv as __ro_after_init Linus Walleij
@ 2026-05-30 10:08   ` Len Bao
  0 siblings, 0 replies; 2+ messages in thread
From: Len Bao @ 2026-05-30 10:08 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Len Bao, Bartosz Golaszewski, linux-gpio, linux-kernel,
	linux-hardening, Kees Cook

Hi Linus,

On Mon, May 25, 2026 at 10:10:02AM +0200, Linus Walleij wrote:
> Hi Len,
> 
> thanks for your patch!
> 
> On Sat, May 16, 2026 at 12:58 PM Len Bao <len.bao@gmx.us> wrote:
> 
> > The 'gpio_devt' and 'gpiolib_initialized' variables are initialized only
> > during the init phase in the 'gpiolib_dev_init' function and never
> > changed. So, mark these as __ro_after_init.
> >
> > The 'gpio_stub_drv' variable is initialized only in the declaration and
> > never changed. So, this variable could be 'const', but using the
> > 'driver_register' and 'driver_unregister' functions discards the 'const'
> > qualifier. Therefore, as an alternative, mark it as a __ro_after_init.
> >
> > Signed-off-by: Len Bao <len.bao@gmx.us>
> 
> Patches like this should be CC to linux-hardening.

Ok, next time I will CC to linux-hardening. Thanks for the guidance.

> Anyways it looks good to me!
> Reviewed-by: Linus Walleij <linusw@kernel.org>

Thanks for your time to look at this.

Regards,
Len Bao

> Yours,
> Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-30 10:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260516105737.45174-1-len.bao@gmx.us>
2026-05-25  8:10 ` [PATCH] gpiolib: Mark gpio_devt, gpiolib_initialized and gpio_stub_drv as __ro_after_init Linus Walleij
2026-05-30 10:08   ` Len Bao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox