From 1cc28b77798d48e31e5dc16cea4274eb52972fd4 Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Tue, 12 Apr 2016 16:14:15 -0400 Subject: [PATCH] staging: lustre: hsm: permission checks for HSM ioctl operations In the LL_IOC_HSM_CT_START case of ll_dir_ioctl() require CAP_SYS_ADMIN, since the local handler for this ioctl may modify the global KUC table. Signed-off-by: John L. Hammond Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3866 Reviewed-on: http://review.whamcloud.com/7565 Reviewed-by: Aurelien Degremont Reviewed-by: Faccini Bruno Reviewed-by: Jinshan Xiong Reviewed-by: Oleg Drokin Signed-off-by: James Simmons Signed-off-by: Greg Kroah-Hartman --- drivers/staging/lustre/lustre/llite/dir.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 1d5366b15a1b..b457c28d0a29 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -1843,6 +1843,9 @@ out_quotactl: return rc; } case LL_IOC_HSM_CT_START: + if (!capable(CFS_CAP_SYS_ADMIN)) + return -EPERM; + rc = copy_and_ioctl(cmd, sbi->ll_md_exp, (void __user *)arg, sizeof(struct lustre_kernelcomm)); return rc; -- 2.39.5