From: Dave Jones Date: Thu, 15 May 2014 19:03:53 +0000 (-0400) Subject: selinux: conditionally reschedule in hashtab_insert while loading selinux policy X-Git-Tag: Ubuntu-snapdragon-4.4.0-1029.32~8626^2~1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=ed1c96429a6aa6ffd8c4ee3e80bcde28aad270bc;p=mirror_ubuntu-zesty-kernel.git 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 Acked-by: Stephen Smalley Signed-off-by: Paul Moore --- 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 #include #include +#include #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;