]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] selinux: fix avc_alloc_node() oom with no policy loaded
authorStephen Smalley <sds@epoch.ncsc.mil>
Tue, 17 May 2005 04:53:52 +0000 (21:53 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 17 May 2005 14:59:20 +0000 (07:59 -0700)
commitb6ea7911e090477195c073aa203ac33fa72abe52
treee6d4fea8329bb709efd825ec14c9598a0c08e562
parent9d7c7ddffd911b332b3a1dca8fbd80c873bbfca4
[PATCH] selinux: fix avc_alloc_node() oom with no policy loaded

This patch should fix the avc_alloc_node() oom condition that Andrew
reported when no policy is loaded in SELinux.

Prior to this patch, when no policy was loaded, the SELinux "security
server" (policy engine) was only returning allowed decisions for the
requested permissions for each access check.  This caused the cache to
thrash when trying to use SELinux for real work with no policy loaded
(typically, the no policy loaded state is only for bootstrapping to the
point where we can load an initial policy).

This patch changes the SELinux security server to return the complete
allowed access vector at once, and then to reset the cache after the
initial policy load to flush the initial cache state created during
bootstrapping.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
security/selinux/ss/services.c