KASAN: use-after-free Read in filemap_map_pages

Status: upstream: reported C repro on 2026/06/01 11:47
Labels: prio:high actionable
[Documentation on labels]
Reported-by: syzbot+b72767277f29b6407083@syzkaller.appspotmail.com
First crash: 103d, last: 9d00h
✨ AI Patch Versions (5)
Version Stage Reported Report Link Job
1 upstream 2026/09/03 13:48 Discussion a01c56bd-74d0-411c-afb4-ee6f0cb6cb61
4 moderation 2026/08/28 08:23 Discussion a01c56bd-74d0-411c-afb4-ee6f0cb6cb61
3 moderation 2026/08/27 15:23 Discussion b8678dd0-4122-4e08-b590-12a929d4b350
2 moderation 2026/08/27 12:31 Discussion d9ef07ca-442b-4723-a4ca-51fdb4666218
1 moderation 2026/08/17 01:04 Discussion 608570d2-1765-472d-a79b-ea5b0b3a226a
✨ AI Jobs (26)
ID Workflow Result Correct Bug Created Started Finished Revision
a01c56bd patch-iteration KASAN: use-after-free Read in filemap_map_pages 2026/08/28 08:20 2026/08/28 08:20 2026/08/28 08:23 e2fa417d
b8678dd0 patch-iteration KASAN: use-after-free Read in filemap_map_pages 2026/08/27 15:00 2026/08/27 15:00 2026/08/27 15:23 bd6de8ec
8aacad91 patch-iteration KASAN: use-after-free Read in filemap_map_pages 2026/08/27 12:31 2026/08/27 12:31 2026/08/27 13:04 69a01293
d9ef07ca patch-iteration KASAN: use-after-free Read in filemap_map_pages 2026/08/27 12:04 2026/08/27 12:04 2026/08/27 12:31 69a01293
e42cf07d patch-iteration 💥 KASAN: use-after-free Read in filemap_map_pages 2026/08/26 23:37 2026/08/26 23:37 2026/08/27 00:03 a2b77b9e
82458686 patch-iteration 💥 KASAN: use-after-free Read in filemap_map_pages 2026/08/26 10:32 2026/08/26 10:32 2026/08/26 10:42 ee98d2fd
617e5cd8 patch-iteration 💥 KASAN: use-after-free Read in filemap_map_pages 2026/08/25 22:22 2026/08/25 22:22 2026/08/25 22:32 ee98d2fd
b523ea41 patch-iteration 💥 KASAN: use-after-free Read in filemap_map_pages 2026/08/25 10:19 2026/08/25 10:19 2026/08/25 10:21 614e416a
b4815143 patch-iteration 💥 KASAN: use-after-free Read in filemap_map_pages 2026/08/24 21:51 2026/08/24 21:51 2026/08/24 22:19 23caa175
030a60cb patch-iteration 💥 KASAN: use-after-free Read in filemap_map_pages 2026/08/24 09:46 2026/08/24 09:46 2026/08/24 09:51 1e72964b
dc42d8dc patch-iteration 💥 KASAN: use-after-free Read in filemap_map_pages 2026/08/23 20:13 2026/08/23 20:13 2026/08/23 21:46 1e72964b
a5200616 patch-iteration 💥 KASAN: use-after-free Read in filemap_map_pages 2026/08/23 06:52 2026/08/23 06:52 2026/08/23 08:13 1e72964b
a5a1ba68 patch-iteration 💥 KASAN: use-after-free Read in filemap_map_pages 2026/08/22 18:46 2026/08/22 18:46 2026/08/22 18:52 1e72964b
87693473 patch-iteration 💥 KASAN: use-after-free Read in filemap_map_pages 2026/08/22 06:40 2026/08/22 06:40 2026/08/22 06:46 1e72964b
c1fb130a patch-iteration 💥 KASAN: use-after-free Read in filemap_map_pages 2026/08/21 18:01 2026/08/21 18:01 2026/08/21 18:40 1e72964b
53420d32 patch-iteration 💥 KASAN: use-after-free Read in filemap_map_pages 2026/08/21 05:55 2026/08/21 05:55 2026/08/21 06:01 1e72964b
34f8f548 patch-iteration 💥 KASAN: use-after-free Read in filemap_map_pages 2026/08/20 17:01 2026/08/20 17:01 2026/08/20 17:55 1e72964b
ce423e9b patch-iteration 💥 KASAN: use-after-free Read in filemap_map_pages 2026/08/20 04:56 2026/08/20 04:56 2026/08/20 05:01 1e72964b
61a050a6 patch-iteration 💥 KASAN: use-after-free Read in filemap_map_pages 2026/08/19 16:41 2026/08/19 16:42 2026/08/19 16:56 1e72964b
7600c721 patch-iteration 💥 KASAN: use-after-free Read in filemap_map_pages 2026/08/19 09:43 2026/08/19 09:43 2026/08/19 10:41 1e72964b
790bddcf patch-iteration 💥 KASAN: use-after-free Read in filemap_map_pages 2026/08/19 07:39 2026/08/19 07:39 2026/08/19 08:43 1e72964b
608570d2 patching KASAN: use-after-free Read in filemap_map_pages 2026/08/16 20:06 2026/08/16 23:40 2026/08/17 01:03 746171ee
2066b37d repro-c Reproduced: ✅ KASAN: use-after-free Read in filemap_map_pages 2026/08/14 12:25 2026/08/14 12:25 2026/08/14 13:31 b13552fe
e6ccfbc4 repro-c 💥 KASAN: use-after-free Read in filemap_map_pages 2026/08/09 13:06 2026/08/09 13:20 2026/08/09 13:20 5d63f80b
c653425a moderation Actionable: ✅ KASAN: use-after-free Read in filemap_map_pages 2026/06/01 10:46 2026/06/01 10:56 2026/06/01 11:46 6b4a8443
58d92cea assessment-security DenialOfService: ✅ Exploitable: ✅ FilesystemTrigger: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ✅ UserNamespace: ❌ VMGuestTrigger: ❌ VMHostTrigger: ❌ KASAN: use-after-free Read in filemap_map_pages 2026/05/29 21:32 2026/05/29 21:32 2026/05/29 22:48 6b4a8443
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] xarray: fix index jumping backwards in xas_find() 6 (6) 2026/09/04 12:16
[syzbot] [net?] KASAN: use-after-free Read in filemap_map_pages 1 (5) 2026/08/16 06:43
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-use-after-free Read in filemap_map_pages mm 19 syz, C inconclusive done 17 341d 614d 0/29 auto-obsoleted due to no activity on 2026/01/09 07:21
Last patch testing requests (4)
Created Duration User Patch Repo Result
2026/08/29 13:18 16m retest repro upstream report job log log
2026/08/16 02:17 16m hdanton@sina.com patch upstream report job log log
2026/08/15 11:43 15m nogikh@google.com upstream report job log log
2026/08/14 14:14 14m nogikh@google.com upstream report job log log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ptep_get include/linux/pgtable.h:495 [inline]
BUG: KASAN: use-after-free in filemap_map_folio_range mm/filemap.c:3820 [inline]
BUG: KASAN: use-after-free in filemap_map_pages+0x1b75/0x1f80 mm/filemap.c:3955
Read of size 8 at addr ffff88803f851a00 by task syz-executor403/6035

CPU: 2 UID: 0 PID: 6035 Comm: syz-executor403 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0x13d/0x4b0 mm/kasan/report.c:482
 kasan_report+0xdf/0x1c0 mm/kasan/report.c:595
 ptep_get include/linux/pgtable.h:495 [inline]
 filemap_map_folio_range mm/filemap.c:3820 [inline]
 filemap_map_pages+0x1b75/0x1f80 mm/filemap.c:3955
 do_fault_around mm/memory.c:5818 [inline]
 do_read_fault mm/memory.c:5851 [inline]
 do_fault+0x985/0x1750 mm/memory.c:5994
 do_pte_missing mm/memory.c:4566 [inline]
 handle_pte_fault mm/memory.c:6379 [inline]
 __handle_mm_fault+0x187d/0x2a00 mm/memory.c:6517
 handle_mm_fault+0x37b/0xa30 mm/memory.c:6686
 do_user_addr_fault+0x74c/0x12f0 arch/x86/mm/fault.c:1394
 handle_page_fault arch/x86/mm/fault.c:1483 [inline]
 exc_page_fault+0x6f/0xd0 arch/x86/mm/fault.c:1536
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:595
RIP: 0010:fault_in_readable+0xde/0x190 mm/gup.c:2161
Code: 68 46 ae ff 4c 89 f0 48 85 c0 0f 85 bf 00 00 00 e8 77 4c ae ff 0f 01 cb 0f ae e8 4c 89 fb 4d 85 ff 75 31 eb 48 e8 62 4c ae ff <44> 8a 33 e8 5a 4c ae ff 48 81 c3 00 10 00 00 31 ff 48 81 e3 00 f0
RSP: 0018:ffffc90003a87af8 EFLAGS: 00050293
RAX: 0000000000000000 RBX: 00007fe62c200000 RCX: ffffffff825c2758
RDX: ffff888033b84a80 RSI: ffffffff825c271e RDI: ffff888033b84a80
RBP: 00007fe62c200001 R08: 0000000000000006 R09: 00007fe62c200001
R10: 00007fe62c200000 R11: 0000000000000000 R12: 0000000000000001
R13: 1ffff92000750f60 R14: 0000000000000000 R15: 00007fe62c200000
 fault_in_iov_iter_readable+0x101/0x2c0 lib/iov_iter.c:106
 generic_perform_write+0x863/0xa40 mm/filemap.c:4413
 shmem_file_write_iter+0x10e/0x140 mm/shmem.c:3424
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x6ac/0x1050 fs/read_write.c:687
 ksys_pwrite64 fs/read_write.c:794 [inline]
 __do_sys_pwrite64 fs/read_write.c:802 [inline]
 __se_sys_pwrite64 fs/read_write.c:799 [inline]
 __x64_sys_pwrite64+0x1eb/0x250 fs/read_write.c:799
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fe62c7fce5e
Code: 08 0f 85 f5 e2 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 90 41 57 41 56 4d 89 c6 41 55 4d 89 cd 41 54 55 53 48 83 ec 08
RSP: 002b:00007fe62b9fe1a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000012
RAX: ffffffffffffffda RBX: 00007fe62b9fe6c0 RCX: 00007fe62c7fce5e
RDX: 0000000000000001 RSI: 00007fe62c200000 RDI: 0000000000000003
RBP: 0000000000000021 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffffd0
R13: 0000000000000000 R14: 00007ffdde346d90 R15: 00007ffdde346e78
 </TASK>

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888000000000 pfn:0x3f851
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000
raw: ffff888000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x440dc0(GFP_KERNEL_ACCOUNT|__GFP_ZERO|__GFP_COMP), pid 6004, tgid 6004 (cmp), ts 79653237963, free_ts 79740307238
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1859
 prep_new_page mm/page_alloc.c:1867 [inline]
 get_page_from_freelist+0xf48/0x3530 mm/page_alloc.c:3946
 __alloc_frozen_pages_noprof+0x299/0x2dc0 mm/page_alloc.c:5304
 alloc_pages_mpol+0x1fb/0x540 mm/mempolicy.c:2490
 alloc_pages_noprof+0x1a/0x160 mm/mempolicy.c:2581
 pagetable_alloc_noprof include/linux/mm.h:3685 [inline]
 pmd_alloc_one_noprof include/asm-generic/pgalloc.h:143 [inline]
 __pmd_alloc+0x3b/0x950 mm/memory.c:6772
 pmd_alloc include/linux/mm.h:3601 [inline]
 __handle_mm_fault+0xa9c/0x2a00 mm/memory.c:6469
 handle_mm_fault+0x37b/0xa30 mm/memory.c:6686
 do_user_addr_fault+0x5a3/0x12f0 arch/x86/mm/fault.c:1343
 handle_page_fault arch/x86/mm/fault.c:1483 [inline]
 exc_page_fault+0x6f/0xd0 arch/x86/mm/fault.c:1536
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:595
page last free pid 6002 tgid 6002 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 __free_pages_prepare mm/page_alloc.c:1406 [inline]
 __free_frozen_pages+0x79f/0x1090 mm/page_alloc.c:2950
 __pagetable_free include/linux/mm.h:3695 [inline]
 pagetable_free include/linux/mm.h:3719 [inline]
 pagetable_dtor_free include/linux/mm.h:3818 [inline]
 __tlb_remove_table include/asm-generic/tlb.h:221 [inline]
 __tlb_remove_table_free mm/mmu_gather.c:228 [inline]
 tlb_remove_table_rcu+0x2cf/0x380 mm/mmu_gather.c:291
 rcu_do_batch kernel/rcu/tree.c:2645 [inline]
 rcu_core+0x5a2/0x10d0 kernel/rcu/tree.c:2897
 handle_softirqs+0x1ea/0x9b0 kernel/softirq.c:622
 __do_softirq kernel/softirq.c:656 [inline]
 invoke_softirq kernel/softirq.c:496 [inline]
 __irq_exit_rcu+0x162/0x210 kernel/softirq.c:735
 irq_exit_rcu+0x9/0x30 kernel/softirq.c:752
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline]
 sysvec_apic_timer_interrupt+0xa3/0xc0 arch/x86/kernel/apic/apic.c:1062
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674

Memory state around the buggy address:
 ffff88803f851900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88803f851980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88803f851a00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                   ^
 ffff88803f851a80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88803f851b00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
----------------
Code disassembly (best guess):
   0:	68 46 ae ff 4c       	push   $0x4cffae46
   5:	89 f0                	mov    %esi,%eax
   7:	48 85 c0             	test   %rax,%rax
   a:	0f 85 bf 00 00 00    	jne    0xcf
  10:	e8 77 4c ae ff       	call   0xffae4c8c
  15:	0f 01 cb             	stac
  18:	0f ae e8             	lfence
  1b:	4c 89 fb             	mov    %r15,%rbx
  1e:	4d 85 ff             	test   %r15,%r15
  21:	75 31                	jne    0x54
  23:	eb 48                	jmp    0x6d
  25:	e8 62 4c ae ff       	call   0xffae4c8c
* 2a:	44 8a 33             	mov    (%rbx),%r14b <-- trapping instruction
  2d:	e8 5a 4c ae ff       	call   0xffae4c8c
  32:	48 81 c3 00 10 00 00 	add    $0x1000,%rbx
  39:	31 ff                	xor    %edi,%edi
  3b:	48                   	rex.W
  3c:	81                   	.byte 0x81
  3d:	e3 00                	jrcxz  0x3f
  3f:	f0                   	lock

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/15 12:51 upstream 15ef2f78c49d 2b01f00e .config console log report C ci-qemu-upstream KASAN: use-after-free Read in filemap_map_pages
2026/05/27 05:44 upstream d60ec36cab33 2b01f00e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 KASAN: use-after-free Read in filemap_map_pages
2026/06/22 11:39 upstream ef0c9f75a195 43bfcdb0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root KASAN: slab-out-of-bounds Read in filemap_map_pages
2026/05/29 21:31 upstream 8fde5d1d47f6 6b4a8443 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce KASAN: slab-use-after-free Read in filemap_map_pages
2026/08/14 11:28 upstream 2f1baf1fc892 2cf1fbb7 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 KASAN: slab-out-of-bounds Read in filemap_map_pages
* Struck through repros no longer work on HEAD.