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.12.7-RC1~62 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F81%2F40881%2F3;p=fs%2Flustre-release.git 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. Lustre-commit: 1123bbd3fc4d5abeb111ddc6bd762d1fb2c1ce82 Lustre-change: https://review.whamcloud.com/40222 Change-Id: I913e7470664e1128a250597b0a803f791d99099e Signed-off-by: Oleg Drokin Reviewed-on: https://review.whamcloud.com/40881 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- diff --git a/lustre/ofd/ofd_io.c b/lustre/ofd/ofd_io.c index 3f620a0..6bfe08a 100644 --- a/lustre/ofd/ofd_io.c +++ b/lustre/ofd/ofd_io.c @@ -234,8 +234,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;