[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOD=uF5+DHqxBW9waP3CYrfrq_WiBjWsyoKkZCSq+GvOsoUpMg@mail.gmail.com>
Date: Mon, 5 Mar 2012 11:04:49 +0530
From: santosh prasad nayak <santoshprasadnayak@...il.com>
To: David Miller <davem@...emloft.net>
Cc: dan.carpenter@...cle.com, masa-korg@....okisemi.com,
paul.gortmaker@...driver.com, jeffrey.t.kirsher@...el.com,
mirq-linux@...e.qmqm.pl, netdev@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [patch] pch_gbe: memory corruption calling pch_gbe_validate_option()
Dan,
Your fix may introduce new bug.
hw->phy.autoneg_advertised = tmp
Assigning signed integer to unsigned short leads to bit truncation.
Is it safe for both Big-endian and little endian format ?
AutoNeg is initialized with a Negative value (OPTION_UNSET)
Won't it create any issue with above assignment ?
The simpler fix is to make "autoneg_advertised" signed integer.
struct pch_gbe_phy_info {
u32 addr;
u32 id;
u32 revision;
u32 reset_delay_us;
u16 autoneg_advertised; // ==> int autoneg_advertised
};
Regards
Santosh
On Fri, Mar 2, 2012 at 3:54 AM, David Miller <davem@...emloft.net> wrote:
> From: Dan Carpenter <dan.carpenter@...cle.com>
> Date: Thu, 1 Mar 2012 10:17:08 +0300
>
>> pch_gbe_validate_option() modifies 32 bits of memory but we pass
>> &hw->phy.autoneg_advertised which only has 16 bits and &hw->mac.fc
>> which only has 8 bits.
>>
>> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
>
> Applied.
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
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