From: Niu Yawei Date: Mon, 14 Sep 2015 22:41:23 +0000 (-0400) Subject: staging/lustre/llite: deny non-root user for changelog operations X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bbaa9c10328aa14615733c407b0c2f6d9c3df330;p=linux-beck.git staging/lustre/llite: deny non-root user for changelog operations To avoid potential security problems, non-privileged users should have no permission to run 'lfs changelog' & 'lfs changelog_clear'. Signed-off-by: Niu Yawei Reviewed-on: http://review.whamcloud.com/14280 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6415 Reviewed-by: Lai Siyao Reviewed-by: Jinshan Xiong Signed-off-by: Oleg Drokin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index d407fcc9904d..cc6f0f596ffe 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -1734,6 +1734,9 @@ out_quotactl: } case OBD_IOC_CHANGELOG_SEND: case OBD_IOC_CHANGELOG_CLEAR: + if (!capable(CFS_CAP_SYS_ADMIN)) + return -EPERM; + rc = copy_and_ioctl(cmd, sbi->ll_md_exp, (void *)arg, sizeof(struct ioc_changelog)); return rc;