Whamcloud - gitweb
LU-12580 lov: fix out of bound usercopy 51/38051/2
authorLi Dongyang <dongyangli@ddn.com>
Fri, 7 Feb 2020 12:16:26 +0000 (23:16 +1100)
committerOleg Drokin <green@whamcloud.com>
Mon, 6 Apr 2020 21:17:19 +0000 (21:17 +0000)
commitd4dd52a3a1dea9e6117512889837e245fb983556
tree33a6bf7a0a9d1ea3ba5b66565b80143c04a90adf
parenta3c687a943233a7c5ae7e3fb906d1913b063c95c
LU-12580 lov: fix out of bound usercopy

When handling ioctl LL_IOC_LOV_GETSTRIPE, the user
could pass a limited buffer which is bigger than
lov_comp_md_size(), it will crash the client because
we are doing the usercopy with the user provided buffer
size.

Make sure the copy works, also for the PFL file,
we should only copy the chosen component.

Lustre-change: https://review.whamcloud.com/37469
Lustre-commit: 2f1beb33144523467b596f4b6fab882b0a839187

Change-Id: I92bcf6d7b7f7a4387a9936a0b58332e50a88e542
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/38051
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/lov/lov_pack.c