BUG: unable to handle kernel paging request in squashfs_lookup

Status: moderation: reported on 2026/11/23 21:20
Subsystems: squashfs
Labels: prio:low
[Documentation on labels]
Reported-by: syzbot+baf3612d9a25ed5ba06d@syzkaller.appspotmail.com
First crash: 5h16m, last: 1h36m
✨ AI cause bisection: introduced by (AI job) :
commit 5b515c0ec855811ab62985033c44dde99c15f326
Author: Phillip Lougher <phillip@squashfs.org.uk>
Date: Mon Nov 23 03:42:49 2026 +0000

  Squashfs: don't compute start or alloc memory on empty directory or index

✨ AI-generated root cause summary:

In squashfs_lookup() (fs/squashfs/namei.c), the local pointer struct inode *inode is initialized to NULL and immediately passed to squashfs_i(inode)->start and squashfs_i(inode)->offset in a TRACE() (pr_debug()) call instead of the directory parameter dir. Because squashfs_i() uses container_of(..., struct squashfs_inode_info, vfs_inode) where vfs_inode is at offset 0x40 (64 bytes), squashfs_i(NULL) evaluates to 0xffffffffffffffc0. When dynamic debug (CONFIG_DYNAMIC_DEBUG) is enabled for this call site (or DEBUG is defined), any SquashFS directory lookup dereferences 0xffffffffffffffc0 and triggers a fatal kernel read page fault.

▶ ▼ ✨ Full AI root cause analysis
Based on kernel commit 3191063649db:

Root Cause Analysis

The crash is caused by a NULL pointer dereference via container_of() in squashfs_lookup() (fs/squashfs/namei.c:180-181).

Mechanism

In squashfs_lookup() (fs/squashfs/namei.c:166-181):

static struct dentry *squashfs_lookup(struct inode *dir, struct dentry *dentry,
				      unsigned int flags)
{
	...
	struct inode *inode = NULL;
	...
	TRACE("Entered squashfs_lookup [%llx:%x]\n", squashfs_i(inode)->start,
			squashfs_i(inode)->offset);
  1. Wrong variable passed to TRACE(): The local variable inode is initialized to NULL (it is only populated later on line 271 via squashfs_iget() when a matching directory entry is found). The TRACE() macro at lines 180–181 erroneously passes inode to squashfs_i() instead of the directory inode parameter dir (unlike lines 190, 200, and 285, which correctly use squashfs_i(dir)).
  2. container_of(NULL, ...) arithmetic: squashfs_i() (fs/squashfs/squashfs_fs_i.h:37-40) computes container_of(inode, struct squashfs_inode_info, vfs_inode). In struct squashfs_inode_info (fs/squashfs/squashfs_fs_i.h:13-34), vfs_inode is at byte offset 64 (0x40), and start is at byte offset 0. Passing inode == NULL yields (struct squashfs_inode_info *)((char *)0 - 0x40) = 0xffffffffffffffc0.
  3. Trigger condition: TRACE() expands to pr_debug(...) (fs/squashfs/squashfs.h:11). With CONFIG_DYNAMIC_DEBUG=y enabled and the dynamic debug call site activated (or if compiled with DEBUG), entering squashfs_lookup() during path lookup (e.g., openat() -> lookup_open() -> squashfs_lookup()) evaluates squashfs_i(inode)->start, reading from the unmapped address 0xffffffffffffffc0 (mov 0xffffffffffffffc0,%r14) and causing a supervisor read page fault.

Fix

Pass dir instead of inode to squashfs_i() in TRACE() at fs/squashfs/namei.c:180-181:

	TRACE("Entered squashfs_lookup [%llx:%x]\n", squashfs_i(dir)->start,
			squashfs_i(dir)->offset);
▶ ▼ ✨ AI Jobs (2)
ID Workflow Result Correct Bug Created Started Finished Revision
ce9f921f bisect-cause IsRelease: ❌ ❓ BUG: unable to handle kernel paging request in squashfs_lookup 2026/11/23 20:44 2026/11/23 20:44 2026/11/23 21:13 fab64d89
905588e3 assessment-security DenialOfService: ✅ Exploitable: ❌ FilesystemTrigger: ❌ FuzzingArtifact: ❌ MemoryCorruption: ❌ NetworkNeedsSetup: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ❌ UserNamespace: ❌ VMGuestTrigger: ❌ VMHostTrigger: ❌ ❓ BUG: unable to handle kernel paging request in squashfs_lookup 2026/11/23 20:44 2026/11/23 20:44 2026/11/23 21:19 fab64d89

Sample crash report:
loop9: detected capacity change from 0 to 8
BUG: unable to handle page fault for address: ffffffffffffffc0
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 1014b067 P4D 1014b067 PUD 1014d067 PMD 0 
Oops: Oops: 0000 [#1] SMP KASAN PTI
CPU: 0 UID: 0 PID: 20296 Comm: syz.9.2493 Tainted: G             L      syzkaller #0 PREEMPT(full) 
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
RIP: 0010:squashfs_lookup+0x1342/0x14a0 fs/squashfs/namei.c:180
Code: e8 33 72 89 ff e9 7a f8 ff ff 4d 89 f4 48 b8 f8 ff ff ff ff ff ff 1f 41 80 3c 07 00 74 0c 48 c7 c7 c0 ff ff ff e8 ae 71 89 ff <4c> 8b 34 25 c0 ff ff ff 48 b8 f9 ff ff ff ff ff ff 1f 48 b9 00 00
RSP: 0018:ffffc900038f77e0 EFLAGS: 00010246
RAX: 1ffffffffffffff8 RBX: ffff88807b5b4c00 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffc900038f791c
RBP: ffffc900038f79b0 R08: 0000000000000003 R09: 0000000000000000
R10: ffffc900038f7910 R11: fffff5200071ef23 R12: ffff888076cfe680
R13: 1ffff9200071ef18 R14: ffff888076cfe680 R15: dffffc0000000000
FS:  00007fe75611e6c0(0000) GS:ffff8881231b3000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffc0 CR3: 000000005f98e000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 finish_lookup fs/namei.c:1935 [inline]
 lookup_open+0x816/0x16e0 fs/namei.c:4648
 open_last_lookups fs/namei.c:4884 [inline]
 path_openat+0x7a5/0x20e0 fs/namei.c:5123
 do_file_open+0x23e/0x4a0 fs/namei.c:5155
 do_sys_openat2+0x115/0x200 fs/open.c:1496
 do_sys_open fs/open.c:1502 [inline]
 __do_sys_openat fs/open.c:1842 [inline]
 __se_sys_openat fs/open.c:1837 [inline]
 __x64_sys_openat+0x138/0x170 fs/open.c:1837
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x00007fe7551a9519
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fe75611e028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007fe755435fa0 RCX: 00007fe7551a9519
RDX: 0000000000000000 RSI: 0000200000000800 RDI: ffffffffffffff9c
RBP: 00007fe755239136 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000008 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fe755436038 R14: 00007fe755435fa0 R15: 00007ffc94021e58
 </TASK>
Modules linked in:
CR2: ffffffffffffffc0
---[ end trace 0000000000000000 ]---
RIP: 0010:squashfs_lookup+0x1342/0x14a0 fs/squashfs/namei.c:180
Code: e8 33 72 89 ff e9 7a f8 ff ff 4d 89 f4 48 b8 f8 ff ff ff ff ff ff 1f 41 80 3c 07 00 74 0c 48 c7 c7 c0 ff ff ff e8 ae 71 89 ff <4c> 8b 34 25 c0 ff ff ff 48 b8 f9 ff ff ff ff ff ff 1f 48 b9 00 00
RSP: 0018:ffffc900038f77e0 EFLAGS: 00010246
RAX: 1ffffffffffffff8 RBX: ffff88807b5b4c00 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffc900038f791c
RBP: ffffc900038f79b0 R08: 0000000000000003 R09: 0000000000000000
R10: ffffc900038f7910 R11: fffff5200071ef23 R12: ffff888076cfe680
R13: 1ffff9200071ef18 R14: ffff888076cfe680 R15: dffffc0000000000
FS:  00007fe75611e6c0(0000) GS:ffff8881231b3000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffc0 CR3: 000000005f98e000 CR4: 00000000003526f0
----------------
Code disassembly (best guess):
   0:	e8 33 72 89 ff       	call   0xff897238
   5:	e9 7a f8 ff ff       	jmp    0xfffff884
   a:	4d 89 f4             	mov    %r14,%r12
   d:	48 b8 f8 ff ff ff ff 	movabs $0x1ffffffffffffff8,%rax
  14:	ff ff 1f
  17:	41 80 3c 07 00       	cmpb   $0x0,(%r15,%rax,1)
  1c:	74 0c                	je     0x2a
  1e:	48 c7 c7 c0 ff ff ff 	mov    $0xffffffffffffffc0,%rdi
  25:	e8 ae 71 89 ff       	call   0xff8971d8
* 2a:	4c 8b 34 25 c0 ff ff 	mov    0xffffffffffffffc0,%r14 <-- trapping instruction
  31:	ff
  32:	48 b8 f9 ff ff ff ff 	movabs $0x1ffffffffffffff9,%rax
  39:	ff ff 1f
  3c:	48                   	rex.W
  3d:	b9                   	.byte 0xb9

Crashes (13):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/11/24 00:24 linux-next 3191063649db e9bfbe3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: unable to handle kernel paging request in squashfs_lookup
2026/11/24 00:24 linux-next 3191063649db e9bfbe3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: unable to handle kernel paging request in squashfs_lookup
2026/11/24 00:23 linux-next 3191063649db e9bfbe3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: unable to handle kernel paging request in squashfs_lookup
2026/11/23 22:47 linux-next 3191063649db e9bfbe3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: unable to handle kernel paging request in squashfs_lookup
2026/11/23 21:06 linux-next 3191063649db e9bfbe3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: unable to handle kernel paging request in squashfs_lookup
2026/11/23 21:05 linux-next 3191063649db e9bfbe3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: unable to handle kernel paging request in squashfs_lookup
2026/11/23 21:04 linux-next 3191063649db e9bfbe3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: unable to handle kernel paging request in squashfs_lookup
2026/11/23 20:55 linux-next 3191063649db e9bfbe3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: unable to handle kernel paging request in squashfs_lookup
2026/11/23 20:54 linux-next 3191063649db e9bfbe3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: unable to handle kernel paging request in squashfs_lookup
2026/11/23 20:51 linux-next 3191063649db e9bfbe3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: unable to handle kernel paging request in squashfs_lookup
2026/11/23 20:51 linux-next 3191063649db e9bfbe3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: unable to handle kernel paging request in squashfs_lookup
2026/11/23 20:44 linux-next 3191063649db e9bfbe3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: unable to handle kernel paging request in squashfs_lookup
2026/11/23 20:43 linux-next 3191063649db e9bfbe3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: unable to handle kernel paging request in squashfs_lookup
* Struck through repros no longer work on HEAD.