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: <20221201202254.561103-1-sean.anderson@seco.com>
Date:   Thu,  1 Dec 2022 15:22:53 -0500
From:   Sean Anderson <sean.anderson@...o.com>
To:     Andrew Lunn <andrew@...n.ch>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Russell King <linux@...linux.org.uk>, netdev@...r.kernel.org
Cc:     Eric Dumazet <edumazet@...gle.com>, linux-kernel@...r.kernel.org,
        Paolo Abeni <pabeni@...hat.com>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Sean Anderson <sean.anderson@...o.com>
Subject: [PATCH net-next] net: phy: swphy: Only warn once for unknown speed

swphy_read_reg is called quite frequently during normal operation. If an
invalid speed is used for state, then it can turn dmesg into a firehose.
Although the first warn will likely contain a backtrace for the
offending driver, later warnings will usually just contain a backtrace
from the phy state machine. Just warn once.

Signed-off-by: Sean Anderson <sean.anderson@...o.com>
---

 drivers/net/phy/swphy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/swphy.c b/drivers/net/phy/swphy.c
index 59f1ba4d49bc..9af155a25f23 100644
--- a/drivers/net/phy/swphy.c
+++ b/drivers/net/phy/swphy.c
@@ -124,7 +124,7 @@ int swphy_read_reg(int reg, const struct fixed_phy_status *state)
 		return -1;
 
 	speed_index = swphy_decode_speed(state->speed);
-	if (WARN_ON(speed_index < 0))
+	if (WARN_ON_ONCE(speed_index < 0))
 		return 0;
 
 	duplex_index = state->duplex ? SWMII_DUPLEX_FULL : SWMII_DUPLEX_HALF;
-- 
2.35.1.1320.gc452695387.dirty

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ