WSL2-Linux-Kernel/drivers/block/zram
Luis Henriques 3aaf14da80 zram: fix possible use after free in zcomp_create()
zcomp_create() verifies the success of zcomp_strm_{multi,single}_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: beca3ec71f ("zram: add multi stream functionality")
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-17 21:16:07 -07:00
..
Kconfig zram: remove obsolete ZRAM_DEBUG option 2015-06-25 17:00:35 -07:00
Makefile zram: add lz4 algorithm backend 2014-04-07 16:36:01 -07:00
zcomp.c zram: fix possible use after free in zcomp_create() 2015-09-17 21:16:07 -07:00
zcomp.h zram: check comp algorithm availability earlier 2015-06-25 17:00:37 -07:00
zcomp_lz4.c zram: add lz4 algorithm backend 2014-04-07 16:36:01 -07:00
zcomp_lz4.h zram: add lz4 algorithm backend 2014-04-07 16:36:01 -07:00
zcomp_lzo.c zram: introduce compressing backend abstraction 2014-04-07 16:36:01 -07:00
zcomp_lzo.h zram: introduce compressing backend abstraction 2014-04-07 16:36:01 -07:00
zram_drv.c zram: unify error reporting 2015-09-08 15:35:28 -07:00
zram_drv.h zsmalloc/zram: introduce zs_pool_stats api 2015-09-08 15:35:28 -07:00