net:emac/emac-mac: Fix a use after free in emac_mac_tx_buf_send
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ b9b17debc69d27cd55e21ee51a5ba7fc50a426cf · < 8c06f34785068b87e2b560534c77c163d6c6dca7| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
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.
From the CVE record · Linux
The Linux kernel’s emac-mac transmit path can use a network buffer after freeing it if emac_tx_fill_tpd() encounters an error. The input does not specify how an attacker could trigger the error or whether network access, authentication, or user interaction is required.
Engineers running the Linux kernel should check whether their kernel includes the affected emac-mac code; affected versions are not specified.