Skip to content

Commit d99cf13

Browse files
Al Viropcmoore
authored andcommitted
selinux: kill 'flags' argument in avc_has_perm_flags() and avc_audit()
... along with avc_has_perm_flags() itself, since now it's identical to avc_has_perm() (as pointed out by Paul Moore) Signed-off-by: Al Viro <[email protected]> [PM: add "selinux:" prefix to subj and tweak for length] Signed-off-by: Paul Moore <[email protected]>
1 parent b17ec22 commit d99cf13

File tree

3 files changed

+5
-31
lines changed

3 files changed

+5
-31
lines changed

security/selinux/avc.c

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,25 +1180,7 @@ int avc_has_perm(struct selinux_state *state, u32 ssid, u32 tsid, u16 tclass,
11801180
&avd);
11811181

11821182
rc2 = avc_audit(state, ssid, tsid, tclass, requested, &avd, rc,
1183-
auditdata, 0);
1184-
if (rc2)
1185-
return rc2;
1186-
return rc;
1187-
}
1188-
1189-
int avc_has_perm_flags(struct selinux_state *state,
1190-
u32 ssid, u32 tsid, u16 tclass, u32 requested,
1191-
struct common_audit_data *auditdata,
1192-
int flags)
1193-
{
1194-
struct av_decision avd;
1195-
int rc, rc2;
1196-
1197-
rc = avc_has_perm_noaudit(state, ssid, tsid, tclass, requested, 0,
1198-
&avd);
1199-
1200-
rc2 = avc_audit(state, ssid, tsid, tclass, requested, &avd, rc,
1201-
auditdata, flags);
1183+
auditdata);
12021184
if (rc2)
12031185
return rc2;
12041186
return rc;

security/selinux/hooks.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,7 @@ static int cred_has_capability(const struct cred *cred,
16761676
sid, sid, sclass, av, 0, &avd);
16771677
if (!(opts & CAP_OPT_NOAUDIT)) {
16781678
int rc2 = avc_audit(&selinux_state,
1679-
sid, sid, sclass, av, &avd, rc, &ad, 0);
1679+
sid, sid, sclass, av, &avd, rc, &ad);
16801680
if (rc2)
16811681
return rc2;
16821682
}
@@ -3153,9 +3153,8 @@ static int selinux_inode_follow_link(struct dentry *dentry, struct inode *inode,
31533153
if (IS_ERR(isec))
31543154
return PTR_ERR(isec);
31553155

3156-
return avc_has_perm_flags(&selinux_state,
3157-
sid, isec->sid, isec->sclass, FILE__READ, &ad,
3158-
rcu ? MAY_NOT_BLOCK : 0);
3156+
return avc_has_perm(&selinux_state,
3157+
sid, isec->sid, isec->sclass, FILE__READ, &ad);
31593158
}
31603159

31613160
static noinline int audit_inode_permission(struct inode *inode,

security/selinux/include/avc.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ int slow_avc_audit(struct selinux_state *state,
111111
* @avd: access vector decisions
112112
* @result: result from avc_has_perm_noaudit
113113
* @a: auxiliary audit data
114-
* @flags: VFS walk flags
115114
*
116115
* Audit the granting or denial of permissions in accordance
117116
* with the policy. This function is typically called by
@@ -127,8 +126,7 @@ static inline int avc_audit(struct selinux_state *state,
127126
u16 tclass, u32 requested,
128127
struct av_decision *avd,
129128
int result,
130-
struct common_audit_data *a,
131-
int flags)
129+
struct common_audit_data *a)
132130
{
133131
u32 audited, denied;
134132
audited = avc_audit_required(requested, avd, result, 0, &denied);
@@ -151,11 +149,6 @@ int avc_has_perm(struct selinux_state *state,
151149
u32 ssid, u32 tsid,
152150
u16 tclass, u32 requested,
153151
struct common_audit_data *auditdata);
154-
int avc_has_perm_flags(struct selinux_state *state,
155-
u32 ssid, u32 tsid,
156-
u16 tclass, u32 requested,
157-
struct common_audit_data *auditdata,
158-
int flags);
159152

160153
int avc_has_extended_perms(struct selinux_state *state,
161154
u32 ssid, u32 tsid, u16 tclass, u32 requested,

0 commit comments

Comments
 (0)