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: <1f99c69d-42c2-4093-9c13-c0b137994e30@gmail.com>
Date: Wed, 16 Apr 2025 11:43:23 +0300
From: Tariq Toukan <ttoukan.linux@...il.com>
To: andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
 kuba@...nel.org, pabeni@...hat.com
Cc: netdev@...r.kernel.org, linux-rdma@...r.kernel.org,
 linux-kernel@...r.kernel.org, amirtz@...dia.com, ayal@...dia.com,
 Gal Pressman <gal@...dia.com>, Tariq Toukan <tariqt@...dia.com>,
 Leon Romanovsky <leon@...nel.org>, Saeed Mahameed <saeedm@...dia.com>,
 Henry Martin <bsdhenrymartin@...il.com>, Mark Bloch <mbloch@...dia.com>
Subject: Re: [PATCH v5 1/2] net/mlx5: Fix null-ptr-deref in
 mlx5_create_{inner_,}ttc_table()



On 15/04/2025 16:45, Mark Bloch wrote:
> 
> 
> On 15/04/2025 15:41, Henry Martin wrote:
>> Add NULL check for mlx5_get_flow_namespace() returns in
>> mlx5_create_inner_ttc_table() and mlx5_create_ttc_table() to prevent
>> NULL pointer dereference.
>>
>> Fixes: 137f3d50ad2a ("net/mlx5: Support matching on l4_type for ttc_table")
>> Signed-off-by: Henry Martin <bsdhenrymartin@...il.com>
>> ---
>>   drivers/net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c | 10 ++++++++++
>>   1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c
>> index eb3bd9c7f66e..e48afd620d7e 100644
>> --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c
>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c
>> @@ -655,6 +655,11 @@ struct mlx5_ttc_table *mlx5_create_inner_ttc_table(struct mlx5_core_dev *dev,
>>   	}
>>   
>>   	ns = mlx5_get_flow_namespace(dev, params->ns_type);
>> +	if (!ns) {
>> +		kvfree(ttc);
>> +		return ERR_PTR(-EOPNOTSUPP);
>> +	}
>> +
>>   	groups = use_l4_type ? &inner_ttc_groups[TTC_GROUPS_USE_L4_TYPE] :
>>   			       &inner_ttc_groups[TTC_GROUPS_DEFAULT];
>>   
>> @@ -728,6 +733,11 @@ struct mlx5_ttc_table *mlx5_create_ttc_table(struct mlx5_core_dev *dev,
>>   	}
>>   
>>   	ns = mlx5_get_flow_namespace(dev, params->ns_type);
>> +	if (!ns) {
>> +		kvfree(ttc);
>> +		return ERR_PTR(-EOPNOTSUPP);
>> +	}
>> +
>>   	groups = use_l4_type ? &ttc_groups[TTC_GROUPS_USE_L4_TYPE] :
>>   			       &ttc_groups[TTC_GROUPS_DEFAULT];
>>   
> 
> Reviewed-by: Mark Bloch <mbloch@...dia.com>
> 
> Mark
> 

netdev maintainers,

Note that Mark is covering me while I'm on vacation (for the coming ~10 
days). Please accordingly honor his submissions and replies for mlx5 
content.

In case this mail notification is not sufficient, please let us know 
what extra action is required.

Happy Holidays,
Tariq


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ