lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
 <DB9PR04MB8429BB610945B0CEC89CA7199244A@DB9PR04MB8429.eurprd04.prod.outlook.com>
Date: Sat, 28 Jun 2025 08:03:53 +0000
From: Sherry Sun <sherry.sun@....com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>, Greg Kroah-Hartman
	<gregkh@...uxfoundation.org>, Jiri Slaby <jirislaby@...nel.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
	"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>
Subject: RE: [PATCH] tty: serial: fsl_lpuart: Constify struct lpuart_soc_data



> -----Original Message-----
> From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> Sent: Saturday, June 28, 2025 2:35 PM
> To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>; Jiri Slaby
> <jirislaby@...nel.org>
> Cc: linux-kernel@...r.kernel.org; kernel-janitors@...r.kernel.org; Christophe
> JAILLET <christophe.jaillet@...adoo.fr>; linux-serial@...r.kernel.org
> Subject: [PATCH] tty: serial: fsl_lpuart: Constify struct lpuart_soc_data
> 
> 'struct lpuart_soc_data' are not modified in this driver.
> 
> Constifying these structures moves some data to a read-only section, so
> increases overall security.
> 
> This also makes the code more consistent.
> 
> On a x86_64, with allmodconfig, as an example:
> Before:
> ======
>    text	   data	    bss	    dec	    hex	filename
>  172668	  23470	    128	 196266	  2feaa
> 	drivers/tty/serial/fsl_lpuart.o
> 
> After:
> =====
>    text	   data	    bss	    dec	    hex	filename
>  172924	  23214	    128	 196266	  2feaa
> 	drivers/tty/serial/fsl_lpuart.o
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>

Reviewed-by: Sherry Sun <sherry.sun@....com>

Best Regards
Sherry


> ---
> Compile tested only
> ---
>  drivers/tty/serial/fsl_lpuart.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index
> 2790b4078e7e..c9519e649e82 100644
> --- a/drivers/tty/serial/fsl_lpuart.c
> +++ b/drivers/tty/serial/fsl_lpuart.c
> @@ -318,27 +318,27 @@ static const struct lpuart_soc_data ls1028a_data = {
>  	.rx_watermark = 0,
>  };
> 
> -static struct lpuart_soc_data imx7ulp_data = {
> +static const struct lpuart_soc_data imx7ulp_data = {
>  	.devtype = IMX7ULP_LPUART,
>  	.iotype = UPIO_MEM32,
>  	.reg_off = IMX_REG_OFF,
>  	.rx_watermark = 1,
>  };
> 
> -static struct lpuart_soc_data imx8ulp_data = {
> +static const struct lpuart_soc_data imx8ulp_data = {
>  	.devtype = IMX8ULP_LPUART,
>  	.iotype = UPIO_MEM32,
>  	.reg_off = IMX_REG_OFF,
>  	.rx_watermark = 3,
>  };
> 
> -static struct lpuart_soc_data imx8qxp_data = {
> +static const struct lpuart_soc_data imx8qxp_data = {
>  	.devtype = IMX8QXP_LPUART,
>  	.iotype = UPIO_MEM32,
>  	.reg_off = IMX_REG_OFF,
>  	.rx_watermark = 7, /* A lower watermark is ideal for low baud rates.
> */  }; -static struct lpuart_soc_data imxrt1050_data = {
> +static const struct lpuart_soc_data imxrt1050_data = {
>  	.devtype = IMXRT1050_LPUART,
>  	.iotype = UPIO_MEM32,
>  	.reg_off = IMX_REG_OFF,
> --
> 2.50.0
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ