Skip to content

Commit a3d3043

Browse files
cgzonespcmoore
authored andcommitted
selinux: get netif_wildcard policycap from policy instead of cache
Retrieve the netif_wildcard policy capability in security_netif_sid() from the locked active policy instead of the cached value in selinux_state. Fixes: 8af43b6 ("selinux: support wildcard network interface names") Signed-off-by: Christian Göttsche <[email protected]> Acked-by: Stephen Smalley <[email protected]> [PM: /netlabel/netif/ due to a typo in the description] Signed-off-by: Paul Moore <[email protected]>
1 parent 8af43b6 commit a3d3043

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

security/selinux/ss/services.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2587,14 +2587,13 @@ int security_netif_sid(const char *name, u32 *if_sid)
25872587
return 0;
25882588
}
25892589

2590-
wildcard_support = selinux_policycap_netif_wildcard();
2591-
25922590
retry:
25932591
rc = 0;
25942592
rcu_read_lock();
25952593
policy = rcu_dereference(selinux_state.policy);
25962594
policydb = &policy->policydb;
25972595
sidtab = policy->sidtab;
2596+
wildcard_support = ebitmap_get_bit(&policydb->policycaps, POLICYDB_CAP_NETIF_WILDCARD);
25982597

25992598
c = policydb->ocontexts[OCON_NETIF];
26002599
while (c) {

0 commit comments

Comments
 (0)