[PATCH] selinux: fix NULL dereference in policydb_destroy()

2019-03-17 Thread Ondrej Mosnacek
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

Re: [PATCH] selinux: fix NULL dereference in policydb_destroy()

2019-03-18 Thread Stephen Smalley
On 3/17/19 9:46 AM, Ondrej Mosnacek wrote: 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 befor

Re: [PATCH] selinux: fix NULL dereference in policydb_destroy()

2019-03-18 Thread Paul Moore
On Sun, Mar 17, 2019 at 9:47 AM Ondrej Mosnacek wrote: > > 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 call