Re: [PATCH] VFS: check i_nlink count before trying to unlink
From: Al Viro
Date: Sat Sep 07 2024 - 15:02:48 EST
On Sat, Sep 07, 2024 at 10:51:10PM +0530, Ghanshyam Agrawal wrote:
> Reported-by: syzbot+41b43444de86db4c5ed1@xxxxxxxxxxxxxxxxxxxxxxxxx
> Closes: https://syzkaller.appspot.com/bug?extid=41b43444de86db4c5ed1
> Signed-off-by: Ghanshyam Agrawal <ghanshyam1898@xxxxxxxxx>
As far as I can tell, you have jfs_unlink() find and remove a directory
entry without any problems, then find that the damn thing had corrupted
inode link count (presumably due to creatively fucked up image).
IF that's the case, NAK.
vfs_unlink() is *NOT* the place to try and cope with that kind of crap.
What's more, having unlink(2) quietly succeed and do nothing to directory
is simply wrong.