]> git.baikalelectronics.ru Git - kernel.git/commit
e100: Fix possible use after free in e100_xmit_prepare
authorWang Hai <wanghai38@huawei.com>
Tue, 15 Nov 2022 17:24:07 +0000 (01:24 +0800)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Wed, 23 Nov 2022 16:38:22 +0000 (08:38 -0800)
commit8f02e84b4f4c8bce40addba9893590d3d43040b0
treeed0db8f957502ac4256ffd5b119d5788c79f4d90
parent51ab5649419ba5d4a4c541b8ec14a564ce09288a
e100: Fix possible use after free in e100_xmit_prepare

In e100_xmit_prepare(), if we can't map the skb, then return -ENOMEM, so
e100_xmit_frame() will return NETDEV_TX_BUSY and the upper layer will
resend the skb. But the skb is already freed, which will cause UAF bug
when the upper layer resends the skb.

Remove the harmful free.

Fixes: 38d596085138 ("e100: Release skb when DMA mapping is failed in e100_xmit_prepare")
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/e100.c