From nobody Sun Feb 8 08:22:37 2026 Received: from mail-oo1-f80.google.com (mail-oo1-f80.google.com [209.85.161.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 371D92459E5 for ; Mon, 12 Jan 2026 09:31:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.80 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768210283; cv=none; b=VZBKkge6XMzBmwejpFjlJtzseIogn+FzckA9TZGhw6BWFU5eFac2gRD5438o4/WSvNYSBfbf6+zAFiHv+da015P7Z8/gh9e82B8jMwmenLY5mQIvgCMoT1lrvbuCxd4DsYhqBNRFbahKacsq57FSePOA0qYXNEFwjBCIa1IEwR4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768210283; c=relaxed/simple; bh=3yCmLcOQr65HkWQssW744/JUREgzZWJn2av8jaBtdtM=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=ZdVz9G4Lz3pReIMe0KWD6Wiw/1Or46Zj1POp++gGSmtoRfVkkFt9CcPol7LSUMYUaWTqS5UI9q9yBX0aLIVt/Cw3AE42vEAvK6xYVXDUE99ssvT6bIGLjJQR1mbK4eMec1PDN3T3hUPXxVhHbVhWUdcxT+RCGx730V7fRTGOi2g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f80.google.com with SMTP id 006d021491bc7-65f66b8be64so8784239eaf.3 for ; Mon, 12 Jan 2026 01:31:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768210281; x=1768815081; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w85KmEj8haiv79DgAUyw6nYrpaueIiLpPUgfLB7ajyw=; b=N428/jGHcWolePyBcitYG4WEqXkEr/S1RJV45atigNCRDhl3bmwksENV72MWhH1v3Y sFaqrXs0ekbbjpaUF13lyQeNKNXWZTSgqCW2gXiibfbh86RQfMKGF7hFEhqCoijogj4P Il5mecG3vFv9si7/zrfRKVoc3L0qeLMA/yoLVQimG/G+XOZifijKif5SpFoRRPod9rJl aTLWXGRRzzUEHhb34ayuWe27sN+1NQPa7IYshRC0H5EfvDMjLelvhczmzaQjaslPYnfi 7m/JXL31OBj1KixDrSq6CE3iIHcp43+z35t2du51Y4S2QkBVOXLtGv0d+az36vfyF5JC ji8w== X-Gm-Message-State: AOJu0YzlrFvGDuV7u6k7IGzmJfgfqxU5if+nTUezl1F7bTmzADtotKOW Jyeu31ynWDUhxbhiLfqY8gD4JwOHECJif6MzX0A6fr/LSVsCzqkHzFjs90Ae375Uy1x+z02c3P2 yeaxWLyjDKpdAJ1tgHTYplwnji21dVDVvuUS4w+vE421tExIxhNPyScbh8f2usQ== X-Google-Smtp-Source: AGHT+IFcdbeAEuj8ukBOyJ+iyvu24WQ4mhEOFYH4/fc7vNVZezoOhOTExpdzPX7NKvm/EvkificlUWpy/7/nF/thAavmtnAjrjFM Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:530c:b0:65d:2a0:4b5c with SMTP id 006d021491bc7-65f54eeb045mr5772683eaf.15.1768210281263; Mon, 12 Jan 2026 01:31:21 -0800 (PST) Date: Mon, 12 Jan 2026 01:31:21 -0800 In-Reply-To: <6964b615.050a0220.eaf7.0093.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6964bf69.050a0220.eaf7.0096.GAE@google.com> Subject: Forwarded: Private message regarding: [syzbot] [hfs?] kernel BUG in may_open (3) From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: Private message regarding: [syzbot] [hfs?] kernel BUG in may_open = (3) Author: kapoorarnav43@gmail.com #syz test From: Arnav Kapoor Date: Sun, 12 Jan 2026 14:36:00 +0000 Subject: [PATCH] hfsplus: ensure valid file mode in hfsplus_get_perms Syzbot reported a kernel BUG in may_open() triggered by: VFS_BUG_ON_INODE(!IS_ANON_FILE(inode), inode) This occurs when an inode's i_mode doesn't match any standard file type (S_IFREG, S_IFDIR, S_IFLNK, S_IFBLK, S_IFCHR, S_IFIFO, S_IFSOCK). The crash happens when opening a file on a corrupted HFS+ filesystem where the on-disk permissions structure has only file type bits set without any permission bits. In hfsplus_get_perms(), for directories, the code properly masks and rebuilds the mode: mode =3D (mode & S_IALLUGO) | S_IFDIR However, for files with non-zero mode from disk, it directly assigns the validated mode without ensuring permission bits are present. If the on-disk mode is something like S_IFREG (0x8000) with no permission bits, the inode ends up with i_mode lacking rwx bits entirely. While such a mode passes the S_IFMT validation in the switch statement, it creates an inode that can't be properly opened since it has no access permissions. Fix this by adding a check in the file path: if mode is non-zero and valid but lacks any permission/attribute bits (S_IALLUGO mask), add default read/write permissions like we do for the mode=3D=3D0 case. This ensures inodes always have sensible permission bits even when reading from corrupted filesystems. Reported-by: syzbot+f98189ed18c1f5f32e00@syzkaller.appspotmail.com Tested-by: syzbot+f98189ed18c1f5f32e00@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=3Df98189ed18c1f5f32e00 Signed-off-by: Arnav Kapoor Reported-by: syzbot+f98189...@syzkaller.appspotmail.com=20 --- fs/hfsplus/inode.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index 000000000000..111111111111 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c @@ -214,10 +214,18 @@ static int hfsplus_get_perms(struct inode *inode, inode->i_gid =3D sbi->gid; if (dir) { + /* For directories, strip file type bits and rebuild */ mode =3D mode ? (mode & S_IALLUGO) : (S_IRWXUGO & ~(sbi->umask)); mode |=3D S_IFDIR; - } else if (!mode) + } else if (!mode) { + /* For files with no mode, use default */ mode =3D S_IFREG | ((S_IRUGO|S_IWUGO) & ~(sbi->umask)); + } else { + /* For files with mode, ensure we have permission bits */ + if (!(mode & S_IALLUGO)) + mode |=3D (S_IRUGO|S_IWUGO) & ~(sbi->umask); + } + inode->i_mode =3D mode; HFSPLUS_I(inode)->userflags =3D perms->userflags; --=20 2.43.0 On Monday, 12 January 2026 at 14:21:35 UTC+5:30 syzbot wrote: Hello,=20 syzbot found the following issue on:=20 HEAD commit: b6151c4e60e5 Merge tag 'erofs-for-6.19-rc5-fixes' of git:/..=20 git tree: upstream=20 console output: https://syzkaller.appspot.com/x/log.txt?x=3D15d45922580000=20 kernel config: https://syzkaller.appspot.com/x/.config?x=3D7b058fb1d7dbe6b1=20 dashboard link: https://syzkaller.appspot.com/bug?extid=3Df98189ed18c1f5f32= e00=20 compiler: Debian clang version 20.1.8=20 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD=20 20.1.8=20 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=3D14a7d19a580000=20 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=3D16a2f19a580000=20 Downloadable assets:=20 disk image:=20 https://storage.googleapis.com/syzbot-assets/6eb5179ada01/disk-b6151c4e.raw= .xz=20 vmlinux:=20 https://storage.googleapis.com/syzbot-assets/bc48d1a68ed0/vmlinux-b6151c4e.= xz=20 kernel image:=20 https://storage.googleapis.com/syzbot-assets/061d4fb696a7/bzImage-b6151c4e.= xz=20 mounted in repro:=20 https://storage.googleapis.com/syzbot-assets/df739de73585/mount_0.gz=20 IMPORTANT: if you fix the issue, please add the following tag to the=20 commit:=20 Reported-by: syzbot+f98189...@syzkaller.appspotmail.com=20 loop0: detected capacity change from 0 to 1024=20 VFS_BUG_ON_INODE(!IS_ANON_FILE(inode)) encountered for inode=20 ffff8880384b01e0=20 fs hfsplus mode 0 opflags 0x4 flags 0x0 state 0x70 count 2=20 ------------[ cut here ]------------=20 kernel BUG at fs/namei.c:4210!=20 Oops: invalid opcode: 0000 [#1] SMP KASAN PTI=20 CPU: 1 UID: 0 PID: 6062 Comm: syz.0.17 Not tainted syzkaller #0=20 PREEMPT_{RT,(full)}=20 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS=20 Google 10/25/2025=20 RIP: 0010:may_open+0x4b1/0x4c0 fs/namei.c:4210=20 Code: 38 c1 0f 8c 1e fd ff ff 4c 89 e7 e8 c9 ec ef ff e9 11 fd ff ff e8 df=20 b3 8d ff 4c 89 f7 48 c7 c6 80 53 f9 8a e8 10 eb f5 fe 90 <0f> 0b 66 66 66=20 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90=20 RSP: 0018:ffffc90003ba78e0 EFLAGS: 00010282=20 RAX: 0000000000000088 RBX: dffffc0000000000 RCX: b41eda36b1e3ff00=20 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000=20 RBP: 0000000000008241 R08: 0000000000000000 R09: 0000000000000000=20 R10: dffffc0000000000 R11: fffff52000774ec1 R12: 0000000000000000=20 R13: ffffffff8d709d80 R14: ffff8880384b01e0 R15: 0000000000000002=20 FS: 000055557d7cd500(0000) GS:ffff888126def000(0000) knlGS:0000000000000000=20 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033=20 CR2: 00007f01916a5890 CR3: 0000000040598000 CR4: 00000000003526f0=20 Call Trace:=20 =20 do_open fs/namei.c:4635 [inline]=20 path_openat+0x32a8/0x3df0 fs/namei.c:4796=20 do_filp_open+0x1fa/0x410 fs/namei.c:4823=20 do_sys_openat2+0x121/0x200 fs/open.c:1430=20 do_sys_open fs/open.c:1436 [inline]=20 __do_sys_creat fs/open.c:1514 [inline]=20 __se_sys_creat fs/open.c:1508 [inline]=20 __x64_sys_creat+0x8f/0xc0 fs/open.c:1508=20 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]=20 do_syscall_64+0xec/0xf80 arch/x86/entry/syscall_64.c:94=20 entry_SYSCALL_64_after_hwframe+0x77/0x7f=20 RIP: 0033:0x7f739c0cf749=20 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7=20 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff=20 ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48=20 RSP: 002b:00007ffd4aa21ce8 EFLAGS: 00000246 ORIG_RAX: 0000000000000055=20 RAX: ffffffffffffffda RBX: 00007f739c325fa0 RCX: 00007f739c0cf749=20 RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000200000000140=20 RBP: 00007f739c153f91 R08: 0000000000000000 R09: 0000000000000000=20 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000=20 R13: 00007f739c325fa0 R14: 00007f739c325fa0 R15: 0000000000000002=20 =20 Modules linked in:=20 ---[ end trace 0000000000000000 ]---=20 RIP: 0010:may_open+0x4b1/0x4c0 fs/namei.c:4210=20 Code: 38 c1 0f 8c 1e fd ff ff 4c 89 e7 e8 c9 ec ef ff e9 11 fd ff ff e8 df=20 b3 8d ff 4c 89 f7 48 c7 c6 80 53 f9 8a e8 10 eb f5 fe 90 <0f> 0b 66 66 66=20 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90=20 RSP: 0018:ffffc90003ba78e0 EFLAGS: 00010282=20 RAX: 0000000000000088 RBX: dffffc0000000000 RCX: b41eda36b1e3ff00=20 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000=20 RBP: 0000000000008241 R08: 0000000000000000 R09: 0000000000000000=20 R10: dffffc0000000000 R11: fffff52000774ec1 R12: 0000000000000000=20 R13: ffffffff8d709d80 R14: ffff8880384b01e0 R15: 0000000000000002=20 FS: 000055557d7cd500(0000) GS:ffff888126def000(0000) knlGS:0000000000000000=20 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033=20 CR2: 00007f01916a5890 CR3: 0000000040598000 CR4: 00000000003526f0=20 ---=20 This report is generated by a bot. It may contain errors.=20 See https://goo.gl/tpsmEJ for more information about syzbot.=20 syzbot engineers can be reached at syzk...@googlegroups.com.=20 syzbot will keep track of this issue. See:=20 https://goo.gl/tpsmEJ#status for how to communicate with syzbot.=20 If the report is already addressed, let syzbot know by replying with:=20 #syz fix: exact-commit-title=20 If you want syzbot to run the reproducer, reply with:=20 #syz test: git://repo/address.git branch-or-commit-hash=20 If you attach or paste a git patch, syzbot will apply it before testing.=20 If you want to overwrite report's subsystems, reply with:=20 #syz set subsystems: new-subsystem=20 (See the list of subsystem names on the web dashboard)=20 If the report is a duplicate of another one, reply with:=20 #syz dup: exact-subject-of-another-report=20 If you want to undo deduplication, reply with:=20 #syz undup