]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gfs2: fix double destroy_workqueue error
authorJulian Sun <sunjunchao2870@gmail.com>
Tue, 20 Aug 2024 03:31:48 +0000 (11:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2024 10:04:01 +0000 (12:04 +0200)
commita5336035728d77efd76306940d742a6f23debe68
tree381bb290bfa4e5808bc5ce46b09392ec9a379021
parent7afb5e3aa989c479979faeb18768a67889a7a9c6
gfs2: fix double destroy_workqueue error

commit 6cb9df81a2c462b89d2f9611009ab43ae8717841 upstream.

When gfs2_fill_super() fails, destroy_workqueue() is called within
gfs2_gl_hash_clear(), and the subsequent code path calls
destroy_workqueue() on the same work queue again.

This issue can be fixed by setting the work queue pointer to NULL after
the first destroy_workqueue() call and checking for a NULL pointer
before attempting to destroy the work queue again.

Reported-by: syzbot+d34c2a269ed512c531b0@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=d34c2a269ed512c531b0
Fixes: 30e388d57367 ("gfs2: Switch to a per-filesystem glock workqueue")
Cc: stable@vger.kernel.org
Signed-off-by: Julian Sun <sunjunchao2870@gmail.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/gfs2/glock.c
fs/gfs2/ops_fstype.c