title: net:emac/emac-mac: Fix a use after free in emac_mac_tx_buf_send
description: 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.
affected:
{
product: Linux
vendor: Linux
defaultStatus: unaffected
repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
versions:
version: b9b17debc69d, lessThan: c7f75d11fe72, status: affected, versionType: git
version: b9b17debc69d, lessThan: dc1b438a3577, status: affected, versionType: git
version: b9b17debc69d, lessThan: 16d8c44be52e, status: affected, versionType: git
version: b9b17debc69d, lessThan: 55fcdd1258fa, status: affected, versionType: git
version: b9b17debc69d, lessThan: 9dc373f74097, status: affected, versionType: git
version: b9b17debc69d, lessThan: 8c06f3478506, status: affected, versionType: git
version: b9b17debc69d, lessThan: e407495ba678, status: affected, versionType: git
version: b9b17debc69d, lessThan: 6d72e7c767ac, status: affected, versionType: git
}
{
product: Linux
vendor: Linux
defaultStatus: affected
repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
versions:
version: 4.9, status: affected
version: 0, lessThan: 4.9, status: unaffected, versionType: custom
version: 4.9.269, lessThanOrEqual: 4.9.*, status: unaffected, versionType: custom
version: 4.14.233, lessThanOrEqual: 4.14.*, status: unaffected, versionType: custom
version: 4.19.191, lessThanOrEqual: 4.19.*, status: unaffected, versionType: custom
version: 5.4.119, lessThanOrEqual: 5.4.*, status: unaffected, versionType: custom
version: 5.10.37, lessThanOrEqual: 5.10.*, status: unaffected, versionType: custom
version: 5.11.21, lessThanOrEqual: 5.11.*, status: unaffected, versionType: custom
version: 5.12.4, lessThanOrEqual: 5.12.*, status: unaffected, versionType: custom
version: 5.13, lessThanOrEqual: *, status: unaffected, versionType: original_commit_for_fix
}
