[PATCH v3] hfsplus: pretend special inodes as regular files

Tetsuo Handa posted 1 patch 3 weeks, 6 days ago
fs/hfsplus/super.c | 6 ++++++
1 file changed, 6 insertions(+)
[PATCH v3] hfsplus: pretend special inodes as regular files
Posted by Tetsuo Handa 3 weeks, 6 days ago
Since commit af153bb63a33 ("vfs: catch invalid modes in may_open()")
requires any inode be one of S_IFDIR/S_IFLNK/S_IFREG/S_IFCHR/S_IFBLK/
S_IFIFO/S_IFSOCK type, use S_IFREG for special inodes.

Reported-by: syzbot <syzbot+f98189ed18c1f5f32e00@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=f98189ed18c1f5f32e00
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>
---
https://lkml.kernel.org/r/d0a07b1b-8b73-4002-8e29-e2bd56871262@I-love.SAKURA.ne.jp was
a bit too late to append to previous bug report. ;-)

 fs/hfsplus/super.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index aaffa9e060a0..7f327b777ece 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -53,6 +53,12 @@ static int hfsplus_system_read_inode(struct inode *inode)
 		return -EIO;
 	}
 
+	/*
+	 * Assign a dummy file type, for may_open() requires that
+	 * an inode has a valid file type.
+	 */
+	inode->i_mode = S_IFREG;
+
 	return 0;
 }
 
-- 
2.47.3
Re: [PATCH v3] hfsplus: pretend special inodes as regular files
Posted by Christian Brauner 3 weeks, 5 days ago
On Mon, 12 Jan 2026 18:39:23 +0900, Tetsuo Handa wrote:
> Since commit af153bb63a33 ("vfs: catch invalid modes in may_open()")
> requires any inode be one of S_IFDIR/S_IFLNK/S_IFREG/S_IFCHR/S_IFBLK/
> S_IFIFO/S_IFSOCK type, use S_IFREG for special inodes.
> 
> 

Applied to the vfs-7.0.misc branch of the vfs/vfs.git tree.
Patches in the vfs-7.0.misc 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-7.0.misc

[1/1] hfsplus: pretend special inodes as regular files
      https://git.kernel.org/vfs/vfs/c/68186fa198f1
RE: [PATCH v3] hfsplus: pretend special inodes as regular files
Posted by Viacheslav Dubeyko 3 weeks, 4 days ago
On Tue, 2026-01-13 at 09:55 +0100, Christian Brauner wrote:
> On Mon, 12 Jan 2026 18:39:23 +0900, Tetsuo Handa wrote:
> > Since commit af153bb63a33 ("vfs: catch invalid modes in may_open()")
> > requires any inode be one of S_IFDIR/S_IFLNK/S_IFREG/S_IFCHR/S_IFBLK/
> > S_IFIFO/S_IFSOCK type, use S_IFREG for special inodes.
> > 
> > 
> 
> Applied to the vfs-7.0.misc branch of the vfs/vfs.git tree.
> Patches in the vfs-7.0.misc 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-7.0.misc
> 
> [1/1] hfsplus: pretend special inodes as regular files
>       https://git.kernel.org/vfs/vfs/c/68186fa198f1  

I've already taken this patch into HFS/HFS+ tree. :) Should I remove it from the
tree?

Thanks,
Slava.
Re: [PATCH v3] hfsplus: pretend special inodes as regular files
Posted by Christian Brauner 3 weeks, 3 days ago
On Tue, Jan 13, 2026 at 05:18:40PM +0000, Viacheslav Dubeyko wrote:
> On Tue, 2026-01-13 at 09:55 +0100, Christian Brauner wrote:
> > On Mon, 12 Jan 2026 18:39:23 +0900, Tetsuo Handa wrote:
> > > Since commit af153bb63a33 ("vfs: catch invalid modes in may_open()")
> > > requires any inode be one of S_IFDIR/S_IFLNK/S_IFREG/S_IFCHR/S_IFBLK/
> > > S_IFIFO/S_IFSOCK type, use S_IFREG for special inodes.
> > > 
> > > 
> > 
> > Applied to the vfs-7.0.misc branch of the vfs/vfs.git tree.
> > Patches in the vfs-7.0.misc 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-7.0.misc
> > 
> > [1/1] hfsplus: pretend special inodes as regular files
> >       https://git.kernel.org/vfs/vfs/c/68186fa198f1  
> 
> I've already taken this patch into HFS/HFS+ tree. :) Should I remove it from the
> tree?

No, I'll drop it.
Re: [PATCH v3] hfsplus: pretend special inodes as regular files
Posted by Tetsuo Handa 1 week ago
On 2026/01/15 1:05, Christian Brauner wrote:
> On Tue, Jan 13, 2026 at 05:18:40PM +0000, Viacheslav Dubeyko wrote:
>> On Tue, 2026-01-13 at 09:55 +0100, Christian Brauner wrote:
>>> On Mon, 12 Jan 2026 18:39:23 +0900, Tetsuo Handa wrote:
>>>> Since commit af153bb63a33 ("vfs: catch invalid modes in may_open()")
>>>> requires any inode be one of S_IFDIR/S_IFLNK/S_IFREG/S_IFCHR/S_IFBLK/
>>>> S_IFIFO/S_IFSOCK type, use S_IFREG for special inodes.
>>>>
>>>>
>>>
>>> Applied to the vfs-7.0.misc branch of the vfs/vfs.git tree.
>>> Patches in the vfs-7.0.misc 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-7.0.misc
>>>
>>> [1/1] hfsplus: pretend special inodes as regular files
>>>       https://git.kernel.org/vfs/vfs/c/68186fa198f1  
>>
>> I've already taken this patch into HFS/HFS+ tree. :) Should I remove it from the
>> tree?
> 
> No, I'll drop it.

I still can't see this patch in linux-next tree. What is happening?
RE: [PATCH v3] hfsplus: pretend special inodes as regular files
Posted by Viacheslav Dubeyko 5 days, 19 hours ago
On Sun, 2026-02-01 at 13:03 +0900, Tetsuo Handa wrote:
> On 2026/01/15 1:05, Christian Brauner wrote:
> > On Tue, Jan 13, 2026 at 05:18:40PM +0000, Viacheslav Dubeyko wrote:
> > > On Tue, 2026-01-13 at 09:55 +0100, Christian Brauner wrote:
> > > > On Mon, 12 Jan 2026 18:39:23 +0900, Tetsuo Handa wrote:
> > > > > Since commit af153bb63a33 ("vfs: catch invalid modes in may_open()")
> > > > > requires any inode be one of S_IFDIR/S_IFLNK/S_IFREG/S_IFCHR/S_IFBLK/
> > > > > S_IFIFO/S_IFSOCK type, use S_IFREG for special inodes.
> > > > > 
> > > > > 
> > > > 
> > > > Applied to the vfs-7.0.misc branch of the vfs/vfs.git tree.
> > > > Patches in the vfs-7.0.misc 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://urldefense.proofpoint.com/v2/url?u=https-3A__git.kernel.org_pub_scm_linux_kernel_git_vfs_vfs.git&d=DwICaQ&c=BSDicqBQBDjDI9RkVyTcHQ&r=q5bIm4AXMzc8NJu1_RGmnQ2fMWKq4Y4RAkElvUgSs00&m=4NRbS1i9-9rGo2YQj3jgacJN3J0YLl8S54n7yBbDwqmiGP3oIUQw19hl3LIPQpZ6&s=KhalSO4BREq2_wptIzNCJig7a9PlvlvGXkPseGPgLVw&e=   
> > > > branch: vfs-7.0.misc
> > > > 
> > > > [1/1] hfsplus: pretend special inodes as regular files
> > > >       https://urldefense.proofpoint.com/v2/url?u=https-3A__git.kernel.org_vfs_vfs_c_68186fa198f1&d=DwICaQ&c=BSDicqBQBDjDI9RkVyTcHQ&r=q5bIm4AXMzc8NJu1_RGmnQ2fMWKq4Y4RAkElvUgSs00&m=4NRbS1i9-9rGo2YQj3jgacJN3J0YLl8S54n7yBbDwqmiGP3oIUQw19hl3LIPQpZ6&s=LBFhNyXC75hnVp8aKpJjQ9UF-_q8AIfbeoi7Caj4z-c&e=   
> > > 
> > > I've already taken this patch into HFS/HFS+ tree. :) Should I remove it from the
> > > tree?
> > 
> > No, I'll drop it.
> 
> I still can't see this patch in linux-next tree. What is happening?

The patch in HFS/HFS+ tree. I will send it in pull request for 6.20-rc1.

Thanks,
Slava.
Re: [PATCH v3] hfsplus: pretend special inodes as regular files
Posted by Tetsuo Handa 5 days, 15 hours ago
On 2026/02/03 2:30, Viacheslav Dubeyko wrote:
>>>> I've already taken this patch into HFS/HFS+ tree. :) Should I remove it from the
>>>> tree?
>>>
>>> No, I'll drop it.
>>
>> I still can't see this patch in linux-next tree. What is happening?
> 
> The patch in HFS/HFS+ tree. I will send it in pull request for 6.20-rc1.
> 

Patches are expected to be tested in the linux-next tree
before sending a pull request for the linux tree.