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: <20080627220749.GA3046@curtisfong.org>
Date:	Fri, 27 Jun 2008 15:07:49 -0700
From:	Nye Liu <nyet@...t.org>
To:	Sergei Shtylyov <sshtylyov@...mvista.com>
Cc:	linux-kernel@...r.kernel.org, linuxppc-dev@...abs.org,
	netdev@...r.kernel.org
Subject: Re: [PATCH] FS_ENET: Don't attempt to set mii_speed when fec_inf
	is null

Sorry!

diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c
index 8a311d1..7359068 100644
--- a/drivers/net/fs_enet/mac-fec.c
+++ b/drivers/net/fs_enet/mac-fec.c
@@ -328,7 +328,8 @@ static void restart(struct net_device *dev)
 	/*
 	 * Set MII speed.
 	 */
-	FW(fecp, mii_speed, fec_inf->mii_speed);
+	if (fec_inf)
+		FW(fecp, mii_speed, fec_inf->mii_speed);
 
 	/*
 	 * Clear any outstanding interrupt.

On Sat, Jun 28, 2008 at 01:29:16AM +0400, Sergei Shtylyov wrote:
> Hello.
>
> Nye Liu wrote:
>> From: Nye Liu <nyet@....com>
>>
>> When using CONFIG_FIXED_PHY, fec_inf (fep->phydev->bus->priv) is NULL in
>> fs_enet/mac-fec.c restart(). Dereferencing fec_inf when trying to set the
>> mii_speed causes a kernel oops.
>>
>> Signed-off-by: Nye Liu <nyet@....com>
>>
>> ---
>>
>> diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c
>> index 8a311d1..350bc73 100644
>> --- a/drivers/net/fs_enet/mac-fec.c
>> +++ b/drivers/net/fs_enet/mac-fec.c
>> @@ -328,7 +328,8 @@ static void restart(struct net_device *dev)
>>         /*
>>          * Set MII speed.
>>          */
>> -       FW(fecp, mii_speed, fec_inf->mii_speed);
>> +       if (fec_inf)
>> +           FW(fecp, mii_speed, fec_inf->mii_speed);
>>   
>
>   Alas, Your patch is whitespace damaged.
>
>
> WBR, Sergei
>
>
--
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