Yiwen Jiang f57a22ddec ocfs2: avoid access invalid address when read o2dlm debug messages
The following case will lead to a lockres is freed but is still in use.

cat /sys/kernel/debug/o2dlm/locking_state	dlm_thread
lockres_seq_start
    -> lock dlm->track_lock
    -> get resA
                                                resA->refs decrease to 0,
                                                call dlm_lockres_release,
                                                and wait for "cat" unlock.
Although resA->refs is already set to 0,
increase resA->refs, and then unlock
                                                lock dlm->track_lock
                                                    -> list_del_init()
                                                    -> unlock
                                                    -> free resA

In such a race case, invalid address access may occurs.  So we should
delete list res->tracking before resA->refs decrease to 0.

Signed-off-by: Yiwen Jiang <jiangyiwen@huawei.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-04 16:54:41 -07:00
..
2015-06-30 19:44:57 -07:00
2015-06-23 18:02:01 -04:00
2015-06-23 18:01:59 -04:00
2015-09-03 12:57:48 -07:00
2015-08-07 13:58:05 +02:00
2015-06-25 17:00:42 -07:00
2015-08-16 12:35:44 -07:00
2015-08-13 12:32:04 -06:00
2015-04-21 16:16:02 -04:00
2015-08-13 12:32:04 -06:00
2015-08-13 12:32:04 -06:00
2015-09-04 16:54:41 -07:00
2015-08-11 10:01:24 +02:00
2015-04-11 22:29:40 -04:00
2015-07-09 11:42:21 -07:00
2015-08-13 12:32:04 -06:00
2015-07-23 20:59:40 +02:00
2015-08-12 15:28:45 -05:00
2015-07-23 20:59:40 +02:00
2015-08-13 12:32:04 -06:00
2015-08-04 23:23:50 -04:00