]> git.baikalelectronics.ru Git - kernel.git/commit
ethtool: Validate module EEPROM offset as part of policy
authorIdo Schimmel <idosch@nvidia.com>
Tue, 22 Jun 2021 06:50:52 +0000 (09:50 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 22 Jun 2021 17:40:54 +0000 (10:40 -0700)
commit544f6389306bc234ac9a20fa5ddffe2409439302
treeaedc601b478d092457ec44161e0921c2e1afaafa
parent9b5671e682319b6f058bbbbed9b12c08884693fd
ethtool: Validate module EEPROM offset as part of policy

Validate the offset to read from module EEPROM as part of the netlink
policy and remove the corresponding check from the code.

This also makes it possible to query the offset range from user space:

 $ genl ctrl policy name ethtool
 ...
 ID: 0x14  policy[32]:attr[2]: type=U32 range:[0,255]
 ...

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ethtool/eeprom.c