mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 23:13:01 +02:00
isofs: Verify inode mode when loading from disk
commit 0a9e740513
upstream.
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>
Link: https://lore.kernel.org/20250709095545.31062-2-jack@suse.cz
Acked-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f366b36c5e
commit
636084f785
|
@ -1491,9 +1491,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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user