]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.133/hfsplus-stop-workqueue-when-fill_super-failed.patch
Fixes for 5.10
[thirdparty/kernel/stable-queue.git] / releases / 4.4.133 / hfsplus-stop-workqueue-when-fill_super-failed.patch
CommitLineData
10d555a3
GKH
1From 66072c29328717072fd84aaff3e070e3f008ba77 Mon Sep 17 00:00:00 2001
2From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
3Date: Fri, 18 May 2018 16:09:16 -0700
4Subject: hfsplus: stop workqueue when fill_super() failed
5
6From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
7
8commit 66072c29328717072fd84aaff3e070e3f008ba77 upstream.
9
10syzbot is reporting ODEBUG messages at hfsplus_fill_super() [1]. This
11is because hfsplus_fill_super() forgot to call cancel_delayed_work_sync().
12
13As far as I can see, it is hfsplus_mark_mdb_dirty() from
14hfsplus_new_inode() in hfsplus_fill_super() that calls
15queue_delayed_work(). Therefore, I assume that hfsplus_new_inode() does
16not fail if queue_delayed_work() was called, and the out_put_hidden_dir
17label is the appropriate location to call cancel_delayed_work_sync().
18
19[1] https://syzkaller.appspot.com/bug?id=a66f45e96fdbeb76b796bf46eb25ea878c42a6c9
20
21Link: http://lkml.kernel.org/r/964a8b27-cd69-357c-fe78-76b066056201@I-love.SAKURA.ne.jp
22Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
23Reported-by: syzbot <syzbot+4f2e5f086147d543ab03@syzkaller.appspotmail.com>
24Cc: Al Viro <viro@zeniv.linux.org.uk>
25Cc: David Howells <dhowells@redhat.com>
26Cc: Ernesto A. Fernandez <ernesto.mnd.fernandez@gmail.com>
27Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
28Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
29Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
30Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
31
32---
33 fs/hfsplus/super.c | 1 +
34 1 file changed, 1 insertion(+)
35
36--- a/fs/hfsplus/super.c
37+++ b/fs/hfsplus/super.c
38@@ -585,6 +585,7 @@ static int hfsplus_fill_super(struct sup
39 return 0;
40
41 out_put_hidden_dir:
42+ cancel_delayed_work_sync(&sbi->sync_work);
43 iput(sbi->hidden_dir);
44 out_put_root:
45 dput(sb->s_root);