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

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

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

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

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