diff options
Diffstat (limited to 'security/selinux/avc.c')
-rw-r--r-- | security/selinux/avc.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/security/selinux/avc.c b/security/selinux/avc.c index 2a84dec4adfe..326aa78bd421 100644 --- a/security/selinux/avc.c +++ b/security/selinux/avc.c | |||
@@ -381,30 +381,25 @@ static inline struct avc_node *avc_search_node(u32 ssid, u32 tsid, u16 tclass) | |||
381 | * @ssid: source security identifier | 381 | * @ssid: source security identifier |
382 | * @tsid: target security identifier | 382 | * @tsid: target security identifier |
383 | * @tclass: target security class | 383 | * @tclass: target security class |
384 | * @requested: requested permissions, interpreted based on @tclass | ||
385 | * | 384 | * |
386 | * Look up an AVC entry that is valid for the | 385 | * Look up an AVC entry that is valid for the |
387 | * @requested permissions between the SID pair | ||
388 | * (@ssid, @tsid), interpreting the permissions | 386 | * (@ssid, @tsid), interpreting the permissions |
389 | * based on @tclass. If a valid AVC entry exists, | 387 | * based on @tclass. If a valid AVC entry exists, |
390 | * then this function return the avc_node. | 388 | * then this function return the avc_node. |
391 | * Otherwise, this function returns NULL. | 389 | * Otherwise, this function returns NULL. |
392 | */ | 390 | */ |
393 | static struct avc_node *avc_lookup(u32 ssid, u32 tsid, u16 tclass, u32 requested) | 391 | static struct avc_node *avc_lookup(u32 ssid, u32 tsid, u16 tclass) |
394 | { | 392 | { |
395 | struct avc_node *node; | 393 | struct avc_node *node; |
396 | 394 | ||
397 | avc_cache_stats_incr(lookups); | 395 | avc_cache_stats_incr(lookups); |
398 | node = avc_search_node(ssid, tsid, tclass); | 396 | node = avc_search_node(ssid, tsid, tclass); |
399 | 397 | ||
400 | if (node && ((node->ae.avd.decided & requested) == requested)) { | 398 | if (node) |
401 | avc_cache_stats_incr(hits); | 399 | avc_cache_stats_incr(hits); |
402 | goto out; | 400 | else |
403 | } | 401 | avc_cache_stats_incr(misses); |
404 | 402 | ||
405 | node = NULL; | ||
406 | avc_cache_stats_incr(misses); | ||
407 | out: | ||
408 | return node; | 403 | return node; |
409 | } | 404 | } |
410 | 405 | ||
@@ -875,7 +870,7 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid, | |||
875 | 870 | ||
876 | rcu_read_lock(); | 871 | rcu_read_lock(); |
877 | 872 | ||
878 | node = avc_lookup(ssid, tsid, tclass, requested); | 873 | node = avc_lookup(ssid, tsid, tclass); |
879 | if (!node) { | 874 | if (!node) { |
880 | rcu_read_unlock(); | 875 | rcu_read_unlock(); |
881 | 876 | ||