syzbot


KASAN: use-after-free Read in unaccount_page_cache_page (2)

Status: auto-obsoleted due to no activity on 2025/08/20 03:09
First crash: 119d, last: 94d
Similar bugs (7)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-15 KASAN: use-after-free Read in unaccount_page_cache_page 19 118 536d 1011d 0/2 auto-obsoleted due to no activity on 2024/05/01 01:14
android-5-10 KASAN: use-after-free Read in unaccount_page_cache_page (3) 19 59 20h25m 235d 0/2 premoderation: reported on 2024/12/31 14:15
android-5-10 KASAN: use-after-free Read in unaccount_page_cache_page 19 150 489d 1017d 0/2 auto-obsoleted due to no activity on 2024/06/10 16:28
android-54 KASAN: slab-out-of-bounds Read in unaccount_page_cache_page 19 2 570d 652d 0/2 auto-obsoleted due to no activity on 2024/04/30 10:15
android-5-10 KASAN: use-after-free Read in unaccount_page_cache_page (2) 19 1 375d 375d 0/2 auto-obsoleted due to no activity on 2024/11/11 21:33
android-5-15 KASAN: use-after-free Read in unaccount_page_cache_page (2) 19 43 20d 366d 0/2 premoderation: reported on 2024/08/23 02:36
android-54 KASAN: use-after-free Read in unaccount_page_cache_page 19 143 802d 1015d 0/2 auto-obsoleted due to no activity on 2023/08/23 09:09

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in cleancache_fs_enabled_mapping include/linux/cleancache.h:54 [inline]
BUG: KASAN: use-after-free in cleancache_invalidate_page include/linux/cleancache.h:108 [inline]
BUG: KASAN: use-after-free in unaccount_page_cache_page+0x714/0x780 mm/filemap.c:169
Read of size 4 at addr ffff8881e9408488 by task syz.0.494/2256

CPU: 0 PID: 2256 Comm: syz.0.494 Not tainted 5.4.292-syzkaller-00021-gcd8e74fa0fa3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
 __dump_stack+0x1e/0x20 lib/dump_stack.c:77
 dump_stack+0x15b/0x1b8 lib/dump_stack.c:118
 print_address_description+0x8d/0x4c0 mm/kasan/report.c:384
 __kasan_report+0xef/0x120 mm/kasan/report.c:516
 kasan_report+0x30/0x60 mm/kasan/common.c:653
 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:131
 cleancache_fs_enabled_mapping include/linux/cleancache.h:54 [inline]
 cleancache_invalidate_page include/linux/cleancache.h:108 [inline]
 unaccount_page_cache_page+0x714/0x780 mm/filemap.c:169
 __delete_from_page_cache+0xc3/0x4b0 mm/filemap.c:237
 __remove_mapping+0x4ba/0x590 mm/vmscan.c:985
 shrink_page_list+0x201b/0x3be0 mm/vmscan.c:1489
 shrink_inactive_list+0x479/0xd30 mm/vmscan.c:2008
 shrink_list mm/vmscan.c:2300 [inline]
 shrink_node_memcg+0xaf8/0x1af0 mm/vmscan.c:2630
 shrink_node+0x433/0x1430 mm/vmscan.c:2843
 shrink_zones mm/vmscan.c:3063 [inline]
 do_try_to_free_pages+0x5aa/0x11c0 mm/vmscan.c:3121
 try_to_free_mem_cgroup_pages+0x22e/0x6a0 mm/vmscan.c:3422
 try_charge+0x482/0x1310 mm/memcontrol.c:2627
 mem_cgroup_try_charge+0x2c4/0x400 mm/memcontrol.c:6600
 mem_cgroup_try_charge_delay+0x13/0x50 mm/memcontrol.c:6615
 shmem_getpage_gfp+0x1067/0x2370 mm/shmem.c:1886
 shmem_getpage mm/shmem.c:154 [inline]
 shmem_write_begin+0xce/0x1b0 mm/shmem.c:2447
 generic_perform_write+0x2b8/0x500 mm/filemap.c:3450
 __generic_file_write_iter+0x24b/0x480 mm/filemap.c:3579
 generic_file_write_iter+0x48d/0x620 mm/filemap.c:3611
 call_write_iter include/linux/fs.h:1991 [inline]
 new_sync_write fs/read_write.c:483 [inline]
 __vfs_write+0x480/0x5d0 fs/read_write.c:496
 __kernel_write+0xea/0x320 fs/read_write.c:515
 dump_emit+0x1c0/0x2c0 fs/coredump.c:838
 elf_core_dump+0x3465/0x3bd0 fs/binfmt_elf.c:2352
 do_coredump+0x1d8c/0x2ab0 fs/coredump.c:801
 get_signal+0xdb7/0x13d0 kernel/signal.c:2732
 do_signal+0xad/0xda0 arch/x86/kernel/signal.c:809
 exit_to_usermode_loop+0xc4/0x1b0 arch/x86/entry/common.c:159
 prepare_exit_to_usermode+0x18e/0x1f0 arch/x86/entry/common.c:194
 ret_from_intr+0x1c/0x1c
RIP: 0033:0x7fdd746a4971
Code: 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f
RSP: 002b:0000000000000030 EFLAGS: 00010217
RAX: 0000000000000000 RBX: 00007fdd748cbfa0 RCX: 00007fdd746a4969
RDX: 0000000000000000 RSI: 0000000000000030 RDI: 0000000000000600
RBP: 00007fdd74726ab1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fdd748cbfa0 R15: 00007fffe4969cb8

Allocated by task 2260:
 save_stack mm/kasan/common.c:70 [inline]
 set_track mm/kasan/common.c:78 [inline]
 __kasan_kmalloc+0x162/0x200 mm/kasan/common.c:529
 kasan_slab_alloc+0x12/0x20 mm/kasan/common.c:537
 slab_post_alloc_hook mm/slab.h:584 [inline]
 slab_alloc_node mm/slub.c:2829 [inline]
 slab_alloc mm/slub.c:2837 [inline]
 __kmalloc_track_caller+0x10d/0x2d0 mm/slub.c:4449
 kmemdup+0x26/0x60 mm/util.c:127
 neigh_sysctl_register+0xaf/0xa70 net/core/neighbour.c:3652
 addrconf_sysctl_register+0xb3/0x1a0 net/ipv6/addrconf.c:7020
 ipv6_add_dev+0xbea/0x10f0 net/ipv6/addrconf.c:444
 addrconf_notify+0x5a8/0xeb0 net/ipv6/addrconf.c:3556
 notifier_call_chain kernel/notifier.c:98 [inline]
 __raw_notifier_call_chain kernel/notifier.c:399 [inline]
 raw_notifier_call_chain+0xa0/0x120 kernel/notifier.c:406
 call_netdevice_notifiers_info net/core/dev.c:1670 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:1682 [inline]
 call_netdevice_notifiers net/core/dev.c:1696 [inline]
 register_netdevice+0xeb9/0x12a0 net/core/dev.c:9240
 __ip_tunnel_create+0x2bf/0x380 net/ipv4/ip_tunnel.c:267
 ip_tunnel_init_net+0x277/0x710 net/ipv4/ip_tunnel.c:1076
 erspan_init_net+0x29/0x30 net/ipv4/ip_gre.c:1721
 ops_init+0x1ba/0x4a0 net/core/net_namespace.c:141
 setup_net+0x20c/0x9b0 net/core/net_namespace.c:348
 copy_net_ns+0x314/0x520 net/core/net_namespace.c:489
 create_new_namespaces+0x49c/0x590 kernel/nsproxy.c:103
 copy_namespaces+0x17e/0x1c0 kernel/nsproxy.c:161
 copy_process+0x1194/0x2cf0 kernel/fork.c:2055
 _do_fork+0x190/0x860 kernel/fork.c:2399
 __do_sys_clone kernel/fork.c:2557 [inline]
 __se_sys_clone kernel/fork.c:2538 [inline]
 __x64_sys_clone+0x12e/0x160 kernel/fork.c:2538
 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x5c/0xc1

Freed by task 359:
 save_stack mm/kasan/common.c:70 [inline]
 set_track mm/kasan/common.c:78 [inline]
 kasan_set_free_info mm/kasan/common.c:345 [inline]
 __kasan_slab_free+0x1c3/0x280 mm/kasan/common.c:487
 kasan_slab_free+0xe/0x10 mm/kasan/common.c:496
 slab_free_hook mm/slub.c:1455 [inline]
 slab_free_freelist_hook+0xb7/0x180 mm/slub.c:1494
 slab_free mm/slub.c:3080 [inline]
 kfree+0xbe/0x260 mm/slub.c:4071
 neigh_sysctl_unregister+0x80/0x90 net/core/neighbour.c:3738
 addrconf_sysctl_unregister net/ipv6/addrconf.c:7036 [inline]
 addrconf_ifdown+0x1578/0x17e0 net/ipv6/addrconf.c:3927
 addrconf_notify+0x399/0xeb0 net/ipv6/addrconf.c:3698
 notifier_call_chain kernel/notifier.c:98 [inline]
 __raw_notifier_call_chain kernel/notifier.c:399 [inline]
 raw_notifier_call_chain+0xa0/0x120 kernel/notifier.c:406
 call_netdevice_notifiers_info net/core/dev.c:1670 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:1682 [inline]
 call_netdevice_notifiers net/core/dev.c:1696 [inline]
 rollback_registered_many+0xa75/0xf40 net/core/dev.c:8650
 unregister_netdevice_many+0x4b/0x290 net/core/dev.c:9805
 ip_tunnel_delete_nets+0x343/0x390 net/ipv4/ip_tunnel.c:1129
 erspan_exit_batch_net+0x22/0x30 net/ipv4/ip_gre.c:1727
 ops_exit_list net/core/net_namespace.c:187 [inline]
 cleanup_net+0x5fd/0xb40 net/core/net_namespace.c:612
 process_one_work+0x73b/0xcc0 kernel/workqueue.c:2290
 worker_thread+0xa5c/0x13b0 kernel/workqueue.c:2436
 kthread+0x31e/0x3a0 kernel/kthread.c:288
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354

The buggy address belongs to the object at ffff8881e9408000
 which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 1160 bytes inside of
 2048-byte region [ffff8881e9408000, ffff8881e9408800)
The buggy address belongs to the page:
page:ffffea0007a50200 refcount:1 mapcount:0 mapping:ffff8881f5c0c000 index:0x0 compound_mapcount: 0
flags: 0x8000000000010200(slab|head)
raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5c0c000
raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL)
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook mm/page_alloc.c:2165 [inline]
 prep_new_page+0x35e/0x370 mm/page_alloc.c:2171
 get_page_from_freelist+0x1296/0x1310 mm/page_alloc.c:3794
 __alloc_pages_nodemask+0x202/0x4b0 mm/page_alloc.c:4894
 alloc_slab_page+0x3c/0x3b0 mm/slub.c:343
 allocate_slab mm/slub.c:1683 [inline]
 new_slab+0x93/0x420 mm/slub.c:1749
 new_slab_objects mm/slub.c:2505 [inline]
 ___slab_alloc+0x29e/0x420 mm/slub.c:2667
 __slab_alloc+0x63/0xa0 mm/slub.c:2707
 slab_alloc_node mm/slub.c:2792 [inline]
 slab_alloc mm/slub.c:2837 [inline]
 __kmalloc+0x176/0x2f0 mm/slub.c:3909
 kmalloc include/linux/slab.h:561 [inline]
 kzalloc include/linux/slab.h:690 [inline]
 ops_init+0x89/0x4a0 net/core/net_namespace.c:131
 setup_net+0x20c/0x9b0 net/core/net_namespace.c:348
 copy_net_ns+0x314/0x520 net/core/net_namespace.c:489
 create_new_namespaces+0x49c/0x590 kernel/nsproxy.c:103
 copy_namespaces+0x17e/0x1c0 kernel/nsproxy.c:161
 copy_process+0x1194/0x2cf0 kernel/fork.c:2055
 _do_fork+0x190/0x860 kernel/fork.c:2399
 __do_sys_clone kernel/fork.c:2557 [inline]
 __se_sys_clone kernel/fork.c:2538 [inline]
 __x64_sys_clone+0x12e/0x160 kernel/fork.c:2538
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1176 [inline]
 __free_pages_ok+0x7e4/0x910 mm/page_alloc.c:1438
 free_the_page mm/page_alloc.c:4956 [inline]
 __free_pages+0x8c/0x110 mm/page_alloc.c:4962
 free_thread_stack kernel/fork.c:299 [inline]
 release_task_stack kernel/fork.c:439 [inline]
 put_task_stack+0x21b/0x260 kernel/fork.c:450
 finish_task_switch+0x245/0x590 kernel/sched/core.c:3481
 context_switch kernel/sched/core.c:3613 [inline]
 __schedule+0xa57/0x12a0 kernel/sched/core.c:4309
 preempt_schedule_common+0x9b/0xf0 kernel/sched/core.c:4458
 preempt_schedule+0xa7/0xb0 kernel/sched/core.c:4483
 ___preempt_schedule+0x16/0x20 arch/x86/entry/thunk_64.S:50
 try_to_wake_up+0x978/0x1580 kernel/sched/core.c:2866
 wake_up_process kernel/sched/core.c:2884 [inline]
 wake_up_q+0x81/0xd0 kernel/sched/core.c:504
 futex_wake+0x4a4/0x5d0 kernel/futex.c:1724
 do_futex+0xc36/0x1290 kernel/futex.c:3893
 __do_sys_futex kernel/futex.c:3949 [inline]
 __se_sys_futex+0x2b4/0x360 kernel/futex.c:3917
 __x64_sys_futex+0xe5/0x100 kernel/futex.c:3917
 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x5c/0xc1

Memory state around the buggy address:
 ffff8881e9408380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881e9408400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881e9408480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff8881e9408500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881e9408580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/22 02:59 android12-5.4 cd8e74fa0fa3 0919b50b .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in unaccount_page_cache_page
2025/05/08 15:11 android12-5.4 cd8e74fa0fa3 dbf35fa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in unaccount_page_cache_page
2025/05/05 15:21 android12-5.4 cd8e74fa0fa3 6ca47dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in unaccount_page_cache_page
2025/04/26 22:21 android12-5.4 cd8e74fa0fa3 c6b4fb39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in unaccount_page_cache_page
2025/05/04 15:39 android12-5.4 cd8e74fa0fa3 b0714e37 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: slab-out-of-bounds Read in unaccount_page_cache_page
* Struck through repros no longer work on HEAD.