android_kernel_samsung_a7y1.../fs/ocfs2/dlm
Jia-Ju Bai fa76dd0206 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>
2020-04-07 12:35:35 +02:00
..
dlmapi.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dlmast.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dlmcommon.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dlmconvert.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dlmconvert.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dlmdebug.c fs/ocfs2/dlm/dlmdebug.c: fix a sleep-in-atomic-context bug in dlm_print_one_mle() 2020-04-07 12:35:35 +02:00
dlmdebug.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dlmdomain.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dlmdomain.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dlmlock.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dlmmaster.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dlmrecovery.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dlmthread.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dlmunlock.c ocfs2: wait for recovering done after direct unlock request 2020-04-07 07:55:13 +02:00
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30