Verify that the inode mode is sane when loading it from the disk to avoid complaints from VFS about setting up invalid inodes.
Reported-by: syzbot+895c23f6917da440ed0d@syzkaller.appspotmail.com CC: stable@vger.kernel.org Signed-off-by: Jan Kara jack@suse.cz --- fs/isofs/inode.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
I plan to merge this fix through my tree.
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index d5da9817df9b..33e6a620c103 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -1440,9 +1440,16 @@ static int isofs_read_inode(struct inode *inode, int relocated) inode->i_op = &page_symlink_inode_operations; inode_nohighmem(inode); inode->i_data.a_ops = &isofs_symlink_aops; - } else + } else if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode) || + S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) { /* XXX - parse_rock_ridge_inode() had already set i_rdev. */ init_special_inode(inode, inode->i_mode, inode->i_rdev); + } else { + printk(KERN_DEBUG "ISOFS: Invalid file type 0%04o for inode %lu.\n", + inode->i_mode, inode->i_ino); + ret = -EIO; + goto fail; + }
ret = 0; out:
On Wed, Jul 09, 2025 at 11:55:46AM +0200, Jan Kara wrote:
Verify that the inode mode is sane when loading it from the disk to avoid complaints from VFS about setting up invalid inodes.
Reported-by: syzbot+895c23f6917da440ed0d@syzkaller.appspotmail.com CC: stable@vger.kernel.org Signed-off-by: Jan Kara jack@suse.cz
Thanks! You want me to throw that in vfs.fixes for this week? Acked-by: Christian Brauner brauner@kernel.org
On Thu 10-07-25 13:28:42, Christian Brauner wrote:
On Wed, Jul 09, 2025 at 11:55:46AM +0200, Jan Kara wrote:
Verify that the inode mode is sane when loading it from the disk to avoid complaints from VFS about setting up invalid inodes.
Reported-by: syzbot+895c23f6917da440ed0d@syzkaller.appspotmail.com CC: stable@vger.kernel.org Signed-off-by: Jan Kara jack@suse.cz
Thanks! You want me to throw that in vfs.fixes for this week? Acked-by: Christian Brauner brauner@kernel.org
OK, please go ahead. Thanks!
Honza
On Wed, 09 Jul 2025 11:55:46 +0200, Jan Kara wrote:
Verify that the inode mode is sane when loading it from the disk to avoid complaints from VFS about setting up invalid inodes.
Applied to the vfs.fixes branch of the vfs/vfs.git tree. Patches in the vfs.fixes branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.fixes
[1/1] isofs: Verify inode mode when loading from disk https://git.kernel.org/vfs/vfs/c/0a9e74051313
linux-stable-mirror@lists.linaro.org