linux-sg2042/drivers/block/zram
Jerome Marchand 17ec4cd985 zram: don't call idr_remove() from zram_remove()
The use of idr_remove() is forbidden in the callback functions of
idr_for_each().  It is therefore unsafe to call idr_remove in
zram_remove().

This patch moves the call to idr_remove() from zram_remove() to
hot_remove_store().  In the detroy_devices() path, idrs are removed by
idr_destroy().  This solves an use-after-free detected by KASan.

[akpm@linux-foundation.org: fix coding stype, per Sergey]
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: <stable@vger.kernel.org>	[4.2+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-01-15 17:56:32 -08: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: pass gfp from zcomp frontend to backend 2016-01-15 11:40:51 -08:00
zcomp.h zram: pass gfp from zcomp frontend to backend 2016-01-15 11:40:51 -08:00
zcomp_lz4.c zram/zcomp: do not zero out zcomp private pages 2016-01-15 11:40:52 -08:00
zcomp_lz4.h zram: add lz4 algorithm backend 2014-04-07 16:36:01 -07:00
zcomp_lzo.c zram/zcomp: do not zero out zcomp private pages 2016-01-15 11:40:52 -08:00
zcomp_lzo.h zram: introduce compressing backend abstraction 2014-04-07 16:36:01 -07:00
zram_drv.c zram: don't call idr_remove() from zram_remove() 2016-01-15 17:56:32 -08:00
zram_drv.h zsmalloc/zram: introduce zs_pool_stats api 2015-09-08 15:35:28 -07:00