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]
Date:   Fri, 10 May 2019 17:05:13 +0200
From:   Vicente Bergas <vicencb@...il.com>
To:     Serge Semin <fancer.lancer@...il.com>,
        Russell King <rmk+kernel@...linux.org.uk>,
        Andrew Lunn <andrew@...n.ch>,
        Florian Fainelli <f.fainelli@...il.com>,
        Heiner Kallweit <hkallweit1@...il.com>
Cc:     <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: net: phy: realtek: regression, kernel null pointer dereference

Hello,
there is a regression on linux v5.1-9573-gb970afcfcabd with a kernel null
pointer dereference.
The issue is the commit f81dadbcf7fd067baf184b63c179fc392bdb226e
  net: phy: realtek: Add rtl8211e rx/tx delays config
which uncovered a bug in phy-core when attempting to call
  phydev->drv->read_page
which can be null.
The patch to drivers/net/phy/phy-core.c below fixes the kernel null pointer
dereference. After applying the patch, there is still no network. I have
also tested the patch to drivers/net/phy/realtek.c, but no success. The
system hangs forever while initializing eth0.

Any suggestions?

Regards,
  Vicenç.

--- a/drivers/net/phy/phy-core.c
+++ b/drivers/net/phy/phy-core.c
@@ -648,11 +648,17 @@
 
 static int __phy_read_page(struct phy_device *phydev)
 {
+	if (!phydev->drv->read_page)
+		return -EOPNOTSUPP;
+	
 	return phydev->drv->read_page(phydev);
 }
 
 static int __phy_write_page(struct phy_device *phydev, int page)
 {
+	if (!phydev->drv->write_page)
+		return -EOPNOTSUPP;
+
 	return phydev->drv->write_page(phydev, page);
 }
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -214,8 +214,10 @@
 	 * for details).
 	 */
 	oldpage = phy_select_page(phydev, 0x7);
-	if (oldpage < 0)
-		goto err_restore_page;
+	if (oldpage < 0) {
+		dev_warn(&phydev->mdio.dev, "Unable to set rgmii delays\n");
+		return 0;
+	}
 
 	ret = phy_write(phydev, RTL821x_EXT_PAGE_SELECT, 0xa4);
 	if (ret)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ