summaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/ch9200.c
diff options
context:
space:
mode:
authorAnant Thazhemadam <anant.thazhemadam@gmail.com>2020-10-05 18:59:58 +0530
committerDavid S. Miller <davem@davemloft.net>2020-10-06 06:10:21 -0700
commitf45a4248ea4cc13ed50618ff066849f9587226b2 (patch)
tree9c719771c1b5a6968fb033aacae8303ab6950640 /drivers/net/usb/ch9200.c
parent017512a07e15b66472946cf5e6f4b4511e7cf898 (diff)
downloadlinux-f45a4248ea4cc13ed50618ff066849f9587226b2.tar.bz2
net: usb: rtl8150: set random MAC address when set_ethernet_addr() fails
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>
Diffstat (limited to 'drivers/net/usb/ch9200.c')
0 files changed, 0 insertions, 0 deletions