Re: [PATCH] selinux: fix error handling bugs in security_load_policy()

2020-08-26 Thread Paul Moore
On Wed, Aug 26, 2020 at 8:49 AM Stephen Smalley wrote: > On Wed, Aug 26, 2020 at 7:32 AM Dan Carpenter > wrote: > > > > There are a few bugs in the error handling for security_load_policy(). > > > > 1) If the newpolicy->sidtab allocation fails then it leads to a NULL > >dereference. Also

Re: [PATCH] selinux: fix error handling bugs in security_load_policy()

2020-08-26 Thread Stephen Smalley
On Wed, Aug 26, 2020 at 7:32 AM Dan Carpenter wrote: > > There are a few bugs in the error handling for security_load_policy(). > > 1) If the newpolicy->sidtab allocation fails then it leads to a NULL >dereference. Also the error code was not set to -ENOMEM on that >path. > 2) If

[PATCH] selinux: fix error handling bugs in security_load_policy()

2020-08-26 Thread Dan Carpenter
There are a few bugs in the error handling for security_load_policy(). 1) If the newpolicy->sidtab allocation fails then it leads to a NULL dereference. Also the error code was not set to -ENOMEM on that path. 2) If policydb_read() failed then we call policydb_destroy() twice which