Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit d8fd96ed authored by Minchan Kim's avatar Minchan Kim Committed by Mark Salyzyn
Browse files

zram: fix race between reset and flushing pending work



(cherry pick from commit da4a04126baa3be03bc566d4a2ee0944c5e783d0)

Dan and Sergey reported that there is a racy between reset and flushing
of pending work so that it could make oops by freeing zram->meta in
reset while zram_slot_free can access zram->meta if new request is
adding during the race window.

This patch moves flush after taking init_lock so it prevents new request
so that it closes the race.

Signed-off-by: default avatarMinchan Kim <minchan@kernel.org>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Jerome Marchand <jmarchan@redhat.com>
Tested-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Bug: 24810447
Change-Id: Ib5fb789b4fb7a5892b934ab10ebeae12fcf7742f
parent a894fedd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment