summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2014-05-15 21:03:53 +0200
committerSerge Hallyn <serge.hallyn@ubuntu.com>2014-06-03 21:21:50 +0200
commited1c96429a6aa6ffd8c4ee3e80bcde28aad270bc (patch)
tree235ddd61f28c3030838ebbe5655fccfd1468042c /security
parentselinux: conditionally reschedule in mls_convert_context while loading selinu... (diff)
downloadlinux-ed1c96429a6aa6ffd8c4ee3e80bcde28aad270bc.tar.xz
linux-ed1c96429a6aa6ffd8c4ee3e80bcde28aad270bc.zip
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 @@
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/errno.h>
+#include <linux/sched.h>
#include "hashtab.h"
struct 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)
u32 hvalue;
struct hashtab_node *prev, *cur, *newnode;
+ cond_resched();
+
if (!h || h->nel == HASHTAB_MAX_NODES)
return -EINVAL;