]> git.baikalelectronics.ru Git - kernel.git/commit
selinux: store role transitions in a hash table
authorOndrej Mosnacek <omosnace@redhat.com>
Tue, 7 Apr 2020 18:28:58 +0000 (20:28 +0200)
committerPaul Moore <paul@paul-moore.com>
Fri, 17 Apr 2020 19:20:22 +0000 (15:20 -0400)
commit73fc7664fa8e31f1042f9b74999bfb86bb60876f
treee1520bce539fd62639ab310c6c9385522b48c73f
parenta4c69982c352eb7bf8e09effc577b547324bdbf8
selinux: store role transitions in a hash table

Currently, they are stored in a linked list, which adds significant
overhead to security_transition_sid(). On Fedora, with 428 role
transitions in policy, converting this list to a hash table cuts down
its run time by about 50%. This was measured by running 'stress-ng --msg
1 --msg-ops 100000' under perf with and without this patch.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/ss/policydb.c
security/selinux/ss/policydb.h
security/selinux/ss/services.c