]> git.baikalelectronics.ru Git - kernel.git/commit
selinux: check sidtab limit before adding a new entry
authorOndrej Mosnacek <omosnace@redhat.com>
Tue, 23 Jul 2019 06:50:59 +0000 (08:50 +0200)
committerPaul Moore <paul@paul-moore.com>
Wed, 24 Jul 2019 15:13:34 +0000 (11:13 -0400)
commit90f0d2323b09aac58d53e01a2b5d9d6d576e060f
tree4bccf1658aa986fd09d5d602a0b3073fdd44f6c5
parent9b495bcbaeff019ac308c33deb44d1b4aee89aaa
selinux: check sidtab limit before adding a new entry

We need to error out when trying to add an entry above SIDTAB_MAX in
sidtab_reverse_lookup() to avoid overflow on the odd chance that this
happens.

Cc: stable@vger.kernel.org
Fixes: 5d6af24407f1 ("selinux: overhaul sidtab to fix bug and improve performance")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/ss/sidtab.c