Re: [PATCH v2] zram: fix possible use after free in zcomp_create()

2015-09-07 Thread Minchan Kim
On Tue, Sep 08, 2015 at 10:20:38AM +0900, Sergey Senozhatsky wrote: > On (09/08/15 10:07), Minchan Kim wrote: > [..] > > > + int ret; > > > > For the clarification, I want to call it as 'error' instead of ret. > > > > > > > > backend = find_backend(compress); > > > if (!backend) > > > @@

Re: [PATCH v2] zram: fix possible use after free in zcomp_create()

2015-09-07 Thread Sergey Senozhatsky
On (09/08/15 10:07), Minchan Kim wrote: [..] > > + int ret; > > For the clarification, I want to call it as 'error' instead of ret. > > > > > backend = find_backend(compress); > > if (!backend) > > @@ -347,10 +348,10 @@ struct zcomp *zcomp_create(const char *compress, int > >

Re: [PATCH v2] zram: fix possible use after free in zcomp_create()

2015-09-07 Thread Minchan Kim
Hello, First of all, Thanks for catching a bug and review, Guys. Below there are just some cleanup. If you guys think it's better, please respin. On Mon, Sep 07, 2015 at 03:13:10PM +0100, Luis Henriques wrote: > zcomp_create() verifies the success of zcomp_strm_{multi,siggle}_create() > through

Re: [PATCH v2] zram: fix possible use after free in zcomp_create()

2015-09-07 Thread Sergey Senozhatsky
On (09/07/15 15:13), Luis Henriques wrote: > zcomp_create() verifies the success of zcomp_strm_{multi,siggle}_create() > through comp->stream, which can potentially be pointing to memory that was > freed if these functions returned an error. > > Fixes: beca3ec71fe5 ("zram: add multi stream

[PATCH v2] zram: fix possible use after free in zcomp_create()

2015-09-07 Thread Luis Henriques
zcomp_create() verifies the success of zcomp_strm_{multi,siggle}_create() through comp->stream, which can potentially be pointing to memory that was freed if these functions returned an error. Fixes: beca3ec71fe5 ("zram: add multi stream functionality") Cc: sta...@vger.kernel.org Signed-off-by:

[PATCH v2] zram: fix possible use after free in zcomp_create()

2015-09-07 Thread Luis Henriques
zcomp_create() verifies the success of zcomp_strm_{multi,siggle}_create() through comp->stream, which can potentially be pointing to memory that was freed if these functions returned an error. Fixes: beca3ec71fe5 ("zram: add multi stream functionality") Cc: sta...@vger.kernel.org Signed-off-by:

Re: [PATCH v2] zram: fix possible use after free in zcomp_create()

2015-09-07 Thread Sergey Senozhatsky
On (09/07/15 15:13), Luis Henriques wrote: > zcomp_create() verifies the success of zcomp_strm_{multi,siggle}_create() > through comp->stream, which can potentially be pointing to memory that was > freed if these functions returned an error. > > Fixes: beca3ec71fe5 ("zram: add multi stream

Re: [PATCH v2] zram: fix possible use after free in zcomp_create()

2015-09-07 Thread Minchan Kim
On Tue, Sep 08, 2015 at 10:20:38AM +0900, Sergey Senozhatsky wrote: > On (09/08/15 10:07), Minchan Kim wrote: > [..] > > > + int ret; > > > > For the clarification, I want to call it as 'error' instead of ret. > > > > > > > > backend = find_backend(compress); > > > if (!backend) > > > @@

Re: [PATCH v2] zram: fix possible use after free in zcomp_create()

2015-09-07 Thread Minchan Kim
Hello, First of all, Thanks for catching a bug and review, Guys. Below there are just some cleanup. If you guys think it's better, please respin. On Mon, Sep 07, 2015 at 03:13:10PM +0100, Luis Henriques wrote: > zcomp_create() verifies the success of zcomp_strm_{multi,siggle}_create() > through

Re: [PATCH v2] zram: fix possible use after free in zcomp_create()

2015-09-07 Thread Sergey Senozhatsky
On (09/08/15 10:07), Minchan Kim wrote: [..] > > + int ret; > > For the clarification, I want to call it as 'error' instead of ret. > > > > > backend = find_backend(compress); > > if (!backend) > > @@ -347,10 +348,10 @@ struct zcomp *zcomp_create(const char *compress, int > >