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  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, 03 Dec 2019 11:57:41 -0800 (PST)
From:   David Miller <davem@...emloft.net>
To:     linyunsheng@...wei.com
Cc:     tanhuazhong@...wei.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, salil.mehta@...wei.com,
        yisen.zhuang@...wei.com, linuxarm@...wei.com,
        jakub.kicinski@...ronome.com
Subject: Re: [PATCH net 2/3] net: hns3: fix a use after free problem in
 hns3_nic_maybe_stop_tx()

From: Yunsheng Lin <linyunsheng@...wei.com>
Date: Tue, 3 Dec 2019 12:22:11 +0800

> 2. When skb_copy() returns success, the hns3_nic_maybe_stop_tx()
> returns -EBUSY when there are not no enough space in the ring to
> send the skb to hardware, and hns3_nic_net_xmit() will return
> NETDEV_TX_BUSY to the upper layer, the upper layer will resend the old
> skb later when driver wakes up the queue, but the old skb has been freed
> by the hns3_nic_maybe_stop_tx(). Because when using the skb_copy() to
> linearize a skb, it will return a new linearized skb, and the old skb is
> freed, the upper layer does not have a reference to the new skb and resend
> using the old skb, which casues a use after freed problem.
> 
> This patch is trying to fixes the case 2.
> 
> Maybe I should mention why hns3_nic_maybe_stop_tx() returns -EBUSY to
> better describe the problem?

I think it would help understand the code path you are fixing, yes.

Powered by blists - more mailing lists