Skip to content

Commit 8532503

Browse files
rlee287jrjohansen
authored andcommitted
apparmor: document capability.c:profile_capable ad ptr not being NULL
The profile_capabile function takes a struct apparmor_audit_data *ad, which is documented as possibly being NULL. However, the single place that calls this function never passes it a NULL ad. If we were ever to call profile_capable with a NULL ad elsewhere, we would need to rework the function, as its very first use of ad is to dereference ad->class without checking if ad is NULL. Thus, document profile_capable's ad parameter as not accepting NULL. Signed-off-by: Ryan Lee <[email protected]> Signed-off-by: John Johansen <[email protected]>
1 parent 9b89713 commit 8532503

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

security/apparmor/capability.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static int audit_caps(struct apparmor_audit_data *ad, struct aa_profile *profile
111111
* @profile: profile being enforced (NOT NULL, NOT unconfined)
112112
* @cap: capability to test if allowed
113113
* @opts: CAP_OPT_NOAUDIT bit determines whether audit record is generated
114-
* @ad: audit data (MAY BE NULL indicating no auditing)
114+
* @ad: audit data (NOT NULL)
115115
*
116116
* Returns: 0 if allowed else -EPERM
117117
*/

0 commit comments

Comments
 (0)