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: <1711892489-27931-2-git-send-email-venkat.x.venkatsubra@oracle.com>
Date: Sun, 31 Mar 2024 06:41:29 -0700
From: Venkat Venkatsubra <venkat.x.venkatsubra@...cle.com>
To: davem@...emloft.net, netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        maheshb@...gle.com, edumazet@...gle.com
Cc: gia-khanh.nguyen@...cle.com
Subject: [PATCH net-next] ipvlan: handle NETDEV_DOWN event

In case of stacked devices, to help propagate the down
link state from the parent/root device (to this leaf device),
handle NETDEV_DOWN event like it is done now for NETDEV_UP.

In the below example, ens5 is the host interface which is the
parent of the ipvlan interface eth0 in the container.

Host:

[root@...-podman-x64 ~]# ip link set ens5 down
[root@...-podman-x64 ~]# ip -d link show dev ens5
3: ens5: <BROADCAST,MULTICAST> mtu 9000 qdisc mq state DOWN
      ...
[root@...-podman-x64 ~]#

Container:

[root@...tnode-ol8 /]# ip -d link show dev eth0
2: eth0@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 state UNKNOWN
        ...
    ipvlan mode l2 bridge
        ...
[root@...tnode-ol8 /]#

eth0's state continues to show up as UP even though ens5 is now DOWN.

Reported-by: Gia-Khanh Nguyen <gia-khanh.nguyen@...cle.com>
Signed-off-by: Venkat Venkatsubra <venkat.x.venkatsubra@...cle.com>
---
 drivers/net/ipvlan/ipvlan_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
index 5920f7e63352..724d660904a2 100644
--- a/drivers/net/ipvlan/ipvlan_main.c
+++ b/drivers/net/ipvlan/ipvlan_main.c
@@ -736,6 +736,7 @@ static int ipvlan_device_event(struct notifier_block *unused,
 	switch (event) {
 	case NETDEV_UP:
 	case NETDEV_CHANGE:
+	case NETDEV_DOWN:
 		list_for_each_entry(ipvlan, &port->ipvlans, pnode)
 			netif_stacked_transfer_operstate(ipvlan->phy_dev,
 							 ipvlan->dev);
-- 
1.8.3.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ