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: <1449657826-4461-1-git-send-email-vinschen@redhat.com>
Date:	Wed,  9 Dec 2015 11:43:46 +0100
From:	Corinna Vinschen <vinschen@...hat.com>
To:	netdev@...r.kernel.org
Cc:	Francois Romieu <romieu@...zoreil.com>,
	Realtek linux nic maintainers <nic_swsd@...ltek.com>,
	Corinna Vinschen <vinschen@...hat.com>
Subject: [PATCH v2] r8169: Don't claim WoL works if LanWake flag is not set

[v2 adds missing text to the patch comment]

The __rtl8169_get_wol function returns the state of the various WoL
method bits (MagicPaket, Unicast, etc.).  While the PMEnable bit is
tested at entry, the function doesn't check the LanWake flag.  Even if
any one of the WoL bits is set, WoL is deactivated as a whole if LanWake
isn't set.  The return value from __rtl8169_get_wol doesn't reflect
that.

Unfortunately BIOS exist (HP T620) which set the MagicPaket bit to 1 but
the LanWake flag to 0 when switching on WoL in the BIOS.  On those machines,
ethtool wrongly claims that WoL via MagicPaket is activated while in fact
it isn't, unless you explicitely called, e.g, `ethtool -s <IF> wol g'.

This patch is supposed to fix this behaviour.  If LanWake is 0, the
function now returns 0.  Thus ethtool correctly reports "Wake-on: d".

The patch is against Dave's net-next tree.


Signed-off-by: Corinna Vinschen <vinschen@...hat.com>
---
 drivers/net/ethernet/realtek/r8169.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 79ef799..813ad2b 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -1705,6 +1705,10 @@ static u32 __rtl8169_get_wol(struct rtl8169_private *tp)
 	if (!(options & PMEnable))
 		return 0;
 
+	options = RTL_R8(Config5);
+	if (!(options & LanWake))
+		return 0;
+
 	options = RTL_R8(Config3);
 	if (options & LinkUp)
 		wolopts |= WAKE_PHY;
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ