Lv Yunlong 6d72e7c767 net:emac/emac-mac: Fix a use after free in emac_mac_tx_buf_send
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>
2021-04-26 13:07:30 -07:00
..
2021-02-02 14:26:02 +01:00
2021-01-31 08:05:46 -07:00
2021-04-18 09:36:56 +03:00
2021-04-02 16:13:13 -07:00
2021-03-22 09:20:06 -07:00
2021-04-15 10:48:51 -07:00
2021-02-22 10:05:12 -08:00
2021-02-22 14:27:07 -08:00
2021-04-06 22:32:33 +02:00
2021-02-22 09:52:55 -08:00
2021-02-28 15:48:25 -08:00
2021-03-30 13:34:42 -07:00
2021-04-13 14:50:57 -07:00
2021-03-30 00:46:49 +02:00
2021-01-28 01:31:42 +01:00
2021-02-25 12:23:49 -08:00
2021-01-21 14:06:00 -07:00
2021-03-26 15:14:56 -07:00
2021-04-07 09:26:50 -07:00
2021-04-03 10:00:53 -07:00
2021-03-18 11:20:35 -07:00
2021-04-03 10:42:20 -07:00
2021-03-18 11:20:35 -07:00
2021-02-09 12:15:07 +01:00
2021-04-09 09:58:42 -07:00