Commit 62cbe860 authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

staging: lustre: libcfs: fix test for libcfs_ioctl_hdr minimum size

The function libcfs_ioctl_getdata() test to see if libcfs_ioctl_hdr
is smaller than struct libcfs_ioctl_data in size. This is wrong
and it breaks the ioctl that is used to collect LNet stats. The
correct size to compare against is struct libcfs_ioctl_hdr.
Signed-off-by: default avatarJames Simmons <uja.ornl@gmail.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5935
Reviewed-on: http://review.whamcloud.com/12782
Fixes: ed2f549d ("staging: lustre: libcfs: test if userland data is to small")
Reported-by: default avatarDoug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: default avatarLiang Zhen <liang.zhen@intel.com>
Reviewed-by: default avatarDoug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 048f81ff
......@@ -134,7 +134,7 @@ int libcfs_ioctl_getdata(struct libcfs_ioctl_hdr **hdr_pp,
return -EINVAL;
}
if (hdr.ioc_len < sizeof(struct libcfs_ioctl_data)) {
if (hdr.ioc_len < sizeof(hdr)) {
CERROR("libcfs ioctl: user buffer too small for ioctl\n");
return -EINVAL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment