]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: bmac: Fix read of MAC address from ROM
authorJeremy Kerr <jk@ozlabs.org>
Tue, 19 May 2020 01:05:58 +0000 (09:05 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Jun 2020 11:16:46 +0000 (13:16 +0200)
commit68a61d5acc8ba9caa632f31cf1cc1879e948671a
treeade636a6ea627fd59e2b96fedc66902d62ae02d4
parent86941e3bef305ed0631c8320aa114d120c440261
net: bmac: Fix read of MAC address from ROM

[ Upstream commit ef01cee2ee1b369c57a936166483d40942bcc3e3 ]

In bmac_get_station_address, We're reading two bytes at a time from ROM,
but we do that six times, resulting in 12 bytes of read & writes. This
means we will write off the end of the six-byte destination buffer.

This change fixes the for-loop to only read/write six bytes.

Based on a proposed fix from Finn Thain <fthain@telegraphics.com.au>.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Reported-by: Stan Johnson <userm57@yahoo.com>
Tested-by: Stan Johnson <userm57@yahoo.com>
Reported-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/apple/bmac.c