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:   Tue, 14 Mar 2023 12:26:49 +0100
From:   Piotr Raczynski <piotr.raczynski@...el.com>
To:     Serge Semin <Sergey.Semin@...kalelectronics.ru>
CC:     Giuseppe Cavallaro <peppe.cavallaro@...com>,
        Alexandre Torgue <alexandre.torgue@...s.st.com>,
        Jose Abreu <joabreu@...opsys.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        "Jakub Kicinski" <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Russell King <linux@...linux.org.uk>,
        "Andrew Lunn" <andrew@...n.ch>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Serge Semin <fancer.lancer@...il.com>,
        Alexey Malahov <Alexey.Malahov@...kalelectronics.ru>,
        Pavel Parkhomenko <Pavel.Parkhomenko@...kalelectronics.ru>,
        Christian Marangi <ansuelsmth@...il.com>,
        Biao Huang <biao.huang@...iatek.com>,
        Yang Yingliang <yangyingliang@...wei.com>,
        <netdev@...r.kernel.org>,
        <linux-stm32@...md-mailman.stormreply.com>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>,
        "Jose Abreu" <Jose.Abreu@...opsys.com>
Subject: Re: [PATCH net 06/13] net: stmmac: Free temporary Rx SKB on request

On Tue, Mar 14, 2023 at 01:42:30AM +0300, Serge Semin wrote:
> In case if an incoming frame couldn't be finished in one stmmac_rx()
> method call an SKB used to collect data so far will be saved in the
> corresponding Rx-queue state buffer. If the network device is closed
> before the frame is completed the preserved SKB will be utilized on the
> next network interface link uprising cycle right on the first frame
> reception, which will cause having a confused set of SKB data. Let's free
> the allocated Rx SKB then when all Rx-buffers are requested to be freed.
> 
> Fixes: ec222003bd94 ("net: stmmac: Prepare to add Split Header support")
> Signed-off-by: Serge Semin <Sergey.Semin@...kalelectronics.ru>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index ee4297a25521..4d643b1bbf65 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -1545,6 +1545,10 @@ static void dma_free_rx_skbufs(struct stmmac_priv *priv,
>  
>  	for (i = 0; i < dma_conf->dma_rx_size; i++)
>  		stmmac_free_rx_buffer(priv, rx_q, i);
> +
> +	if (rx_q->state_saved)
> +		dev_kfree_skb(rx_q->state.skb);
> +	rx_q->state_saved = false;
>  }
>  
>  static int stmmac_alloc_rx_buffers(struct stmmac_priv *priv,
> -- 
> 2.39.2
> 
> 
LGTM, thanks.
Reviewed-by: Piotr Raczynski <piotr.raczynski@...el.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ