lkml.org 
[lkml]   [2015]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] zram: fix possible use after free in zcomp_create()
On Tue, Sep 08, 2015 at 10:39:28AM +0100, 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.
>
> While at it, replace a 'ERR_PTR(-ENOMEM)' by a more generic
> 'ERR_PTR(error)' as in the future zcomp_strm_{multi,siggle}_create() could
> return other error codes. Function documentation updated accordingly.
>
> Fixes: beca3ec71fe5 ("zram: add multi stream functionality")
> Cc: stable@vger.kernel.org
> Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
> Cc: Minchan Kim <minchan@kernel.org>
> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Minchan Kim <minchan@kernel.org>

Thanks for the fix!


\
 
 \ /
  Last update: 2015-09-08 16:01    [W:0.078 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site