Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3df45ee authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Gerrit - the friendly Code Review server
Browse files

fuse: fix bad inode



Jan Kara's analysis of the syzbot report (edited):

The reproducer opens a directory on FUSE filesystem, it then attaches
dnotify mark to the open directory.  After that a fuse_do_getattr() call
finds that attributes returned by the server are inconsistent, and calls
make_bad_inode() which, among other things does:

          inode->i_mode = S_IFREG;

This then confuses dnotify which doesn't tear down its structures
properly and eventually crashes.

Avoid calling make_bad_inode() on a live inode: switch to a private flag on
the fuse inode.  Also add the test to ops which the bad_inode_ops would
have caught.

This change goes back to the initial merge of fuse in 2.6.14...

Change-Id: Iec8f3c66e1ee214e641d71cf01e6f0c2755c3cef
Reported-by: default avatar <syzbot+f427adf9324b92652ccc@syzkaller.appspotmail.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
Tested-by: default avatarJan Kara <jack@suse.cz>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Git-commit: 732251ca
Git-repo: https://android.googlesource.com/kernel/common/


Signed-off-by: default avatarPradeep P V K <pragalla@codeaurora.org>
parent 1ca91eb8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment