Subject: Re: [PATCH] net: atlantic: fixed double free when constrained memory conditions

From: Jakub Kicinski <[email-masked]>
Date: Tue, 5 Dec 2023 19:33:26 -0800

On Mon, 4 Dec 2023 17:20:40 +0100 Igor Russkikh wrote:
> Driver has a logic leak in ring data allocation/free,
> where double free may happen in aq_ring_free if system is under
> stress and driver init/deinit is happening.
> 
> The probability is higher to get this during suspend/resume cycle.
> 
> Verification was done simulating same conditions with
> 
>     stress -m 2000 --vm-bytes 20M --vm-hang 10 --backoff 1000
>     while true; do sudo ifconfig enp1s0 down; sudo ifconfig enp1s0 up; done
> 
> Fixed by explicitly clearing pointers to NULL, also eliminate two
> levels of aq_ring_free invocation.

The change of the return type plays no functional role in the fix,
right?

I think it'd make the change far more readable if that was a separate
patch. And if it's a separate, non-functional patch, it should go
to net-next, rather than with the fix to net.