Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:audit_caps - audit a capability*@sa: audit data*@profile: profile being tested for confinement (NOT NULL)*@cap: capability tested*@error: error code returned by test* Do auditing of capability and handle, audit/complain/kill modes switching

Proto:static int audit_caps(struct common_audit_data *sa, struct aa_profile *profile, int cap, int error)

Type:int

Parameter:

TypeParameterName
struct common_audit_data *sa
struct aa_profile *profile
intcap
interror
68  type = AUDIT_APPARMOR_AUTO
70  error = error
72  If Value is more likely to compile time(!error) Then
74  If Value is more likely to compile time((AUDIT_MODE(profile) != AUDIT_ALL) && !cap_raised(audit, cap)) Then Return 0
77  type = AUDIT_APPARMOR_AUDIT
78  Else if KILL_MODE(profile) || cap_raised(kill, cap) Then
80  type = AUDIT_APPARMOR_KILL
81  Else if cap_raised(quiet, cap) && AUDIT_MODE(profile) != do not quiet audit messages && AUDIT_MODE(profile) != AUDIT_ALL Then
85  Return error
89  ent = Must be an lvalue. Since @var must be a simple identifier,* we force a syntax error here if it isn't.(audit_cache)
90  If profile == profile && cap_raised(caps, cap) Then
91  The weird & is necessary because sparse considers (void)(var) to be* a direct dereference of percpu variable (var).(audit_cache)
92  If COMPLAIN_MODE(profile) Then Return complain_error(error)
94  Return error
95  Else
96  aa_put_profile - decrement refcount on profile @p*@p: profile (MAYBE NULL)
97  profile = aa_get_profile - increment refcount on profile @p*@p: profile (MAYBE NULL)* Returns: pointer to @p if @p is NULL will return NULL* Requires: @p must be held with valid refcount when called
98  cap_raise(caps, cap)
100  The weird & is necessary because sparse considers (void)(var) to be* a direct dereference of percpu variable (var).(audit_cache)
102  Return aa_audit - Log a profile based audit event to the audit subsystem*@type: audit type for the message*@profile: profile to check against (NOT NULL)*@sa: audit event (NOT NULL)*@cb: optional callback fn for type specific fields (MAYBE NULL)* Handle default
Caller
NameDescribe
profile_capableprofile_capable - test if profile allows use of capability @cap*@profile: profile being enforced (NOT NULL, NOT unconfined)*@cap: capability to test if allowed*@opts: CAP_OPT_NOAUDIT bit determines whether audit record is generated*@sa: audit data (MAY BE