Re: [PATCH v2 1/1] selinux: fix another double free

2020-06-12 Thread Paul Moore
On Fri, Jun 12, 2020 at 4:01 AM Ondrej Mosnacek wrote: > On Fri, Jun 12, 2020 at 1:27 AM Paul Moore wrote: > > On Thu, Jun 11, 2020 at 6:41 PM Tom Rix wrote: > > > On 6/11/20 3:30 PM, Paul Moore wrote: > > > > On Thu, Jun 11, 2020 at 4:48 PM wrote: > > > >> From: Tom Rix > > > >> > > > >> Clan

Re: [PATCH v2 1/1] selinux: fix another double free

2020-06-12 Thread Ondrej Mosnacek
On Fri, Jun 12, 2020 at 1:27 AM Paul Moore wrote: > On Thu, Jun 11, 2020 at 6:41 PM Tom Rix wrote: > > On 6/11/20 3:30 PM, Paul Moore wrote: > > > On Thu, Jun 11, 2020 at 4:48 PM wrote: > > >> From: Tom Rix > > >> > > >> Clang static analysis reports this double free error > > >> > > >> securit

Re: [PATCH v2 1/1] selinux: fix another double free

2020-06-12 Thread Ondrej Mosnacek
On Thu, Jun 11, 2020 at 10:48 PM wrote: [...] > diff --git a/security/selinux/ss/conditional.c > b/security/selinux/ss/conditional.c > index da94a1b4bfda..d0d6668709f0 100644 > --- a/security/selinux/ss/conditional.c > +++ b/security/selinux/ss/conditional.c > @@ -392,26 +392,21 @@ static int con

Re: [PATCH v2 1/1] selinux: fix another double free

2020-06-11 Thread Paul Moore
On Thu, Jun 11, 2020 at 6:41 PM Tom Rix wrote: > On 6/11/20 3:30 PM, Paul Moore wrote: > > On Thu, Jun 11, 2020 at 4:48 PM wrote: > >> From: Tom Rix > >> > >> Clang static analysis reports this double free error > >> > >> security/selinux/ss/conditional.c:139:2: warning: Attempt to free released

Re: [PATCH v2 1/1] selinux: fix another double free

2020-06-11 Thread Tom Rix
On 6/11/20 3:30 PM, Paul Moore wrote: > On Thu, Jun 11, 2020 at 4:48 PM wrote: >> From: Tom Rix >> >> Clang static analysis reports this double free error >> >> security/selinux/ss/conditional.c:139:2: warning: Attempt to free released >> memory [unix.Malloc] >> kfree(node->expr.nodes)

Re: [PATCH v2 1/1] selinux: fix another double free

2020-06-11 Thread Paul Moore
On Thu, Jun 11, 2020 at 4:48 PM wrote: > From: Tom Rix > > Clang static analysis reports this double free error > > security/selinux/ss/conditional.c:139:2: warning: Attempt to free released > memory [unix.Malloc] > kfree(node->expr.nodes); > ^~~ > > When cond

[PATCH v2 1/1] selinux: fix another double free

2020-06-11 Thread trix
From: Tom Rix Clang static analysis reports this double free error security/selinux/ss/conditional.c:139:2: warning: Attempt to free released memory [unix.Malloc] kfree(node->expr.nodes); ^~~ When cond_read_node fails, it calls cond_node_destroy which frees