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]
Message-ID: <Y3YdOQYQ5SjdeRpT@unreal>
Date:   Thu, 17 Nov 2022 13:38:33 +0200
From:   Leon Romanovsky <leon@...nel.org>
To:     Zhang Changzhong <zhangchangzhong@...wei.com>
Cc:     GR-Linux-NIC-Dev@...vell.com,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, Jeff Garzik <jeff@...zik.org>,
        Ron Mercer <ron.mercer@...gic.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] net/qla3xxx: fix potential memleak in ql3xxx_send()

On Thu, Nov 17, 2022 at 04:50:38PM +0800, Zhang Changzhong wrote:
> The ql3xxx_send() returns NETDEV_TX_OK without freeing skb in error
> handling case, add dev_kfree_skb_any() to fix it.

Can you please remind me why should it release?
There are no paths in ql3xxx_send() that release skb.

Thanks

> 
> Fixes: bd36b0ac5d06 ("qla3xxx: Add support for Qlogic 4032 chip.")
> Signed-off-by: Zhang Changzhong <zhangchangzhong@...wei.com>
> ---
>  drivers/net/ethernet/qlogic/qla3xxx.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c
> index 76072f8..0d57ffc 100644
> --- a/drivers/net/ethernet/qlogic/qla3xxx.c
> +++ b/drivers/net/ethernet/qlogic/qla3xxx.c
> @@ -2471,6 +2471,7 @@ static netdev_tx_t ql3xxx_send(struct sk_buff *skb,
>  					     skb_shinfo(skb)->nr_frags);
>  	if (tx_cb->seg_count == -1) {
>  		netdev_err(ndev, "%s: invalid segment count!\n", __func__);
> +		dev_kfree_skb_any(skb);
>  		return NETDEV_TX_OK;
>  	}
>  
> -- 
> 2.9.5
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ