Re: [PATCH] block/rnbd: Constify struct kobj_type

From: Chaitanya Kulkarni
Date: Mon Jul 08 2024 - 20:54:57 EST


On 7/8/2024 11:11 AM, Christophe JAILLET wrote:
> 'struct kobj_type' is not modified in this driver. It is only used with
> kobject_init_and_add() which takes a "const struct kobj_type *" parameter.
>
> Constifying this structure moves some data to a read-only section, so
> increase overall security.
>
> On a x86_64, with allmodconfig, as an example:
> Before:
> ======
> text data bss dec hex filename
> 4082 792 8 4882 1312 drivers/block/rnbd/rnbd-srv-sysfs.o
>
> After:
> =====
> text data bss dec hex filename
> 4210 672 8 4890 131a drivers/block/rnbd/rnbd-srv-sysfs.o
>
> Signed-off-by: Christophe JAILLET<christophe.jaillet@xxxxxxxxxx>

Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@xxxxxxxxxx>

-ck