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] [thread-next>] [day] [month] [year] [list]
Date: Mon, 3 Jun 2024 10:46:15 +0200
From: Wojciech Drewek <wojciech.drewek@...el.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>, <idosch@...dia.com>,
	<petrm@...dia.com>, <davem@...emloft.net>, <edumazet@...gle.com>,
	<kuba@...nel.org>, <pabeni@...hat.com>, <jiri@...nulli.us>
CC: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH 2/2 net-next] mlxsw: spectrum_router: Constify struct
 devlink_dpipe_table_ops



On 02.06.2024 16:18, Christophe JAILLET wrote:
> 'struct devlink_dpipe_table_ops' are not modified in this driver.
> 
> Constifying these structures moves some data to a read-only section, so
> increase overall security.
> 
> On a x86_64, with allmodconfig:
> Before:
> ======
>    text	   data	    bss	    dec	    hex	filename
>   15557	    712	      0	  16269	   3f8d	drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.o
> 
> After:
> =====
>    text	   data	    bss	    dec	    hex	filename
>   15789	    488	      0	  16277	   3f95	drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.o
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---

Reviewed-by: Wojciech Drewek <wojciech.drewek@...el.com>

>  drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
> index ca80af06465f..fa6eddd27ecf 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
> @@ -283,7 +283,7 @@ static u64 mlxsw_sp_dpipe_table_erif_size_get(void *priv)
>  	return MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS);
>  }
>  
> -static struct devlink_dpipe_table_ops mlxsw_sp_erif_ops = {
> +static const struct devlink_dpipe_table_ops mlxsw_sp_erif_ops = {
>  	.matches_dump = mlxsw_sp_dpipe_table_erif_matches_dump,
>  	.actions_dump = mlxsw_sp_dpipe_table_erif_actions_dump,
>  	.entries_dump = mlxsw_sp_dpipe_table_erif_entries_dump,
> @@ -734,7 +734,7 @@ static u64 mlxsw_sp_dpipe_table_host4_size_get(void *priv)
>  	return mlxsw_sp_dpipe_table_host_size_get(mlxsw_sp, AF_INET);
>  }
>  
> -static struct devlink_dpipe_table_ops mlxsw_sp_host4_ops = {
> +static const struct devlink_dpipe_table_ops mlxsw_sp_host4_ops = {
>  	.matches_dump = mlxsw_sp_dpipe_table_host4_matches_dump,
>  	.actions_dump = mlxsw_sp_dpipe_table_host_actions_dump,
>  	.entries_dump = mlxsw_sp_dpipe_table_host4_entries_dump,
> @@ -811,7 +811,7 @@ static u64 mlxsw_sp_dpipe_table_host6_size_get(void *priv)
>  	return mlxsw_sp_dpipe_table_host_size_get(mlxsw_sp, AF_INET6);
>  }
>  
> -static struct devlink_dpipe_table_ops mlxsw_sp_host6_ops = {
> +static const struct devlink_dpipe_table_ops mlxsw_sp_host6_ops = {
>  	.matches_dump = mlxsw_sp_dpipe_table_host6_matches_dump,
>  	.actions_dump = mlxsw_sp_dpipe_table_host_actions_dump,
>  	.entries_dump = mlxsw_sp_dpipe_table_host6_entries_dump,
> @@ -1230,7 +1230,7 @@ mlxsw_sp_dpipe_table_adj_size_get(void *priv)
>  	return size;
>  }
>  
> -static struct devlink_dpipe_table_ops mlxsw_sp_dpipe_table_adj_ops = {
> +static const struct devlink_dpipe_table_ops mlxsw_sp_dpipe_table_adj_ops = {
>  	.matches_dump = mlxsw_sp_dpipe_table_adj_matches_dump,
>  	.actions_dump = mlxsw_sp_dpipe_table_adj_actions_dump,
>  	.entries_dump = mlxsw_sp_dpipe_table_adj_entries_dump,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ