Files
linux/drivers
Anant Thazhemadam d71f3fb996 net: usb: rtl8150: set random MAC address when set_ethernet_addr() fails
commit f45a4248ea upstream.

When get_registers() fails in set_ethernet_addr(),the uninitialized
value of node_id gets copied over as the address.
So, check the return value of get_registers().

If get_registers() executed successfully (i.e., it returns
sizeof(node_id)), copy over the MAC address using ether_addr_copy()
(instead of using memcpy()).

Else, if get_registers() failed instead, a randomly generated MAC
address is set as the MAC address instead.

Reported-by: syzbot+abbc768b560c84d92fd3@syzkaller.appspotmail.com
Tested-by: syzbot+abbc768b560c84d92fd3@syzkaller.appspotmail.com
Acked-by: Petko Manolov <petkan@nucleusys.com>
Signed-off-by: Anant Thazhemadam <anant.thazhemadam@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-14 10:31:26 +02:00
..
2020-09-09 19:04:23 +02:00
2019-05-14 19:17:53 +02:00
2020-08-19 08:14:55 +02:00
2019-07-26 09:14:05 +02:00
2018-12-21 14:15:17 +01:00
2018-11-13 11:08:51 -08:00
2020-02-24 08:34:47 +01:00