diff options
author | Liang Zhen <[email protected]> | 2016-03-22 19:03:58 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2016-03-28 07:30:36 -0700 |
commit | da4e5898375a100e6c1be984ceee84fb5911b6f6 (patch) | |
tree | 119497852c706e2873e60867e5e60a07d1ad3c65 | |
parent | ed2f549dc0f687f5d454cb20754340e83e5b9c4f (diff) |
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: Liang Zhen <[email protected]>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11313
Reviewed-by: Bobi Jam <[email protected]>
Reviewed-by: Johann Lombardi <[email protected]>
Reviewed-by: Oleg Drokin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r-- | drivers/staging/lustre/lnet/lnet/api-ni.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 8764755544c9..f825784b79e1 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1864,6 +1864,10 @@ LNetCtl(unsigned int cmd, void *arg) int rc; 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) { case IOC_LIBCFS_GET_NI: rc = LNetGetId(data->ioc_count, &id); |