Whamcloud - gitweb
LU-3866 hsm: permission checks on HSM operations 65/7565/3
authorJohn L. Hammond <john.hammond@intel.com>
Thu, 5 Sep 2013 17:44:27 +0000 (12:44 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 8 Oct 2013 16:04:08 +0000 (16:04 +0000)
commit13787b1d87b10c693db274c4d2b718e75e88c12f
tree9ba3e7392f8ef6eeacca9ff4974c2d3ea2338e9a
parente789a35352c78efca8c6ce0d7a4d0a84429072ce
LU-3866 hsm: permission checks on HSM 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.

In the MDC HSM handlers that do not pack a real suppgid, use -1 rather
than 0 for the suppgid in mdt_body.

In mdt_hsm_release() and the the MDT HSM RPC handlers require a
read-write client mount for all operations except restore, get HSM
state, and get HSM actions.  Require CAP_SYS_ADMIN for
MDS_HSM_PROGRESS, MDS_HSM_CT_REGISTER, and
MDS_HSM_CT_UNREGISTER. Require CAP_SYS_ADMIN in mdt_hsm_state_set()
for setting flags not in HSM_USER_MASK.

Add per-coordinator bit masks (cdt_{user,group,other}_request_mask)
indexed by the HSMA constants to govern permissions on the various
requests types. By default each mask is set to allow restore only.
Add files /proc/fs/lustre/mdt/*/hsm/{user,group,other}_request_mask to
get and set these masks.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Ifcb3c0950ebb11187cce62f15abbe8746f1ff7c2
Reviewed-on: http://review.whamcloud.com/7565
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Aurelien Degremont <aurelien.degremont@cea.fr>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/dir.c
lustre/mdc/mdc_request.c
lustre/mdt/mdt_coordinator.c
lustre/mdt/mdt_hsm.c
lustre/mdt/mdt_hsm_cdt_client.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_mds.c
lustre/mdt/mdt_open.c
lustre/tests/sanity-hsm.sh