diff options
author | Chengfeng Ye <[email protected]> | 2023-08-02 12:38:24 +0000 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2023-08-18 10:18:59 -0700 |
commit | 28a45ef85e25ed05fb5d8846ec01f752618dad44 (patch) | |
tree | 8d8d002a809792b3c6947f6934c5b4c9cbce8f5a /lib/test_fortify/write_overflow-memcpy.c | |
parent | fb40b0537342e1acd5c2daf2ff6780c1d0d2883c (diff) |
ocfs2: cluster: fix potential deadlock on &qs->qs_lock
&qs->qs_lock is acquired by timer o2net_idle_timer() along the following
call chain. Thus the acquisition of the lock under process context should
disable bottom half, otherwise deadlock could happen if the timer happens
to preempt the execution while the lock is held in process context on the
same CPU.
<timer interrupt>
-> o2net_idle_timer()
-> o2quo_conn_err()
-> spin_lock(&qs->qs_lock)
Several lock acquisition of &qs->qs_lock under process contex do not
disable irq or bottom half. The patch fixes these potential deadlocks
scenerio by using spin_lock_bh() on &qs->qs_lock.
This flaw was found by an experimental static analysis tool I am
developing for irq-related deadlock. x86_64 allmodconfig using gcc shows
no new warning.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Chengfeng Ye <[email protected]>
Cc: Mark Fasheh <[email protected]>
Cc: Joel Becker <[email protected]>
Cc: Junxiao Bi <[email protected]>
Cc: Joseph Qi <[email protected]>
Cc: Gang He <[email protected]>
Cc: Jun Piao <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-memcpy.c')
0 files changed, 0 insertions, 0 deletions