Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit d71f3fb9 authored by Anant Thazhemadam's avatar Anant Thazhemadam Committed by Greg Kroah-Hartman
Browse files

net: usb: rtl8150: set random MAC address when set_ethernet_addr() fails



commit f45a4248ea4cc13ed50618ff066849f9587226b2 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: default avatar <syzbot+abbc768b560c84d92fd3@syzkaller.appspotmail.com>
Tested-by: default avatar <syzbot+abbc768b560c84d92fd3@syzkaller.appspotmail.com>
Acked-by: default avatarPetko Manolov <petkan@nucleusys.com>
Signed-off-by: default avatarAnant Thazhemadam <anant.thazhemadam@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 94c51675
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment