path: root/scripts/selinux/mdp/mdp.c
diff options
authorOndrej Mosnacek <omosnace@redhat.com>2019-03-17 14:46:53 +0100
committerPaul Moore <paul@paul-moore.com>2019-03-18 12:19:48 -0400
commit6a1afffb08ce5f9fb9ccc20f7ab24846c0142984 (patch)
tree960c8d62d8a57248005a8f626b79b4eb37d53dea /scripts/selinux/mdp/mdp.c
parentLinux 5.1-rc1 (diff)
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 '')
0 files changed, 0 insertions, 0 deletions