kernel-ark/drivers/block/zram
Weijie Yang 5a99e95b8d zram: avoid NULL pointer access in concurrent situation
There is a rare NULL pointer bug in mem_used_total_show() and
mem_used_max_store() in concurrent situation, like this:

zram is not initialized, process A is a mem_used_total reader which runs
periodically, while process B try to init zram.

	process A 				process B
  access meta, get a NULL value
						init zram, done
  init_done() is true
  access meta->mem_pool, get a NULL pointer BUG

This patch fixes this issue.

Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-10-29 16:33:15 -07:00
..
Kconfig zram: add lz4 algorithm backend 2014-04-07 16:36:01 -07:00
Makefile zram: add lz4 algorithm backend 2014-04-07 16:36:01 -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
zcomp.c zram: use scnprintf() in attrs show() methods 2014-04-07 16:36:02 -07:00
zcomp.h zram: propagate error to user 2014-04-07 16:36:02 -07:00
zram_drv.c zram: avoid NULL pointer access in concurrent situation 2014-10-29 16:33:15 -07:00
zram_drv.h zram: report maximum used memory 2014-10-09 22:26:02 -04:00