From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8843B15B10D; Mon, 28 Oct 2024 06:36:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730097371; cv=none; b=tcYbKWTIGxWXJPH3vBmvPcFfjIaIvlzt+88cJ/BoSL6zier5h2sLu7vmYp4GMkWiTTGQPx+p4jj83fo2AN+VZmocc7QK/i/SU38p24kdboBz4s9QzRNQ2PVfZul7ycPZmHLP2HK0ld4yS5n7lDVS7FhnoHJhO6UKsM1nnYr89Fo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730097371; c=relaxed/simple; bh=VnsEQ4BzYiQjEYWVzHKODLNmV+ljI4Rbxdhj00iefpU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d5C1DvGitKYJcbiD7I/MOBrW1OgSJ7fhvg+5KIcY8wntBC0+c1OBOVC0/eW3V+XavgFNovuDpDre89Uk56fjty51k/0pga4gDyiJkSrnDaZTs4ShzfqTyWaCnivnt2KgHLd9ablUj44xtLawvLgU7LO92UOov9YqT2VLvXN0RxQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YZW0eK5A; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="YZW0eK5A" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2662DC4CEC3; Mon, 28 Oct 2024 06:36:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1730097371; bh=VnsEQ4BzYiQjEYWVzHKODLNmV+ljI4Rbxdhj00iefpU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YZW0eK5AePL/fFJZrCy7M7xHJdiQWYDMx1yDRDH+5ZEmxqrNH+cTTAK5wFfdKSJ0R bC/r9OXYyOjBYoUa/rKQShVx+FvxTb40b1iZbUAPMM1nIQoQo/g7fgcdzi39K47vHd w8jDoh3q/nmj+L0l2KOFNatFuAcwa8nEyU0re44c= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Oliver Neukum , Greg Thelen , Paolo Abeni , Sasha Levin , John Sperbeck Subject: [PATCH 6.1 100/137] net: usb: usbnet: fix name regression Date: Mon, 28 Oct 2024 07:25:37 +0100 Message-ID: <20241028062301.519637317@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241028062258.708872330@linuxfoundation.org> References: <20241028062258.708872330@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Oliver Neukum [ Upstream commit 8a7d12d674ac6f2147c18f36d1e15f1a48060edf ] The fix for MAC addresses broke detection of the naming convention because it gave network devices no random MAC before bind() was called. This means that the check for the local assignment bit was always negative as the address was zeroed from allocation, instead of from overwriting the MAC with a unique hardware address. The correct check for whether bind() has altered the MAC is done with is_zero_ether_addr Signed-off-by: Oliver Neukum Reported-by: Greg Thelen Diagnosed-by: John Sperbeck Fixes: bab8eb0dd4cb9 ("usbnet: modern method to get random MAC") Link: https://patch.msgid.link/20241017071849.389636-1-oneukum@suse.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/usb/usbnet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index ce587a12b894c..ae1282487b02a 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -1766,7 +1766,8 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) // can rename the link if it knows better. if ((dev->driver_info->flags & FLAG_ETHER) != 0 && ((dev->driver_info->flags & FLAG_POINTTOPOINT) == 0 || - (net->dev_addr [0] & 0x02) == 0)) + /* somebody touched it*/ + !is_zero_ether_addr(net->dev_addr))) strscpy(net->name, "eth%d", sizeof(net->name)); /* WLAN devices should always be named "wlan%d" */ if ((dev->driver_info->flags & FLAG_WLAN) != 0) -- 2.43.0