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:   Thu, 26 Jan 2023 10:53:00 +0000
From:   Vadim Fedorenko <vadfed@...a.com>
To:     Rahul Rameshbabu <rrameshbabu@...dia.com>
CC:     Vadim Fedorenko <vadfed@...a.com>, Aya Levin <ayal@...dia.com>,
        Saeed Mahameed <saeedm@...dia.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Gal Pressman <gal@...dia.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net v3 2/2] mlx5: fix possible ptp queue fifo
 use-after-free

On 26/01/2023 01:09, Rahul Rameshbabu wrote:
> On Thu, 26 Jan, 2023 04:02:06 +0300 Vadim Fedorenko <vfedorenko@...ek.ru> wrote:
>> From: Vadim Fedorenko <vadfed@...a.com>
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
>> index 15a5a57b47b8..6e559b856afb 100644
>> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
>> @@ -289,14 +289,19 @@ struct sk_buff **mlx5e_skb_fifo_get(struct mlx5e_skb_fifo *fifo, u16 i)
>>   static inline
>>   void mlx5e_skb_fifo_push(struct mlx5e_skb_fifo *fifo, struct sk_buff *skb)
>>   {
>> -	struct sk_buff **skb_item = mlx5e_skb_fifo_get(fifo, (*fifo->pc)++);
>> +	struct sk_buff **skb_item;
>>   
>> +	WARN_ONCE(mlx5e_skb_fifo_has_room(fifo), "ptp fifo overflow");
> 
> I think you meant 'WARN_ONCE(!mlx5e_skb_fifo_has_room(fifo), "ptp fifo overflow");'?
> 
Yes, you are absolutely right, mistyping during re-arrange.
Will improve in the next spin.

> It is only safe to push in the fifo when the fifo has room. Therefore,
> we should warn when a push is attempted with no more room in the fifo.
> Does this warning, as is, not trigger for you during testing in normal
> conditions?
> 
>> +	skb_item = mlx5e_skb_fifo_get(fifo, (*fifo->pc)++);
>>   	*skb_item = skb;
>>   }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ