From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752313AbbINWp6 (ORCPT ); Mon, 14 Sep 2015 18:45:58 -0400 Received: from linuxhacker.ru ([217.76.32.60]:44244 "EHLO fiona.linuxhacker.ru" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751702AbbINWmP (ORCPT ); Mon, 14 Sep 2015 18:42:15 -0400 From: green@linuxhacker.ru To: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger Cc: Linux Kernel Mailing List , Niu Yawei , Oleg Drokin Subject: [PATCH 07/19] staging/lustre/llite: deny non-root user for changelog operations Date: Mon, 14 Sep 2015 18:41:23 -0400 Message-Id: <1442270495-1655259-8-git-send-email-green@linuxhacker.ru> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1442270495-1655259-1-git-send-email-green@linuxhacker.ru> References: <1442270495-1655259-1-git-send-email-green@linuxhacker.ru> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Niu Yawei 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 --- 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 d407fcc..cc6f0f5 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; -- 2.1.0