Thread (8 messages) flat view 8 messages, 2 authors, 2012-04-12

Re: [RFC PATCH 1/2] net: ethtool: Add capability to retrieve plug-in module EEPROM

From: Ben Hutchings <hidden>
Date: 2012-04-11 18:17:04
Also in: lkml

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help