Re: [PATCH] i2c: virtio: Constify struct i2c_algorithm and struct virtio_device_id

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Christophe,

On Sun, Sep 08, 2024 at 08:52:07AM GMT, Christophe JAILLET wrote:
> 'struct i2c_algorithm' and 'struct virtio_device_id' are not modified in
> this driver.
> 
> Constifying this structure moves some data to a read-only section, so
> increase overall security, especially when the structure holds some
> function pointers, which is the case for struct i2c_algorithm.
> 
> On a x86_64, with allmodconfig:
> Before:
> ======
>    text	   data	    bss	    dec	    hex	filename
>    6663	    568	     16	   7247	   1c4f	drivers/i2c/busses/i2c-virtio.o
> 
> After:
> =====
>    text	   data	    bss	    dec	    hex	filename
>    6735	    472	     16	   7223	   1c37	drivers/i2c/busses/i2c-virtio.o
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
> --
> Compile tested only

Makes sense to me... if this works, you could pioneer a sequence
of simiar changes :-)

Merged to i2c/i2c-host.

Thanks,
Andi




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux