RE: [PATCH] net: netxen: correct sysfs bin attribute return code

2015-05-27 Thread Manish Chopra
-Original Message- From: Vladimir Zapolskiy [mailto:v...@mleia.com] Sent: Tuesday, May 26, 2015 6:20 AM To: David Miller; Manish Chopra; Sony Chacko; Rajesh Borundia Cc: netdev Subject: [PATCH] net: netxen: correct sysfs bin attribute return code If read() syscall requests

[PATCH] net: netxen: correct sysfs bin attribute return code

2015-05-25 Thread Vladimir Zapolskiy
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