Re: [PATCH 2/2] zram: avoid NULL pointer access when reading mem_used_total

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Oct 25, 2014 at 05:26:31PM +0800, Weijie Yang wrote:
> There is a rare NULL pointer bug in mem_used_total_show() in concurrent
> situation, like this:
> zram is not initialized, process A is a mem_used_total reader which runs
> periodicity, 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@xxxxxxxxxxx>
Acked-by: Minchan Kim <minchan@xxxxxxxxxx>

Thanks!

-- 
Kind regards,
Minchan Kim

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]