]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: stmmac: dwmac1000: fix out-of-bounds mac address reg setting
authorJisheng Zhang <Jisheng.Zhang@synaptics.com>
Fri, 3 Apr 2020 02:23:29 +0000 (10:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Apr 2020 11:16:30 +0000 (13:16 +0200)
commit12bec59386ce2385642795ebb1d5a5a9248f0d72
tree8578f6b2098c3a571916d801f1722eb8586f7a98
parent469f92c834de058de6b95d393130aacb0aa88043
net: stmmac: dwmac1000: fix out-of-bounds mac address reg setting

[ Upstream commit 3e1221acf6a8f8595b5ce354bab4327a69d54d18 ]

Commit 9463c4455900 ("net: stmmac: dwmac1000: Clear unused address
entries") cleared the unused mac address entries, but introduced an
out-of bounds mac address register programming bug -- After setting
the secondary unicast mac addresses, the "reg" value has reached
netdev_uc_count() + 1, thus we should only clear address entries
if (addr < perfect_addr_number)

Fixes: 9463c4455900 ("net: stmmac: dwmac1000: Clear unused address entries")
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c