From: Oleg Drokin Date: Mon, 12 Oct 2020 20:12:55 +0000 (-0400) Subject: LU-14024 ofd: Avoid use after free in ofd_inconsistency_verification_main X-Git-Tag: 2.13.57~34 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=1123bbd3fc4d5abeb111ddc6bd762d1fb2c1ce82 LU-14024 ofd: Avoid use after free in ofd_inconsistency_verification_main 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 Reviewed-on: https://review.whamcloud.com/40222 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond --- diff --git a/lustre/ofd/ofd_io.c b/lustre/ofd/ofd_io.c index dc5230a..fef5135 100644 --- a/lustre/ofd/ofd_io.c +++ b/lustre/ofd/ofd_io.c @@ -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;