lists.openwall.net   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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YMOaZB6xf2xOpC0S@lunn.ch>
Date:   Fri, 11 Jun 2021 19:16:20 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Jonathan Davies <jonathan.davies@...anix.com>
Cc:     Oliver Neukum <oneukum@...e.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: usbnet: allow overriding of default USB interface
 naming

On Fri, Jun 11, 2021 at 03:23:39PM +0000, Jonathan Davies wrote:
> When the predictable device naming scheme for NICs is not in use, it is
> common for there to be udev rules to rename interfaces to names with
> prefix "eth".
> 
> Since the timing at which USB NICs are discovered is unpredictable, it
> can be interfere with udev's attempt to rename another interface to
> "eth0" if a freshly discovered USB interface is initially given the name
> "eth0".
> 
> Hence it is useful to be able to override the default name. A new usbnet
> module parameter allows this to be configured.
> 
> Signed-off-by: Jonathan Davies <jonathan.davies@...anix.com>
> Suggested-by: Prashanth Sreenivasa <prashanth.sreenivasa@...anix.com>
> ---
>  drivers/net/usb/usbnet.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index ecf6284..55f6230 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -72,6 +72,13 @@ static int msg_level = -1;
>  module_param (msg_level, int, 0);
>  MODULE_PARM_DESC (msg_level, "Override default message level");
>  
> +#define DEFAULT_ETH_DEV_NAME "eth%d"
> +
> +static char *eth_device_name = DEFAULT_ETH_DEV_NAME;
> +module_param(eth_device_name, charp, 0644);
> +MODULE_PARM_DESC(eth_device_name, "Device name pattern for Ethernet devices"
> +				  " (default: \"" DEFAULT_ETH_DEV_NAME "\")");

Module parameter are not liked in the network stack.

It actually seems like a udev problem, and you need to solve it
there. It is also not specific to USB. Any sort of interface can pop
up at an time, especially with parallel probing of busses. So you need
udev to detect there has been a race condition and try again with the
rename.

     Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ