alistair23-linux/fs/ocfs2/dlm
Srinivas Eeda 99b8874e79 o2dlm: fix NULL pointer dereference in o2dlm_blocking_ast_wrapper
A tiny race between BAST and unlock message causes the NULL dereference.

A node sends an unlock request to master and receives a response.  Before
processing the response it receives a BAST from the master.  Since both
requests are processed by different threads it creates a race.  While the
BAST is being processed, lock can get freed by unlock code.

This patch makes bast to return immediately if lock is found but unlock is
pending.  The code should handle this race.  We also have to fix master
node to skip sending BAST after receiving unlock message.

Below is the crash stack

    BUG: unable to handle kernel NULL pointer dereference at 0000000000000048
    IP: o2dlm_blocking_ast_wrapper+0xd/0x16
    dlm_do_local_bast+0x8e/0x97 [ocfs2_dlm]
    dlm_proxy_ast_handler+0x838/0x87e [ocfs2_dlm]
    o2net_process_message+0x395/0x5b8 [ocfs2_nodemanager]
    o2net_rx_until_empty+0x762/0x90d [ocfs2_nodemanager]
    worker_thread+0x14d/0x1ed

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Srinivas Eeda <srinivas.eeda@oracle.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Joseph Qi <joseph.qi@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-10 14:30:30 -08:00
..
dlmapi.h ocfs2/trivial: Remove trailing whitespaces 2010-01-25 19:20:51 -08:00
dlmast.c o2dlm: fix NULL pointer dereference in o2dlm_blocking_ast_wrapper 2015-02-10 14:30:30 -08:00
dlmcommon.h ocfs2/dlm: do not purge lockres that is queued for assert master 2014-06-23 16:47:45 -07:00
dlmconvert.c ocfs2: use list_for_each_entry() instead of list_for_each() 2013-09-11 15:56:36 -07:00
dlmconvert.h
dlmdebug.c ocfs2: fix snprintf format specifier in dlmdebug.c 2015-02-10 14:30:29 -08:00
dlmdebug.h ocfs2/dlm: Cleanup dlmdebug.c 2010-12-22 18:34:44 -08:00
dlmdomain.c ocfs2: dlm: dlmdomain: remove unused function 2015-02-10 14:30:29 -08:00
dlmdomain.h ocfs2: dlm: dlmdomain: remove unused function 2015-02-10 14:30:29 -08:00
dlmlock.c ocfs2: remove NULL assignments on static 2014-06-04 16:53:53 -07:00
dlmmaster.c ocfs2/dlm: fix race between dispatched_work and dlm_lockres_grab_inflight_worker 2014-12-18 19:08:11 -08:00
dlmrecovery.c ocfs2/dlm: add missing dlm_lock_put() when recovery master down 2015-02-10 14:30:28 -08:00
dlmthread.c ocfs2/dlm: do not purge lockres that is queued for assert master 2014-06-23 16:47:45 -07:00
dlmunlock.c ocfs2: fix deadlock when two nodes are converting same lock from PR to EX and idletimeout closes conn 2014-06-23 16:47:45 -07:00
Makefile ocfs2: remove versioning information 2014-01-21 16:19:41 -08:00