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-next>] [day] [month] [year] [list]
Message-ID: <20250403085857.17868-1-liuhangbin@gmail.com>
Date: Thu,  3 Apr 2025 08:58:54 +0000
From: Hangbin Liu <liuhangbin@...il.com>
To: netdev@...r.kernel.org
Cc: Andrew Lunn <andrew+netdev@...n.ch>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>,
	Simon Horman <horms@...nel.org>,
	Shuah Khan <shuah@...nel.org>,
	Xiao Liang <shaw.leon@...il.com>,
	Kuniyuki Iwashima <kuniyu@...zon.com>,
	Alexander Lobakin <aleksander.lobakin@...el.com>,
	Stanislav Fomichev <sdf@...ichev.me>,
	Venkat Venkatsubra <venkat.x.venkatsubra@...cle.com>,
	Etienne Champetier <champetier.etienne@...il.com>,
	Di Zhu <zhudi21@...wei.com>,
	Nikolay Aleksandrov <razor@...ckwall.org>,
	Travis Brown <travisb@...sta.com>,
	Suresh Krishnan <skrishnan@...sta.com>,
	linux-kselftest@...r.kernel.org,
	Hangbin Liu <liuhangbin@...il.com>
Subject: [PATCH net 0/3] fix ipvlan/macvlan link event handing

When setting the lower-layer link up/down, the ipvlan/macvlan device
synchronizes its state via netif_stacked_transfer_operstate(), which
only checks the carrier state. However, setting the link down does not
necessarily change the carrier state for virtual interfaces like bonding.
This causes the ipvlan/macvlan state to become out of sync with the
lower-layer link state. Fix this by explicitly changing the IFF_UP flag,
similar to how VLAN handles it.

Before the patch:
  # ./rtnetlink.sh -t "kci_test_vlan kci_test_ipvlan kci_test_macvlan"
  PASS: vlan link state correct
  FAIL: ipvlan link state incorrect
  FAIL: macvlan link state incorrect

After the patch set:
  # ./rtnetlink.sh -t "kci_test_vlan kci_test_ipvlan kci_test_macvlan"
  PASS: vlan link state correct
  PASS: ipvlan link state correct
  PASS: macvlan link state correct

Hangbin Liu (3):
  ipvlan: fix NETDEV_UP/NETDEV_DOWN event handling
  macvlan: fix NETDEV_UP/NETDEV_DOWN event handling
  selftests/rtnetlink.sh: add vlan/ipvlan/macvlan link state test

 drivers/net/ipvlan/ipvlan_main.c         | 20 +++++++-
 drivers/net/macvlan.c                    | 20 ++++++++
 tools/testing/selftests/net/rtnetlink.sh | 64 ++++++++++++++++++++++++
 3 files changed, 103 insertions(+), 1 deletion(-)

-- 
2.46.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ