lkml.org 
[lkml]   [2012]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 1/2] net: ethtool: Add capability to retrieve plug-in module EEPROM
From
Date
On Wed, 2012-04-11 at 17:50 +0100, Stuart Hodgson wrote:
> On 02/04/12 18:52, Ben Hutchings wrote:
[...]
> >> --- a/net/core/ethtool.c
> >> +++ b/net/core/ethtool.c
[...]
> >> + if (eeprom.offset + eeprom.len> modinfo.eeprom_len)
> >> + return -EINVAL;
> >> +
> >> + data = kmalloc(PAGE_SIZE, GFP_USER);
> >> + if (!data)
> >> + return -ENOMEM;
> >
> > What if some device has a larger EEPROM? Surely this length should be
> > eeprom.len.
> >
>
> Do you mean what if the eeprom length in te device is larger than
> PAGE_SIZE?

Yes.

> If so then it should really use modinfo.eeprom_len since
> this the size of the data. eeprom.len could be arbitary.

No, eeprom.len is the size of the data and we've already validated it at
this point.

Ben.




\
 
 \ /
  Last update: 2012-04-11 20:19    [W:0.082 / U:0.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site