From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752274AbcGORmq (ORCPT ); Fri, 15 Jul 2016 13:42:46 -0400 Received: from canardo.mork.no ([148.122.252.1]:38288 "EHLO canardo.mork.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751292AbcGORmk convert rfc822-to-8bit (ORCPT ); Fri, 15 Jul 2016 13:42:40 -0400 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: David Laight Cc: Kristian Evensen , "linux-usb\@vger.kernel.org" , "netdev\@vger.kernel.org" , "linux-kernel\@vger.kernel.org" Subject: Re: [PATCH] rndis_host: Set random MAC for ZTE MF910 Organization: m References: <1468427945-11600-1-git-send-email-kristian.evensen@gmail.com> <87k2gpnpo5.fsf@miraculix.mork.no> <063D6719AE5E284EB5DD2968C1650D6D5F4F921C@AcuExch.aculab.com> Date: Fri, 15 Jul 2016 19:42:28 +0200 In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D5F4F921C@AcuExch.aculab.com> (David Laight's message of "Fri, 15 Jul 2016 16:42:02 +0000") Message-ID: <877fcmlrwb.fsf@miraculix.mork.no> User-Agent: Gnus/5.130015 (Ma Gnus v0.15) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org David Laight writes: > From: Bjørn Mork >> Sent: 13 July 2016 23:23 > ... >> Or how about the more generic?: >> >> if (bp[0] & 0x02) >> eth_hw_addr_random(net); >> else >> ether_addr_copy(net->dev_addr, bp); >> >> That would catch similar screwups from other vendors too. > > Not really, that disables 'locally administered' addresses. ... when the 'locally administered' addresses comes from firmeare, yes. That was the idea. We are better off using our own random locally administered address if some vendor has been cheap/stupid enough to program that into firmware. The aminstrator is of course still free to set any address, 'locally administered' or whatever. This is not the question here. > If a vendor has used the same address on lots of cards it could easily > be a 'real' address. Sure. We cannot easily detect that. The only way is to keep a blacklist of such 'real' addresses, the way Kristian initially proposed. But I thought that we could simplify this particular screwup since the address in question had the local bit set, and catch every other similar abuse at the same time. If you get the local bit from formware, then you know for sure that there is something wrong. > Not only that, there certainly used to be manufacturers that used 'locally > administered' addresses on all their cards (as well as those that used unallocated > address blocks). Sure. But is there any reason to care about those addresses? > Not to mention the bit-revered addresses.... Listing all the ways vendors have screwed is going to be a long and rather boring thread ;) Bjørn