Commit da4e5898 authored by Liang Zhen's avatar Liang Zhen Committed by Greg Kroah-Hartman

staging: lustre: lnet: make sure lnet data not greater than LIBCFS_IOC_DATA_MAX

Fail to compile if largest LNet user land data structures passed
to kernel are larger than LIBCFS_IOC_DATA_MAX
Signed-off-by: default avatarLiang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11313Reviewed-by: default avatarBobi Jam <bobijam@gmail.com>
Reviewed-by: default avatarJohann Lombardi <johann.lombardi@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ed2f549d
...@@ -1864,6 +1864,10 @@ LNetCtl(unsigned int cmd, void *arg) ...@@ -1864,6 +1864,10 @@ LNetCtl(unsigned int cmd, void *arg)
int rc; int rc;
unsigned long secs_passed; unsigned long secs_passed;
BUILD_BUG_ON(LIBCFS_IOC_DATA_MAX <
sizeof(struct lnet_ioctl_net_config) +
sizeof(struct lnet_ioctl_config_data));
switch (cmd) { switch (cmd) {
case IOC_LIBCFS_GET_NI: case IOC_LIBCFS_GET_NI:
rc = LNetGetId(data->ioc_count, &id); rc = LNetGetId(data->ioc_count, &id);
......
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