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: <20220602194622.0c54a256@kernel.org>
Date:   Thu, 2 Jun 2022 19:46:22 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Kaarel Pärtel <kaarelp2rtel@...il.com>
Cc:     Wolfgang Grandegger <wg@...ndegger.com>,
        Marc Kleine-Budde <mkl@...gutronix.de>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Paolo Abeni <pabeni@...hat.com>, linux-can@...r.kernel.org,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: add operstate for vcan and dummy

On Thu,  2 Jun 2022 11:19:29 +0300 Kaarel Pärtel wrote:
> The idea here is simple. The vcan and the dummy network devices
> currently do not set the operational state of the interface.
> The result is that the interface state will be UNKNOWN.
> 
> The kernel considers the unknown state to be the same as up:
> https://elixir.bootlin.com/linux/latest/source/include/linux/netdevice.h#L4125
> 
> However for users this creates confusion:
> https://serverfault.com/questions/629676/dummy-network-interface-in-linux
> 
> The change in this patch is very simple. When the interface is set up, the
> operational state is set to IF_OPER_UP.
> 
> Signed-off-by: Kaarel Pärtel <kaarelp2rtel@...il.com>

You can change the carrier state from user space on a dummy device,
that will inform the kernel of the operstate:

# ip link add type dummy
# ip link show dev dummy0
8: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 8e:35:15:22:e3:d7 brd ff:ff:ff:ff:ff:ff
# ip link set dev dummy0 up
# ip link show dev dummy0
8: dummy0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether 8e:35:15:22:e3:d7 brd ff:ff:ff:ff:ff:ff
# ip link set dev dummy0 carrier off
# ip link set dev dummy0 carrier on
# ip link show dev dummy0
8: dummy0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether 8e:35:15:22:e3:d7 brd ff:ff:ff:ff:ff:ff


Flipping all soft devices which don't have a lower or don't expect user
space management to UP is fine but doing it one by one feels icky.
Yet another random thing a driver author has to know to flip.

If people are confused about seeing UNKNOWN in ip link output maybe we
should move displaying that under the -d flag (detailed output)?
Saves space, and nobody will get confused.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ