Commit 81edb983 authored by Leo Stone's avatar Leo Stone Committed by Jaegeuk Kim
Browse files

f2fs: add check for deleted inode



The syzbot reproducer mounts a f2fs image, then tries to unlink an
existing file. However, the unlinked file already has a link count of 0
when it is read for the first time in do_read_inode().

Add a check to sanity_check_inode() for i_nlink == 0.

[Chao Yu: rebase the code and fix orphan inode recovery issue]
Reported-by: default avatar <syzbot+b01a36acd7007e273a83@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=b01a36acd7007e273a83


Fixes: 39a53e0c ("f2fs: add superblock and major in-memory structure")
Signed-off-by: default avatarLeo Stone <leocstone@gmail.com>
Signed-off-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 201e07ae
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment