]> git.baikalelectronics.ru Git - kernel.git/commit
net: netxen: correct sysfs bin attribute return code
authorVladimir Zapolskiy <vz@mleia.com>
Tue, 26 May 2015 00:50:04 +0000 (03:50 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 May 2015 04:25:33 +0000 (00:25 -0400)
commitcf436213dec4b519b0a0fae627866b992ed0de67
tree161b2291bb05f5b0b3fd4e3339525665badbbfb2
parente87633675f8543f0aaa1472d01c97dc8a5d35df2
net: netxen: correct sysfs bin attribute return code

If read() syscall requests unexpected number of bytes from "dimm" binary
attribute file, return EINVAL instead of EPERM.

At the same time pin down sysfs file size to the fixed
sizeof(struct netxen_dimm_cfg), which allows to exploit some missing
sanity checks from kernfs (file boundary checks vs offset etc.)

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c