On Wed, 2012-04-11 at 17:50 +0100, Stuart Hodgson wrote:
On 02/04/12 18:52, Ben Hutchings wrote:
[...]
quoted
quoted
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
[...]
quoted
quoted
+ 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.