TencentOS-kernel/drivers/net
Lv Yunlong 003414af91 net:emac/emac-mac: Fix a use after free in emac_mac_tx_buf_send
[ Upstream commit 6d72e7c767acbbdd44ebc7d89c6690b405b32b57 ]

In emac_mac_tx_buf_send, it calls emac_tx_fill_tpd(..,skb,..).
If some error happens in emac_tx_fill_tpd(), the skb will be freed via
dev_kfree_skb(skb) in error branch of emac_tx_fill_tpd().
But the freed skb is still used via skb->len by netdev_sent_queue(,skb->len).

As i observed that emac_tx_fill_tpd() haven't modified the value of skb->len,
thus my patch assigns skb->len to 'len' before the possible free and
use 'len' instead of skb->len later.

Fixes: b9b17debc69d2 ("net: emac: emac gigabit ethernet controller driver")
Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-20 16:08:00 +08:00
..
appletalk Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
arcnet Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
bonding net: bonding proc file 2021-03-16 16:43:58 +08:00
caif Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
can drivers: net: fix memory leak in peak_usb_create_dev 2021-05-20 16:07:04 +08:00
dsa net: phy: marvell: fix detection of PHY on Topaz switches 2021-05-20 16:07:14 +08:00
ethernet net:emac/emac-mac: Fix a use after free in emac_mac_tx_buf_send 2021-05-20 16:08:00 +08:00
fddi FDDI: defxx: Bail out gracefully with unassigned PCI resource for CSR 2021-05-20 16:07:40 +08:00
fjes Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hamradio yam: fix possible memory leak in yam_init_driver 2021-03-16 16:30:06 +08:00
hippi hippi: Fix a size used in a 'pci_free_consistent()' in an error handling path 2021-03-16 16:32:23 +08:00
hyperv hv_netvsc: Remove "unlikely" from netvsc_select_queue 2021-03-16 16:36:11 +08:00
ieee802154 drivers: net: fix memory leak in atusb_probe 2021-05-20 16:07:03 +08:00
ipvlan ipvlan: fix device features 2021-03-16 16:34:45 +08:00
netdevsim netdevsim: init u64 stats for 32bit hardware 2021-04-12 12:52:59 +08:00
phy net: phy: intel-xway: enable integrated led functions 2021-05-20 16:08:00 +08:00
plip Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ppp pppoe: only process PADT targeted at local interfaces 2021-03-16 16:27:47 +08:00
slip Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
team team: protect features update by RCU to avoid deadlock 2021-04-12 12:51:48 +08:00
usb net: usb: ax88179_178a: initialize local variables before use 2021-05-20 16:07:17 +08:00
vmxnet3 vmxnet3: use correct tcp hdr length when packet is encapsulated 2021-03-16 16:33:49 +08:00
wan net: lapbether: Prevent racing when checking whether the netif is running 2021-05-20 16:07:55 +08:00
wimax staging: wimax/i2400m: fix byte-order issue 2021-05-20 16:07:23 +08:00
wireless ath10k: Fix ath10k_wmi_tlv_op_pull_peer_stats_info() unlock without lock 2021-05-20 16:08:00 +08:00
xen-netback xen-netback: Check for hotplug-status existence before watching 2021-05-20 16:07:15 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
LICENSE.SRC Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Space.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
dummy.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
eql.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
geneve.c net: geneve: modify IP header check in geneve6_xmit_skb and geneve_xmit_skb 2021-05-20 16:08:00 +08:00
gtp.c net: icmp: pass zeroed opts from icmp{,v6}_ndo_send before sending 2021-04-12 12:52:42 +08:00
ifb.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
loopback.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
macsec.c macsec: avoid use-after-free in macsec_handle_frame() 2021-03-16 16:37:58 +08:00
macvlan.c macvlan: validate setting of multiple remote source MAC addresses 2021-03-16 16:35:08 +08:00
macvtap.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mdio.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mii.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
net_failover.c net_failover: fixed rollback in net_failover_open() 2021-03-16 16:28:54 +08:00
netconsole.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nlmon.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ntb_netdev.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
rionet.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sb1000.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sungem_phy.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tap.c net: fix dev_ifsioc_locked() race condition 2021-04-12 12:52:45 +08:00
thunderbolt.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tun.c net: tun: set tun->dev->addr_len during TUNSETLINK processing 2021-05-20 16:07:03 +08:00
veth.c veth: Store queue_mapping independently of XDP prog presence 2021-04-12 12:53:26 +08:00
virtio_net.c virtio_net: Add XDP meta data support 2021-05-20 16:06:58 +08:00
vrf.c vrf: packets with lladdr src needs dst at input with orig_iif when needs strict 2021-03-16 16:42:16 +08:00
vsockmon.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
vxlan.c vxlan: move debug check after netdev unregister 2021-04-12 12:52:31 +08:00
xen-netfront.c xen-netfront: fix potential deadlock in xennet_remove() 2021-03-16 16:32:57 +08:00