]> git.baikalelectronics.ru Git - kernel.git/commit
selinux: make nslot handling in avtab more robust
authorOndrej Mosnacek <omosnace@redhat.com>
Fri, 2 Apr 2021 08:56:18 +0000 (10:56 +0200)
committerPaul Moore <paul@paul-moore.com>
Fri, 2 Apr 2021 15:46:37 +0000 (11:46 -0400)
commit92b7b701b153d06ab1c2731e247cc57d9a038314
tree056a44fd675c1b4f0032a2566bf7968d3585af3e
parent6a6dd84cbd56e06f5ea7d2c41088a00c34a95a92
selinux: make nslot handling in avtab more robust

1. Make sure all fileds are initialized in avtab_init().
2. Slightly refactor avtab_alloc() to use the above fact.
3. Use h->nslot == 0 as a sentinel in the access functions to prevent
   dereferencing h->htable when it's not allocated.

Cc: stable@vger.kernel.org
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/ss/avtab.c