Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Attempt 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().

Proto:static int get_file_caps(struct linux_binprm *bprm, bool *effective, bool *has_fcap)

Type:int

Parameter:

TypeParameterName
struct linux_binprm *bprm
bool *effective
bool *has_fcap
652  rc = 0
655  cap_clear( caps we're permitted )
657  If Not file_caps_enabled Then Return 0
660  If Not mnt_may_suid(mnt) Then Return 0
668  If Not current_in_userns(s_user_ns) Then Return 0
671  rc = Extract the on-exec-apply capability sets for an executable file.
672  If rc < 0 Then
673  If rc == -EINVAL Then printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
676  Else if rc == -ENODATA Then rc = 0
678  Go to out
681  rc = Calculate the new process capability sets from the capability sets attached* to a file.
683  out :
684  If rc Then cap_clear( caps we're permitted )
687  Return rc
Caller
NameDescribe
cap_bprm_set_credsap_bprm_set_creds - Set up the proposed credentials for execve().*@bprm: The execution parameters, including the proposed creds* Set up the proposed credentials for a new execution context being* constructed by execve()