lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 10 Oct 2020 12:14:59 +0530
From:   Anant Thazhemadam <>
To:     unlisted-recipients:; (no To-header on input)
        Anant Thazhemadam <>,
        Petko Manolov <>,
        "David S. Miller" <>,
        Jakub Kicinski <>,,,
Subject: [PATCH] net: usb: rtl8150: don't incorrectly assign random MAC addresses

get_registers() directly returns the return value of
usb_control_msg_recv() - 0 if successful, and negative error number 
However, in set_ethernet_addr(), this return value is incorrectly 

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

Fixes: f45a4248ea4c ("set random MAC address when set_ethernet_addr() fails")
Signed-off-by: Anant Thazhemadam <>
 drivers/net/usb/rtl8150.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
index f020401adf04..bf8a60533f3e 100644
--- a/drivers/net/usb/rtl8150.c
+++ b/drivers/net/usb/rtl8150.c
@@ -261,7 +261,7 @@ static void set_ethernet_addr(rtl8150_t *dev)
 	ret = get_registers(dev, IDR, sizeof(node_id), node_id);
-	if (ret == sizeof(node_id)) {
+	if (!ret) {
 		ether_addr_copy(dev->netdev->dev_addr, node_id);
 	} else {

Powered by blists - more mailing lists