]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: initialize locks earlier in f2fs_fill_super()
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Tue, 8 Nov 2022 22:04:42 +0000 (07:04 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2023 10:28:27 +0000 (11:28 +0100)
commit6c06236981ed923b9d2e81c42dd2b20bc0d3278c
treecc2e91fc47e06b5dc50c3ca1bde95900b370fa64
parent353e2c5e6bb9e179c6abe0de247fda830e03f0bb
f2fs: initialize locks earlier in f2fs_fill_super()

commit 92b4cf5b48955a4bdd15fe4e2067db8ebd87f04c upstream.

syzbot is reporting lockdep warning at f2fs_handle_error() [1], for
spin_lock(&sbi->error_lock) is called before spin_lock_init() is called.
For safe locking in error handling, move initialization of locks (and
obvious structures) in f2fs_fill_super() to immediately after memory
allocation.

Link: https://syzkaller.appspot.com/bug?extid=40642be9b7e0bb28e0df
Reported-by: syzbot <syzbot+40642be9b7e0bb28e0df@syzkaller.appspotmail.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Tested-by: syzbot <syzbot+40642be9b7e0bb28e0df@syzkaller.appspotmail.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/f2fs/super.c