aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2014-05-15 15:03:53 -0400
committerPaul Moore <pmoore@redhat.com>2014-05-15 17:07:55 -0400
commit47dd0b76ace953bd2c0479076db0d3e3b9594003 (patch)
tree7b3dddfbdcc1959ee789d7979efc9fee5f80e51c /security
parent612c353178c45250fbec271e7e8e75596d5cbbea (diff)
selinux: conditionally reschedule in hashtab_insert while loading selinux policy
After silencing the sleeping warning in mls_convert_context() I started seeing similar traces from hashtab_insert. Do a cond_resched there too. Signed-off-by: Dave Jones <davej@redhat.com> Acked-by: Stephen Smalley <sds@tycho.nsa.gov> Signed-off-by: Paul Moore <pmoore@redhat.com>
Diffstat (limited to 'security')
-rw-r--r--security/selinux/ss/hashtab.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/security/selinux/ss/hashtab.c b/security/selinux/ss/hashtab.c
index 933e735bb185..2cc496149842 100644
--- a/security/selinux/ss/hashtab.c
+++ b/security/selinux/ss/hashtab.c
@@ -6,6 +6,7 @@
6#include <linux/kernel.h> 6#include <linux/kernel.h>
7#include <linux/slab.h> 7#include <linux/slab.h>
8#include <linux/errno.h> 8#include <linux/errno.h>
9#include <linux/sched.h>
9#include "hashtab.h" 10#include "hashtab.h"
10 11
11struct hashtab *hashtab_create(u32 (*hash_value)(struct hashtab *h, const void *key), 12struct hashtab *hashtab_create(u32 (*hash_value)(struct hashtab *h, const void *key),
@@ -40,6 +41,8 @@ int hashtab_insert(struct hashtab *h, void *key, void *datum)
40 u32 hvalue; 41 u32 hvalue;
41 struct hashtab_node *prev, *cur, *newnode; 42 struct hashtab_node *prev, *cur, *newnode;
42 43
44 cond_resched();
45
43 if (!h || h->nel == HASHTAB_MAX_NODES) 46 if (!h || h->nel == HASHTAB_MAX_NODES)
44 return -EINVAL; 47 return -EINVAL;
45 48