================================================================== BUG: KASAN: use-after-free in cleancache_fs_enabled_mapping include/linux/cleancache.h:56 [inline] BUG: KASAN: use-after-free in cleancache_invalidate_page include/linux/cleancache.h:110 [inline] BUG: KASAN: use-after-free in unaccount_page_cache_page+0x6d8/0x750 mm/filemap.c:163 Read of size 4 at addr ffff8881027ce470 by task syz-executor.3/15503 CPU: 1 PID: 15503 Comm: syz-executor.3 Not tainted 5.15.119-syzkaller-android13-5.15.119_r00 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description+0x87/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:444 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 cleancache_fs_enabled_mapping include/linux/cleancache.h:56 [inline] cleancache_invalidate_page include/linux/cleancache.h:110 [inline] unaccount_page_cache_page+0x6d8/0x750 mm/filemap.c:163 __delete_from_page_cache+0xc6/0x5b0 mm/filemap.c:231 __remove_mapping+0x566/0x690 mm/vmscan.c:1197 shrink_page_list+0x2c76/0x56c0 mm/vmscan.c:1790 shrink_inactive_list mm/vmscan.c:2277 [inline] shrink_list mm/vmscan.c:2522 [inline] shrink_lruvec+0x17ec/0x4580 mm/vmscan.c:5707 shrink_node_memcgs mm/vmscan.c:5899 [inline] shrink_node+0x1077/0x24e0 mm/vmscan.c:5929 shrink_zones mm/vmscan.c:6132 [inline] do_try_to_free_pages+0x5b6/0x1570 mm/vmscan.c:6190 try_to_free_mem_cgroup_pages+0x36c/0x850 mm/vmscan.c:6504 try_charge_memcg+0x48f/0x1550 mm/memcontrol.c:2685 try_charge mm/memcontrol.c:2810 [inline] charge_memcg+0x6b/0x1a0 mm/memcontrol.c:6812 __mem_cgroup_charge+0x37/0x130 mm/memcontrol.c:6848 mem_cgroup_charge include/linux/memcontrol.h:710 [inline] __add_to_page_cache_locked+0x2d1/0xa20 mm/filemap.c:892 add_to_page_cache_lru+0x11b/0x2c0 mm/filemap.c:984 pagecache_get_page+0xbe1/0xeb0 mm/filemap.c:1951 grab_cache_page_write_begin+0x5d/0xa0 mm/filemap.c:3785 ext4_da_write_begin+0x5ae/0xc30 fs/ext4/inode.c:3013 generic_perform_write+0x2bc/0x5a0 mm/filemap.c:3831 ext4_buffered_write_iter+0x48a/0x610 fs/ext4/file.c:270 ext4_file_write_iter+0x443/0x1c80 __kernel_write+0x5ab/0xa60 fs/read_write.c:539 __dump_emit+0x261/0x3a0 fs/coredump.c:875 dump_emit+0x381/0x3f0 fs/coredump.c:912 dump_user_range+0x86/0x1c0 fs/coredump.c:949 elf_core_dump+0x3663/0x3e80 fs/binfmt_elf.c:2285 do_coredump+0x1834/0x3050 fs/coredump.c:826 get_signal+0x4c8/0x1630 kernel/signal.c:2877 arch_do_signal_or_restart+0xbd/0x1680 arch/x86/kernel/signal.c:865 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop+0xa0/0xe0 kernel/entry/common.c:172 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:208 irqentry_exit_to_user_mode+0x9/0x20 kernel/entry/common.c:314 irqentry_exit+0x12/0x40 kernel/entry/common.c:405 exc_general_protection+0x327/0x4b0 arch/x86/kernel/traps.c:562 asm_exc_general_protection+0x27/0x30 arch/x86/include/asm/idtentry.h:562 RIP: 0033:0x7fb5a559eb31 Code: c4 28 c3 e8 e1 20 00 00 90 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 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f RSP: 002b:00000000200000b0 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 00007fb5a56be050 RCX: 00007fb5a559eb29 RDX: 00000000200000c0 RSI: 00000000200000b0 RDI: 0000000000001000 RBP: 00007fb5a55ea47a R08: 0000000020000240 R09: 0000000020000240 R10: 0000000020000100 R11: 0000000000000206 R12: 0000000000000000 R13: 000000000000000b R14: 00007fb5a56be050 R15: 00007ffe35b03288 Allocated by task 13802: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:433 [inline] ____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:512 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521 kasan_kmalloc include/linux/kasan.h:227 [inline] kmem_cache_alloc_trace+0x115/0x210 mm/slub.c:3265 kmalloc include/linux/slab.h:608 [inline] kzalloc include/linux/slab.h:738 [inline] alloc_super+0x5d/0x7d0 fs/super.c:203 sget_fc+0x20f/0x620 fs/super.c:541 get_tree_bdev+0x28a/0x680 fs/super.c:1273 exfat_get_tree+0x1c/0x20 fs/exfat/super.c:716 vfs_get_tree+0x88/0x290 fs/super.c:1508 do_new_mount+0x28b/0xad0 fs/namespace.c:2994 path_mount+0x671/0x1070 fs/namespace.c:3324 do_mount fs/namespace.c:3337 [inline] __do_sys_mount fs/namespace.c:3545 [inline] __se_sys_mount+0x2c4/0x3b0 fs/namespace.c:3522 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3522 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 insert_work+0x56/0x320 kernel/workqueue.c:1370 __queue_work+0x923/0xcd0 kernel/workqueue.c:1536 queue_work_on+0x105/0x170 kernel/workqueue.c:1563 queue_work include/linux/workqueue.h:508 [inline] schedule_work include/linux/workqueue.h:569 [inline] destroy_super_rcu+0xd1/0xe0 fs/super.c:172 rcu_do_batch+0x57a/0xc10 kernel/rcu/tree.c:2510 rcu_core+0x517/0x1020 kernel/rcu/tree.c:2750 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2763 __do_softirq+0x26d/0x5bf kernel/softirq.c:565 Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 __call_rcu kernel/rcu/tree.c:2994 [inline] call_rcu+0x133/0x12a0 kernel/rcu/tree.c:3074 __put_super+0x26d/0x2e0 fs/super.c:299 put_super fs/super.c:313 [inline] deactivate_locked_super+0xe1/0x110 fs/super.c:346 deactivate_super+0xbe/0xf0 fs/super.c:366 cleanup_mnt+0x45c/0x510 fs/namespace.c:1143 __cleanup_mnt+0x19/0x20 fs/namespace.c:1150 task_work_run+0x129/0x190 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0xc4/0xe0 kernel/entry/common.c:175 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x26/0x160 kernel/entry/common.c:301 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff8881027ce000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1136 bytes inside of 2048-byte region [ffff8881027ce000, ffff8881027ce800) The buggy address belongs to the page: page:ffffea000409f200 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8881027cd000 pfn:0x1027c8 head:ffffea000409f200 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 ffffea0004476808 ffffea0004729a08 ffff888100043200 raw: ffff8881027cd000 0000000000080003 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), pid 22804, ts 481417053346, free_ts 479014385773 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2595 prep_new_page mm/page_alloc.c:2601 [inline] get_page_from_freelist+0x2eab/0x2f80 mm/page_alloc.c:4394 __alloc_pages+0x386/0x7b0 mm/page_alloc.c:5679 allocate_slab mm/slub.c:1930 [inline] new_slab+0x92/0x490 mm/slub.c:1993 ___slab_alloc+0x39e/0x830 mm/slub.c:3026 __slab_alloc+0x4a/0x90 mm/slub.c:3113 slab_alloc_node mm/slub.c:3204 [inline] slab_alloc mm/slub.c:3246 [inline] __kmalloc+0x16d/0x270 mm/slub.c:4421 kmalloc include/linux/slab.h:613 [inline] sk_prot_alloc+0xf9/0x330 net/core/sock.c:1843 sk_alloc+0x38/0x430 net/core/sock.c:1900 __netlink_create net/netlink/af_netlink.c:647 [inline] __netlink_kernel_create+0x1c4/0x910 net/netlink/af_netlink.c:2048 netlink_kernel_create include/linux/netlink.h:62 [inline] diag_net_init+0xa3/0x120 net/core/sock_diag.c:318 ops_init+0x1cf/0x4a0 net/core/net_namespace.c:135 setup_net+0x34b/0xb50 net/core/net_namespace.c:329 copy_net_ns+0x381/0x5f0 net/core/net_namespace.c:473 create_new_namespaces+0x416/0x670 kernel/nsproxy.c:110 copy_namespaces+0x1d1/0x220 kernel/nsproxy.c:178 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1466 [inline] free_pcp_prepare mm/page_alloc.c:1538 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3502 free_unref_page+0xbd/0x5a0 mm/page_alloc.c:3583 free_the_page mm/page_alloc.c:800 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5755 __free_slab+0xec/0x1d0 mm/slub.c:2018 free_slab mm/slub.c:2033 [inline] discard_slab mm/slub.c:2039 [inline] __unfreeze_partials+0x165/0x1a0 mm/slub.c:2525 put_cpu_partial+0xc4/0x120 mm/slub.c:2605 __slab_free+0x1c8/0x290 mm/slub.c:3386 do_slab_free mm/slub.c:3505 [inline] ___cache_free+0x109/0x120 mm/slub.c:3524 qlink_free+0x4d/0x90 mm/kasan/quarantine.c:157 qlist_free_all+0x44/0xb0 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x15a/0x180 mm/kasan/quarantine.c:283 ____kasan_kmalloc+0x2f/0x110 mm/kasan/common.c:478 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521 kasan_kmalloc include/linux/kasan.h:227 [inline] __kmalloc_track_caller+0x139/0x260 mm/slub.c:4948 kmalloc_reserve net/core/skbuff.c:357 [inline] __alloc_skb+0x10c/0x550 net/core/skbuff.c:428 alloc_skb include/linux/skbuff.h:1183 [inline] nlmsg_new include/net/netlink.h:953 [inline] inet_netconf_notify_devconf+0x173/0x220 net/ipv4/devinet.c:2094 Memory state around the buggy address: ffff8881027ce300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881027ce380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881027ce400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881027ce480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881027ce500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== syz-executor.3 (15503) used greatest stack depth: 17184 bytes left