KASAN: null-ptr-deref Write in proc_map_files_readdir

Status: premoderation: reported C repro on 2026/11/25 00:34
Reported-by: syzbot+21ed7de5b25b467f4ecd@syzkaller.appspotmail.com
First crash: 2d09h, last: 15h05m
▶ ▼ Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.6 general protection fault in proc_map_files_readdir 2 1 121d 121d 0/2 auto-obsoleted due to no activity on 2026/11/06 07:12
linux-6.1 general protection fault in proc_map_files_readdir 2 syz, C error 4 123d 125d 0/3 auto-obsoleted due to no activity on 2026/11/03 13:50

Sample crash report:
==================================================================
BUG: KASAN: null-ptr-deref in instrument_atomic_read_write include/linux/instrumented.h:96 [inline]
BUG: KASAN: null-ptr-deref in atomic_long_add_return_acquire include/linux/atomic/atomic-instrumented.h:3297 [inline]
BUG: KASAN: null-ptr-deref in rwsem_read_trylock+0x84/0x5a0 kernel/locking/rwsem.c:259
Write of size 8 at addr 0000000000000098 by task syz-executor902/323

CPU: 1 UID: 0 PID: 323 Comm: syz-executor902 Not tainted syzkaller #0 6abdb0584068549afb00f0521971d0e7cd851362
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Call Trace:
 <TASK>
 __dump_stack+0x21/0x30 lib/dump_stack.c:94
 dump_stack_lvl+0x140/0x1c0 lib/dump_stack.c:120
 print_report+0x3d/0x70 mm/kasan/report.c:484
 kasan_report+0x162/0x1a0 mm/kasan/report.c:594
 check_region_inline mm/kasan/generic.c:-1 [inline]
 kasan_check_range+0x25a/0x2b0 mm/kasan/generic.c:189
 __kasan_check_write+0x18/0x20 mm/kasan/shadow.c:37
 instrument_atomic_read_write include/linux/instrumented.h:96 [inline]
 atomic_long_add_return_acquire include/linux/atomic/atomic-instrumented.h:3297 [inline]
 rwsem_read_trylock+0x84/0x5a0 kernel/locking/rwsem.c:259
 __down_read_common kernel/locking/rwsem.c:1316 [inline]
 __down_read_killable kernel/locking/rwsem.c:1340 [inline]
 down_read_killable+0x7f/0x100 kernel/locking/rwsem.c:1630
 mmap_read_lock_killable include/linux/mmap_lock.h:204 [inline]
 proc_map_files_readdir+0x360/0xa00 fs/proc/base.c:2427
 iterate_dir+0x1fa/0x5c0 fs/readdir.c:108
 __do_sys_getdents64 fs/readdir.c:407 [inline]
 __se_sys_getdents64+0xf6/0x250 fs/readdir.c:392
 __x64_sys_getdents64+0x7f/0xa0 fs/readdir.c:392
 x64_sys_call+0x27d0/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:218
 do_syscall_x64 arch/x86/entry/common.c:47 [inline]
 do_syscall_64+0x57/0xf0 arch/x86/entry/common.c:78
 entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7f21175a4749
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 d8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffffb75a778 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f21175a4749
RDX: 00000000000000bf RSI: 0000200000000200 RDI: 0000000000000004
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
R13: 00007ffffb75a7b0 R14: 00007ffffb75a7f0 R15: 0000000000000000
 </TASK>
==================================================================
BUG: kernel NULL pointer dereference, address: 0000000000000098
#PF: supervisor write access in kernel mode
#PF: error_code(0x0002) - not-present page
PGD 0 
P4D 0 
Oops: Oops: 0002 [#2] PREEMPT SMP KASAN PTI
CPU: 1 UID: 0 PID: 323 Comm: syz-executor902 Tainted: G    B D            syzkaller #0 6abdb0584068549afb00f0521971d0e7cd851362
Tainted: [B]=BAD_PAGE, [D]=DIE
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
RIP: 0010:arch_atomic64_add_return arch/x86/include/asm/atomic64_64.h:79 [inline]
RIP: 0010:raw_atomic64_add_return_acquire include/linux/atomic/atomic-arch-fallback.h:2723 [inline]
RIP: 0010:raw_atomic_long_add_return_acquire include/linux/atomic/atomic-long.h:163 [inline]
RIP: 0010:atomic_long_add_return_acquire include/linux/atomic/atomic-instrumented.h:3298 [inline]
RIP: 0010:rwsem_read_trylock+0x8f/0x5a0 kernel/locking/rwsem.c:259
Code: f3 f3 f3 4b 89 04 2c 43 c6 44 2c 04 04 c7 44 24 40 00 00 00 00 be 08 00 00 00 e8 6c 28 7b 00 41 bf 00 01 00 00 48 89 5c 24 18 <f0> 4c 0f c1 3b 49 81 c7 00 01 00 00 4c 89 f3 48 c1 eb 03 42 80 3c
RSP: 0018:ffffc9000131fa60 EFLAGS: 00010246

RAX: ffff88812bad9300 RBX: 0000000000000098 RCX: ffff88812bad93c0
----------------
Code disassembly (best guess):
   0:	f3 f3 f3 4b 89 04 2c 	repz repz xrelease mov %rax,(%r12,%r13,1)
   7:	43 c6 44 2c 04 04    	movb   $0x4,0x4(%r12,%r13,1)
   d:	c7 44 24 40 00 00 00 	movl   $0x0,0x40(%rsp)
  14:	00
  15:	be 08 00 00 00       	mov    $0x8,%esi
  1a:	e8 6c 28 7b 00       	call   0x7b288b
  1f:	41 bf 00 01 00 00    	mov    $0x100,%r15d
  25:	48 89 5c 24 18       	mov    %rbx,0x18(%rsp)
* 2a:	f0 4c 0f c1 3b       	lock xadd %r15,(%rbx) <-- trapping instruction
  2f:	49 81 c7 00 01 00 00 	add    $0x100,%r15
  36:	4c 89 f3             	mov    %r14,%rbx
  39:	48 c1 eb 03          	shr    $0x3,%rbx
  3d:	42                   	rex.X
  3e:	80                   	.byte 0x80
  3f:	3c                   	.byte 0x3c

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/11/26 12:52 android16-6.12 062f50e2f6f1 1c78e8c0 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci2-android-6-12-rust KASAN: null-ptr-deref Write in proc_map_files_readdir
2026/11/26 18:34 android16-6.12 ea915f171d48 1c78e8c0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-12-rust KASAN: null-ptr-deref Write in proc_map_files_readdir
2026/11/26 12:26 android16-6.12 062f50e2f6f1 1c78e8c0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-12-rust KASAN: null-ptr-deref Write in proc_map_files_readdir
2026/11/26 12:25 android16-6.12 062f50e2f6f1 1c78e8c0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-12-rust KASAN: null-ptr-deref Write in proc_map_files_readdir
2026/11/25 00:36 android16-6.12 f6ccce935019 50451a16 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-12-rust KASAN: null-ptr-deref Write in proc_map_files_readdir
2026/11/25 00:35 android16-6.12 f6ccce935019 50451a16 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-12-rust KASAN: null-ptr-deref Write in proc_map_files_readdir
2026/11/25 00:33 android16-6.12 f6ccce935019 50451a16 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-12-rust KASAN: null-ptr-deref Write in proc_map_files_readdir
* Struck through repros no longer work on HEAD.