diff options
author | Ondrej Mosnacek <omosnace@redhat.com> | 2019-03-17 16:46:53 +0300 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2019-03-18 19:19:48 +0300 |
commit | 6a1afffb08ce5f9fb9ccc20f7ab24846c0142984 (patch) | |
tree | 960c8d62d8a57248005a8f626b79b4eb37d53dea /kernel | |
parent | 9e98c678c2d6ae3a17cb2de55d17f69dddaa231b (diff) | |
download | linux-6a1afffb08ce5f9fb9ccc20f7ab24846c0142984.tar.xz |
selinux: fix NULL dereference in policydb_destroy()
The conversion to kvmalloc() forgot to account for the possibility that
p->type_attr_map_array might be null in policydb_destroy().
Fix this by destroying its contents only if it is not NULL.
Also make sure ebitmap_init() is called on all entries before
policydb_destroy() can be called. Right now this is a no-op, because
both kvcalloc() and ebitmap_init() just zero out the whole struct, but
let's rather not rely on a specific implementation.
Reported-by: syzbot+a57b2aff60832666fc28@syzkaller.appspotmail.com
Fixes: acdf52d97f82 ("selinux: convert to kvmalloc")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions