linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] isofs: Verify inode mode when loading from disk
@ 2025-07-09  9:55 Jan Kara
  2025-07-10 11:28 ` Christian Brauner
  2025-07-11  9:39 ` Christian Brauner
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Kara @ 2025-07-09  9:55 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Jan Kara, syzbot+895c23f6917da440ed0d, stable

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:
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] isofs: Verify inode mode when loading from disk
  2025-07-09  9:55 [PATCH] isofs: Verify inode mode when loading from disk Jan Kara
@ 2025-07-10 11:28 ` Christian Brauner
  2025-07-10 13:19   ` Jan Kara
  2025-07-11  9:39 ` Christian Brauner
  1 sibling, 1 reply; 4+ messages in thread
From: Christian Brauner @ 2025-07-10 11:28 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-fsdevel, syzbot+895c23f6917da440ed0d, stable

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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] isofs: Verify inode mode when loading from disk
  2025-07-10 11:28 ` Christian Brauner
@ 2025-07-10 13:19   ` Jan Kara
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Kara @ 2025-07-10 13:19 UTC (permalink / raw)
  To: Christian Brauner
  Cc: Jan Kara, linux-fsdevel, syzbot+895c23f6917da440ed0d, stable

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
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] isofs: Verify inode mode when loading from disk
  2025-07-09  9:55 [PATCH] isofs: Verify inode mode when loading from disk Jan Kara
  2025-07-10 11:28 ` Christian Brauner
@ 2025-07-11  9:39 ` Christian Brauner
  1 sibling, 0 replies; 4+ messages in thread
From: Christian Brauner @ 2025-07-11  9:39 UTC (permalink / raw)
  To: linux-fsdevel, Jan Kara
  Cc: Christian Brauner, syzbot+895c23f6917da440ed0d, stable

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-07-11  9:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-09  9:55 [PATCH] isofs: Verify inode mode when loading from disk Jan Kara
2025-07-10 11:28 ` Christian Brauner
2025-07-10 13:19   ` Jan Kara
2025-07-11  9:39 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).