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>] [day] [month] [year] [list]
Message-Id: <20220223134848.3015840-1-pbrobinson@gmail.com>
Date:   Wed, 23 Feb 2022 13:48:48 +0000
From:   Peter Robinson <pbrobinson@...il.com>
To:     Doug Berger <opendmb@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        bcm-kernel-feedback-list@...adcom.com, netdev@...r.kernel.org
Cc:     Peter Robinson <pbrobinson@...il.com>,
        Javier Martinez Canillas <javierm@...hat.com>
Subject: [PATCH v2] net: bcmgenet: Return not supported if we don't have a WoL IRQ

The ethtool WoL enable function wasn't checking if the device
has the optional WoL IRQ and hence on platforms such as the
Raspberry Pi 4 which had working ethernet prior to the last
fix regressed with the last fix, so also check if we have a
WoL IRQ there and return ENOTSUPP if not.

Fixes: 9deb48b53e7f ("bcmgenet: add WOL IRQ check")
Fixes: 8562056f267d ("net: bcmgenet: request Wake-on-LAN interrupt")
Signed-off-by: Peter Robinson <pbrobinson@...il.com>
Suggested-by: Javier Martinez Canillas <javierm@...hat.com>
Acked-by: Florian Fainelli <f.fainelli@...il.com>
Reviewed-by: Javier Martinez Canillas <javierm@...hat.com>
---
Changes since v1:
 - Use EOPNOTSUPP insteal of ENOTSUPP (Jakub Kicinski)

 drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
index e31a5a397f11..c0fd2d4799a0 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
@@ -60,6 +60,10 @@ int bcmgenet_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 	if (!device_can_wakeup(kdev))
 		return -ENOTSUPP;
 
+	/* We need a WoL IRQ to enable support, not all HW has one setup */
+	if (priv->wol_irq <= 0)
+		return -EOPNOTSUPP;
+
 	if (wol->wolopts & ~(WAKE_MAGIC | WAKE_MAGICSECURE | WAKE_FILTER))
 		return -EINVAL;
 
-- 
2.35.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ