Viresh Kumar 7ee23491b3 RDMA/qib: Validate ->show()/store() callbacks before calling them
The permissions of the read-only or write-only sysfs files can be
changed (as root) and the user can then try to read a write-only file or
write to a read-only file which will lead to kernel crash here.

Protect against that by always validating the show/store callbacks.

Link: https://lore.kernel.org/r/d45cc26361a174ae12dbb86c994ef334d257924b.1573096807.git.viresh.kumar@linaro.org
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2019-11-14 11:49:15 -04:00
..
2019-07-25 13:53:45 -03:00
2019-11-06 15:19:33 -04:00
2019-05-09 09:02:46 -07:00
2017-01-24 16:20:37 -05:00
2017-01-24 16:20:37 -05:00
2019-06-28 21:18:23 -03:00
2019-04-01 13:31:35 -03:00