From 1123bbd3fc4d5abeb111ddc6bd762d1fb2c1ce82 Mon Sep 17 00:00:00 2001 From: Oleg Drokin Date: Mon, 12 Oct 2020 16:12:55 -0400 Subject: [PATCH] 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 --- lustre/ofd/ofd_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 1.8.3.1