TencentOS-kernel/drivers/net/ethernet
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
..
3com Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
8390 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
adaptec Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
aeroflex Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
agere Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
alacritech Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
allwinner net: allwinner: Fix some resources leak in the error handling path of the probe and in the remove function 2021-03-16 16:43:16 +08:00
alteon Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
altera Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
amazon net: ena: set initial DMA width to avoid intel iommu issue 2021-03-16 16:41:45 +08:00
amd pcnet32: Use pci_resource_len to validate PCI resource 2021-05-20 16:07:10 +08:00
apm Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
apple net: bmac: Fix read of MAC address from ROM 2021-03-16 16:28:47 +08:00
aquantia net: ethernet: aquantia: Handle error cleanup of start on open 2021-05-20 16:06:48 +08:00
arc net: arc_emac: Fix memleak in arc_mdio_probe 2021-03-16 16:35:30 +08:00
atheros ethernet: alx: fix order of calls on resume 2021-04-12 12:52:55 +08:00
aurora Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
broadcom bnxt_en: Improve stats context resource accounting with RDMA driver loaded. 2021-04-12 12:51:27 +08:00
brocade Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cadence net: macb: fix the restore of cmp registers 2021-05-20 16:07:12 +08:00
calxeda Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cavium net: thunderx: Fix unintentional sign extension issue 2021-05-20 16:07:57 +08:00
chelsio cxgb4: Fix unintentional sign extension issues 2021-05-20 16:07:57 +08:00
cirrus Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cisco net: enic: Cure the enic api locking trainwreck 2021-03-16 16:38:44 +08:00
cortina net: gemini: Fix another missing clk_disable_unprepare() in probe 2021-03-16 16:35:34 +08:00
davicom net: davicom: Fix regulator not turned off on failed probe 2021-05-20 16:07:12 +08:00
dec net: dec: de2104x: Increase receive ring size for Tulip 2021-03-16 16:37:45 +08:00
dlink Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
emulex Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ezchip Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
faraday ftgmac100: Restart MAC HW once 2021-04-12 12:53:28 +08:00
freescale gianfar: Handle error code at MAC address change 2021-05-20 16:07:00 +08:00
fujitsu Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
google Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hisilicon net: hns3: Limiting the scope of vector_ring_chain variable 2021-05-20 16:07:56 +08:00
hp Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
huawei Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
i825xx Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ibm ibmvnic: remove duplicate napi_schedule call in open function 2021-05-20 16:07:12 +08:00
intel igb: Enable RSS for Intel I211 Ethernet Controller 2021-05-20 16:07:17 +08:00
marvell net: pxa168_eth: Fix a potential data race in pxa168_eth_remove 2021-05-20 16:06:52 +08:00
mediatek net: ethernet: mtk_eth_soc: fix MTU warnings 2021-03-16 16:33:09 +08:00
mellanox mlxsw: spectrum_mr: Update egress RIF list before route's action 2021-05-20 16:07:33 +08:00
micrel Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
microchip lan743x: fix rx_napi_poll/interrupt ping-pong 2021-03-16 16:43:16 +08:00
moxa net: moxa: Fix a potential double 'free_irq()' 2021-03-16 16:27:45 +08:00
mscc net: mscc: ocelot: allow offloading of bridge on top of LAG 2021-04-12 12:51:40 +08:00
myricom Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
natsemi net/sonic: Fix some resource leaks in error handling paths 2021-04-12 12:51:15 +08:00
neterion net: vxge: fix wrong __VA_ARGS__ usage 2021-03-16 16:25:53 +08:00
netronome nfp: flower: ignore duplicate merge hints from FW 2021-05-20 16:07:00 +08:00
ni net: nixge: fix potential memory leak in nixge_probe() 2021-03-16 16:32:54 +08:00
nvidia Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nxp net: lpc-enet: fix error return code in lpc_mii_init() 2021-03-16 16:29:27 +08:00
oki-semi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
packetengines Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pasemi net: pasemi: fix error return code in pasemi_mac_open() 2021-03-16 16:41:56 +08:00
pensando ionic: account for vlan tag len in rx buffer len 2021-04-12 12:51:10 +08:00
qlogic net/qlcnic: Fix a use after free in qlcnic_83xx_get_minidump_template 2021-04-12 12:53:28 +08:00
qualcomm net:emac/emac-mac: Fix a use after free in emac_mac_tx_buf_send 2021-05-20 16:08:00 +08:00
rdc Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
realtek r8169: don't advertise pause in jumbo mode 2021-05-20 16:07:13 +08:00
renesas net: renesas: ravb: Fix a stuck issue when a lot of frames are received 2021-05-20 16:08:00 +08:00
rocker rocker: fix incorrect error handling in dma_rings_init 2021-03-16 16:30:47 +08:00
samsung Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
seeq Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sfc Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sgi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
silan Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sis Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
smsc net: smc91x: Fix possible memory leak in smc_drv_probe() 2021-03-16 16:32:25 +08:00
socionext netsec: restore phy power state after controller reset 2021-04-12 12:53:25 +08:00
stmicro net: stmmac: dwmac-sun8i: Provide TX and RX fifo sizes 2021-04-12 12:53:30 +08:00
sun sun/niu: fix wrong RXMAC_BC_FRM_CNT_COUNT count 2021-04-12 12:53:22 +08:00
synopsys Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tehuti net: tehuti: fix error return code in bdx_probe() 2021-04-12 12:53:22 +08:00
ti net: davinci_emac: Fix incorrect masking of tx and rx error channel 2021-05-20 16:07:59 +08:00
toshiba net: spider_net: Fix the size used in a 'dma_free_coherent()' call 2021-03-16 16:33:45 +08:00
tundra Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
via Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
wiznet Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
xilinx net: axienet: Handle deferred probe on clock properly 2021-04-12 12:52:15 +08:00
xircom Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
xscale Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +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
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
dnet.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
dnet.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ec_bhf.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
ethoc.c net: ethernet: Fix memleak in ethoc_probe 2021-04-12 12:51:08 +08:00
fealnx.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
jme.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
jme.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
korina.c net: korina: fix return value 2021-03-16 16:43:16 +08:00
lantiq_etop.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
lantiq_xrx200.c net: lantiq: Add locking for TX DMA channel 2021-03-16 16:41:02 +08:00