Whamcloud - gitweb
LU-12331 llite: create obd_device with usercopy whitelist 28/35528/2
authorLi Dongyang <dongyangli@ddn.com>
Tue, 16 Jul 2019 07:01:01 +0000 (00:01 -0700)
committerOleg Drokin <green@whamcloud.com>
Fri, 26 Jul 2019 18:53:36 +0000 (18:53 +0000)
commitc8cf8521f517842febbab24e0b20a4b88e615416
tree0877a8d54aa2b6e0fd6d25b69acd08d15cfc74d9
parent1839debbba0e70dd5cc9f11c8bc83bcead0114d4
LU-12331 llite: create obd_device with usercopy whitelist

Since kernel 4.16 hardened usercopy has been added,
whitelist the struct obd_device to silence the warning.

 Bad or missing usercopy whitelist? Kernel memory exposure attempt
 detected from SLUB object 'll_obd_dev_cache' (offset 1256, size 40)!
 WARNING: CPU: 1 PID: 17534 at mm/usercopy.c:83 usercopy_warn+0x7d/0xa0
 Call Trace:
   __check_object_size+0xfa/0x181
   lmv_iocontrol+0x1146/0x1880 [lmv]
   ll_obd_statfs+0x356/0x860 [lustre]
   ll_dir_ioctl+0x1e37/0x6760 [lustre]
   do_vfs_ioctl+0xa4/0x630

Linux-commit: 8eb8284b412906181357c2b0110d879d5af95e52

This patch is back-ported from the following one:
Lustre-commit: 7f77996b1c4ac3a874a1f9e016e8b0e3cfee6992
Lustre-change: https://review.whamcloud.com/34946

Test-Parameters: trivial
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Change-Id: Ie863e8a5e2cebd3fd716e7ccc4e0491f83f6fabc
Reviewed-on: https://review.whamcloud.com/35528
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
lustre/include/lustre_compat.h
lustre/obdclass/genops.c