kernel-fxtec-pro1x/fs/ocfs2/dlm
Jia-Ju Bai bcba80f38a fs/ocfs2/dlm/dlmdebug.c: fix a sleep-in-atomic-context bug in dlm_print_one_mle()
[ Upstream commit 999865764f5f128896402572b439269acb471022 ]

The kernel module may sleep with holding a spinlock.

The function call paths (from bottom to top) in Linux-4.16 are:

[FUNC] get_zeroed_page(GFP_NOFS)
fs/ocfs2/dlm/dlmdebug.c, 332: get_zeroed_page in dlm_print_one_mle
fs/ocfs2/dlm/dlmmaster.c, 240: dlm_print_one_mle in __dlm_put_mle
fs/ocfs2/dlm/dlmmaster.c, 255: __dlm_put_mle in dlm_put_mle
fs/ocfs2/dlm/dlmmaster.c, 254: spin_lock in dlm_put_ml

[FUNC] get_zeroed_page(GFP_NOFS)
fs/ocfs2/dlm/dlmdebug.c, 332: get_zeroed_page in dlm_print_one_mle
fs/ocfs2/dlm/dlmmaster.c, 240: dlm_print_one_mle in __dlm_put_mle
fs/ocfs2/dlm/dlmmaster.c, 222: __dlm_put_mle in dlm_put_mle_inuse
fs/ocfs2/dlm/dlmmaster.c, 219: spin_lock in dlm_put_mle_inuse

To fix this bug, GFP_NOFS is replaced with GFP_ATOMIC.

This bug is found by my static analysis tool DSAC.

Link: http://lkml.kernel.org/r/20180901112528.27025-1-baijiaju1990@gmail.com
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Joseph Qi <jiangqi903@gmail.com>
Cc: Changwei Ge <ge.changwei@h3c.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-01 09:17:02 +01:00
..
dlmapi.h
dlmast.c ocfs2/dlm: clean up unused stack variable in dlm_do_local_ast() 2018-04-05 21:36:22 -07:00
dlmcommon.h ocfs2/dlm: wait for dlm recovery done when migrating all lock resources 2018-04-05 21:36:22 -07:00
dlmconvert.c ocfs2/dlm: fix race between convert and migration 2016-09-19 15:36:16 -07:00
dlmconvert.h
dlmdebug.c fs/ocfs2/dlm/dlmdebug.c: fix a sleep-in-atomic-context bug in dlm_print_one_mle() 2019-12-01 09:17:02 +01:00
dlmdebug.h
dlmdomain.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
dlmdomain.h ocfs2/dlm: don't handle migrate lockres if already in shutdown 2018-04-05 21:36:22 -07:00
dlmlock.c ocfs2: remove unnecessary null pointer check before kmem_cache_destroy() 2018-04-05 21:36:22 -07:00
dlmmaster.c ocfs2: fix locking for res->tracking and dlm->tracking_list 2018-10-05 16:32:05 -07:00
dlmrecovery.c ocfs2/dlm: clean up unused variable in dlm_process_recovery_data 2018-04-05 21:36:22 -07:00
dlmthread.c ocfs2/dlm: continue to purge recovery lockres when recovery master goes down 2016-08-02 17:31:41 -04:00
dlmunlock.c ocfs2: wait for recovering done after direct unlock request 2019-10-07 18:57:16 +02:00
Makefile ocfs2: improve ocfs2 Makefile 2019-02-12 19:47:18 +01:00