Whamcloud - gitweb
LU-14024 ofd: Avoid use after free in ofd_inconsistency_verification_main 22/40222/2
authorOleg Drokin <green@whamcloud.com>
Mon, 12 Oct 2020 20:12:55 +0000 (16:12 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 3 Dec 2020 07:26:11 +0000 (07:26 +0000)
The ofd_inconsistency_lock should not be unlocked after we woken up
a different thread that is going to free the structure containing
said lock.

Change-Id: I913e7470664e1128a250597b0a803f791d99099e
Signed-off-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/40222
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
lustre/ofd/ofd_io.c

index dc5230a..fef5135 100644 (file)
@@ -232,8 +232,8 @@ out_unlocked:
        spin_lock(&ofd->ofd_inconsistency_lock);
 out:
        thread_set_flags(thread, SVC_STOPPED);
-       wake_up_all(&thread->t_ctl_waitq);
        spin_unlock(&ofd->ofd_inconsistency_lock);
+       wake_up_all(&thread->t_ctl_waitq);
        lu_env_fini(&env);
 
        return rc;