]> git.baikalelectronics.ru Git - kernel.git/commit
SELinux: skip filename trans rules if ttype does not match parent dir
authorEric Paris <eparis@redhat.com>
Thu, 28 Apr 2011 19:11:21 +0000 (15:11 -0400)
committerEric Paris <eparis@redhat.com>
Thu, 28 Apr 2011 19:15:52 +0000 (15:15 -0400)
commit050fc3e051ac2f5cca655cee047f0fef4c64e8b5
treec4585fab7c37d4eb2cc46e93c925e7c2a5e7b1a2
parentc2ade7499c081db85ee11eb0c5d0c106d23c114f
SELinux: skip filename trans rules if ttype does not match parent dir

Right now we walk to filename trans rule list for every inode that is
created.  First passes at policy using this facility creates around 5000
filename trans rules.  Running a list of 5000 entries every time is a bad
idea.  This patch adds a new ebitmap to policy which has a bit set for each
ttype that has at least 1 filename trans rule.  Thus when an inode is
created we can quickly determine if any rules exist for this parent
directory type and can skip the list if we know there is definitely no
relevant entry.

Signed-off-by: Eric Paris <eparis@redhat.com>
Reviewed-by: James Morris <jmorris@namei.org>
security/selinux/ss/policydb.c
security/selinux/ss/policydb.h
security/selinux/ss/services.c