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]
Date: Mon, 15 Jan 2024 04:45:21 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Kunwu Chan <chentao@...inos.cn>
Cc: hkallweit1@...il.com, linux@...linux.org.uk, davem@...emloft.net,
	edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
	f.fainelli@...il.com, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] net: phy: Fix possible NULL pointer dereference
 issues caused by phy_attached_info_irq

> > Here, i would just skip the print and continue with the reset of the
> > function. The print is just useful information, its not a big problem
> > if its not printed. However, if this function does not complete, the
> > network interface is likely to be dead.
> Thanks for the reminder.
> The second part doesn't look so perfect, can we just print an empty string
> when the irq_str is empty?
> 
> --- a/drivers/net/phy/phylink.c
> +++ b/drivers/net/phy/phylink.c
> @@ -1886,7 +1886,7 @@ static int phylink_bringup_phy(struct phylink *pl,
> struct phy_device *phy,
>         irq_str = phy_attached_info_irq(phy);
>         phylink_info(pl,
>                      "PHY [%s] driver [%s] (irq=%s)\n",
> -                    dev_name(&phy->mdio.dev), phy->drv->name, irq_str);
> +                    dev_name(&phy->mdio.dev), phy->drv->name, irq_str ?
> irq_str : "");
>         kfree(irq_str);

That is O.K, or skip the whole phylink_info().

     Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ