Whamcloud - gitweb
LU-12580 lov: fix out of bound usercopy 69/37469/4
authorLi Dongyang <dongyangli@ddn.com>
Fri, 7 Feb 2020 12:16:26 +0000 (23:16 +1100)
committerOleg Drokin <green@whamcloud.com>
Tue, 24 Mar 2020 05:23:06 +0000 (05:23 +0000)
commit2f1beb33144523467b596f4b6fab882b0a839187
treef8fda7d06e2f2b0e921b16f58eb15d843eccb717
parentd41716533682ed88b8a77654f9b5b050ef5c672c
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.

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