[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <59fe0f83-168c-4f23-b2bf-504649f29d75@rowland.harvard.edu>
Date: Sat, 24 Aug 2024 11:20:58 -0400
From: Alan Stern <stern@...land.harvard.edu>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Oliver Neukum <oneukum@...e.com>, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org, linux-usb@...r.kernel.org,
usb-storage@...ts.one-eyed-alien.net, linux-scsi@...r.kernel.org
Subject: Re: [PATCH] usb-storage: Constify struct usb_device_id and
us_unusual_dev
On Sat, Aug 24, 2024 at 03:47:07PM +0200, 'Christophe JAILLET' via USB Mass Storage on Linux wrote:
> 'struct usb_device_id' and 'struct us_unusual_dev' are not modified in
> these drivers.
>
> Constifying these structures 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 us_unusual_dev).
>
> On a x86_64, with allmodconfig, as an example:
> Before:
> ======
> text data bss dec hex filename
> 25249 4261 896 30406 76c6 drivers/usb/storage/alauda.o
> 3969 672 360 5001 1389 drivers/usb/storage/cypress_atacb.o
>
> After:
> =====
> text data bss dec hex filename
> 25461 4041 896 30398 76be drivers/usb/storage/alauda.o
> 4225 400 360 4985 1379 drivers/usb/storage/cypress_atacb.o
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> Compile tested-only.
>
> I hope that a single patch for all drivers in drivers/usb/storage/ is fine.
> ---
> drivers/usb/storage/alauda.c | 4 ++--
> drivers/usb/storage/cypress_atacb.c | 4 ++--
> drivers/usb/storage/datafab.c | 4 ++--
> drivers/usb/storage/ene_ub6250.c | 4 ++--
> drivers/usb/storage/freecom.c | 4 ++--
> drivers/usb/storage/isd200.c | 4 ++--
> drivers/usb/storage/jumpshot.c | 4 ++--
> drivers/usb/storage/karma.c | 4 ++--
> drivers/usb/storage/onetouch.c | 4 ++--
> drivers/usb/storage/sddr09.c | 4 ++--
> drivers/usb/storage/sddr55.c | 4 ++--
> drivers/usb/storage/shuttle_usbat.c | 4 ++--
> drivers/usb/storage/uas.c | 2 +-
> 13 files changed, 25 insertions(+), 25 deletions(-)
Acked-by: Alan Stern <stern@...land.harvard.edu>
Powered by blists - more mailing lists