alistair23-linux/drivers/net/usb
Anant Thazhemadam 60f1626f0f net: usb: rtl8150: don't incorrectly assign random MAC addresses
In set_ethernet_addr(), if get_registers() succeeds, the ethernet address
that was read must be copied over. Otherwise, a random ethernet address
must be assigned.

get_registers() returns 0 if successful, and negative error number
otherwise. However, in set_ethernet_addr(), this return value is
incorrectly checked.

Since this return value will never be equal to sizeof(node_id), a
random MAC address will always be generated and assigned to the
device; even in cases when get_registers() is successful.

Correctly modifying the condition that checks if get_registers() was
successful or not fixes this problem, and copies the ethernet address
appropriately.

Fixes: b2a0f274e3 ("net: rtl8150: Use the new usb control message API.")
Signed-off-by: Anant Thazhemadam <anant.thazhemadam@gmail.com>
Link: https://lore.kernel.org/r/20201011173030.141582-1-anant.thazhemadam@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2020-10-18 12:57:30 -07:00
..
aqc111.c
aqc111.h
asix.h
asix_common.c
asix_devices.c
ax88172a.c
ax88179_178a.c net: usb: ax88179_178a: add MCT usb 3.0 adapter 2020-09-28 18:39:05 -07:00
catc.c
cdc-phonet.c
cdc_eem.c
cdc_ether.c
cdc_mbim.c
cdc_ncm.c
cdc_subset.c
ch9200.c
cx82310_eth.c cx82310_eth: use netdev_err instead of dev_err 2020-10-12 09:46:40 -07:00
dm9601.c net: usb: dm9601: Add USB ID of Keenetic Plus DSL 2020-09-01 15:35:23 -07:00
gl620a.c
hso.c
huawei_cdc_ncm.c
int51x1.c
ipheth.c
kalmia.c
kaweth.c net: usb: kaweth: Remove last user of kaweth_control() 2020-09-29 14:02:54 -07:00
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-09-04 21:28:59 -07:00
lan78xx.c
lan78xx.h
lg-vl600.c
Makefile
mcs7830.c
net1080.c net: usb: net1080: Remove in_interrupt() comment 2020-09-29 14:02:54 -07:00
pegasus.c USB/PHY/Thunderbolt driver patches for 5.10-rc1 2020-10-15 09:51:18 -07:00
pegasus.h
plusb.c
qmi_wwan.c net: usb: qmi_wwan: use new function dev_fetch_sw_netstats 2020-10-13 17:33:48 -07:00
r8152.c
rndis_host.c rndis_host: increase sleep time in the query-response loop 2020-09-14 14:39:59 -07:00
rtl8150.c net: usb: rtl8150: don't incorrectly assign random MAC addresses 2020-10-18 12:57:30 -07:00
sierra_net.c
smsc75xx.c net/smscx5xx: change to of_get_mac_address() eth_platform_get_mac_address() 2020-10-02 15:21:17 -07:00
smsc75xx.h
smsc95xx.c net/smscx5xx: change to of_get_mac_address() eth_platform_get_mac_address() 2020-10-02 15:21:17 -07:00
smsc95xx.h
sr9700.c
sr9700.h
sr9800.c
sr9800.h
usbnet.c net: usbnet: use new function dev_fetch_sw_netstats 2020-10-13 17:33:49 -07:00
zaurus.c