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: <20211202114141.35e40115@hermes.local>
Date:   Thu, 2 Dec 2021 11:41:41 -0800
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     Arijit De <arijitde@...vell.com>
Cc:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: How to avoid getting ndo_open() immediately after probe

On Thu, 2 Dec 2021 18:11:30 +0000
Arijit De <arijitde@...vell.com> wrote:

> Hi,
> 
> I have handled the probe() and registered the netdev structure using register_netdev().
> I have observed in other opensource driver(i.e. Intel e1000e driver) that ndo_open() gets called only when we try to bring up the interface (i.e. ifconfig <ip> ifconfig eth0 <ip-addr> netmask <net-mask> up).
> But in my network driver I am getting ndo_open() call immediately after I handle the probe(). It's a wrong behavior, also my network interface is getting to UP/RUNNING state(as shown below) even without any valid ip address.
> 
> enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
>         ether 00:22:55:33:22:28  txqueuelen 1000  (Ethernet)
>         RX packets 0  bytes 0 (0.0 B)
>         RX errors 0  dropped 0  overruns 0  frame 0
>         TX packets 252  bytes 43066 (43.0 KB)
>         TX errors 0  dropped 0 overruns 0  carrier 0  collisions
> 
> What is the change required in the driver such that my network interface(enp1s0) should be in down state(BROADCAST & MULTICAST only) after probe()
> and ndo_open() call should happen only when device gets configured?
> 
> Thanks
> Arijit

ndo_open gets called when userspace brings the device up.
Based on the device name, you are running on a distribution which renames
devices; probably systemd/networkd and it is starting the device.

You need to change userspace configuration 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ