Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\commoncap.c Create Date:2022-07-28 18:36:25
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Calculate the new process capability sets from the capability sets attached* to a file.

Proto:static inline int bprm_caps_from_vfs_caps(struct cpu_vfs_cap_data *caps, struct linux_binprm *bprm, bool *effective, bool *has_fcap)

Type:int

Parameter:

TypeParameterName
struct cpu_vfs_cap_data *caps
struct linux_binprm *bprm
bool *effective
bool *has_fcap
533  new = w credentials
535  ret = 0
537  If magic_etc & VFS_CAP_FLAGS_EFFECTIVE Then * effective = true
540  If magic_etc & VFS_CAP_REVISION_MASK Then * has_fcap = true
544  permitted = cap[i]
545  inheritable = cap[i]
551  cap[i] = cap[i] & permitted | cap[i] & inheritable
555  If permitted & ~cap[i] Then ret = -EPERM
565  Return If effective Then ret Else 0
Caller
NameDescribe
get_file_capsAttempt to get the on-exec apply capability sets for an executable file from* its xattrs and, if present, apply them to the proposed credentials being* constructed by execve().