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: <20221109152410.3572632-2-giometti@enneenne.com>
Date:   Wed,  9 Nov 2022 16:24:10 +0100
From:   Rodolfo Giometti <giometti@...eenne.com>
To:     netdev@...r.kernel.org
Cc:     Roopa Prabhu <roopa@...dia.com>,
        Nikolay Aleksandrov <razor@...ckwall.org>,
        Stephen Hemminger <shemminger@...l.org>,
        Flavio Leitner <fbl@...hat.com>,
        "David S . Miller" <davem@...emloft.net>,
        Rodolfo Giometti <giometti@...eenne.com>
Subject: [PATCH] net br_netlink.c:y allow non "disabled" state for !netif_oper_up() links

A generic loop-free network protocol (such as STP or MRP and others) may
require that a link not in an operational state be into a non "disabled"
state (such as listening).

For example MRP states that a MRM should set into a "BLOCKED" state (which is
equivalent to the LISTENING state for Linux bridges) one of its ring
connection if it detects that this connection is "DOWN" (that is the
NO-CARRIER status).

Signed-off-by: Rodolfo Giometti <giometti@...eenne.com>
---
 net/bridge/br_netlink.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 5c6c4305ed23..3f9f45c3d274 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -841,11 +841,8 @@ static int br_set_port_state(struct net_bridge_port *p, u8 state)
 	if (p->br->stp_enabled == BR_KERNEL_STP)
 		return -EBUSY;
 
-	/* if device is not up, change is not allowed
-	 * if link is not present, only allowable state is disabled
-	 */
-	if (!netif_running(p->dev) ||
-	    (!netif_oper_up(p->dev) && state != BR_STATE_DISABLED))
+	/* if device is not up, change is not allowed */
+	if (!netif_running(p->dev))
 		return -ENETDOWN;
 
 	br_set_state(p, state);
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ