From: Liang Zhen Date: Tue, 22 Mar 2016 23:03:58 +0000 (-0400) Subject: staging: lustre: lnet: make sure lnet data not greater than LIBCFS_IOC_DATA_MAX X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=da4e5898375a100e6c1be984ceee84fb5911b6f6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435 Reviewed-on: http://review.whamcloud.com/11313 Reviewed-by: Bobi Jam Reviewed-by: Johann Lombardi Reviewed-by: Oleg Drokin Signed-off-by: Greg Kroah-Hartman --- 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);