================================================================== 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+0x639/0x6b0 mm/filemap.c:169 Read of size 4 at addr ffff88819333f488 by task syz-executor.0/891 CPU: 1 PID: 891 Comm: syz-executor.0 Not tainted 5.4.233-syzkaller-00032-g21086923c1e6 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 print_address_description+0x8c/0x600 mm/kasan/report.c:384 __kasan_report+0xf3/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 cleancache_fs_enabled_mapping include/linux/cleancache.h:54 [inline] cleancache_invalidate_page include/linux/cleancache.h:108 [inline] unaccount_page_cache_page+0x639/0x6b0 mm/filemap.c:169 __delete_from_page_cache+0xc3/0x510 mm/filemap.c:237 __remove_mapping+0x46e/0x550 mm/vmscan.c:978 shrink_page_list+0x2467/0x3e70 mm/vmscan.c:1482 shrink_inactive_list+0x4f6/0xfd0 mm/vmscan.c:2001 shrink_list mm/vmscan.c:2293 [inline] shrink_node_memcg+0xc42/0x2430 mm/vmscan.c:2623 shrink_node+0x396/0x12b0 mm/vmscan.c:2836 shrink_zones mm/vmscan.c:3053 [inline] do_try_to_free_pages+0x625/0x1280 mm/vmscan.c:3111 try_to_free_mem_cgroup_pages+0x3f6/0x9b0 mm/vmscan.c:3412 memory_max_write+0x235/0x3c0 mm/memcontrol.c:6220 cgroup_file_write+0x275/0x5c0 kernel/cgroup/cgroup.c:3898 kernfs_fop_write+0x2e2/0x3e0 fs/kernfs/file.c:315 __vfs_write+0x103/0x750 fs/read_write.c:494 vfs_write+0x206/0x4e0 fs/read_write.c:558 ksys_write+0x199/0x2c0 fs/read_write.c:611 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Allocated by task 595: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x130/0x1d0 mm/kasan/common.c:529 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+0xfb/0x290 mm/slub.c:4449 __kmalloc_reserve net/core/skbuff.c:142 [inline] __alloc_skb+0xb4/0x4d0 net/core/skbuff.c:210 alloc_skb_fclone include/linux/skbuff.h:1129 [inline] tipc_buf_acquire+0x2a/0xe0 net/tipc/msg.c:66 tipc_msg_build+0xabd/0x1120 net/tipc/msg.c:394 tipc_send_group_bcast+0x9c0/0xd00 net/tipc/socket.c:1074 __tipc_sendmsg+0x1373/0x37b0 net/tipc/socket.c:1133 tipc_sendmsg+0x51/0x70 net/tipc/socket.c:1305 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg net/socket.c:658 [inline] kernel_sendmsg+0xf5/0x130 net/socket.c:678 sock_no_sendpage+0x144/0x1b0 net/core/sock.c:2778 kernel_sendpage net/socket.c:3755 [inline] sock_sendpage+0xd1/0x120 net/socket.c:936 pipe_to_sendpage+0x242/0x310 fs/splice.c:449 splice_from_pipe_feed fs/splice.c:500 [inline] __splice_from_pipe+0x2a0/0x830 fs/splice.c:624 splice_from_pipe fs/splice.c:659 [inline] generic_splice_sendpage+0x195/0x220 fs/splice.c:829 splice_direct_to_actor+0x497/0xae0 fs/splice.c:976 do_splice_direct+0x27f/0x3c0 fs/splice.c:1064 do_sendfile+0x854/0xee0 fs/read_write.c:1464 __do_sys_sendfile64 fs/read_write.c:1525 [inline] __se_sys_sendfile64 fs/read_write.c:1511 [inline] __x64_sys_sendfile64+0x1ce/0x230 fs/read_write.c:1511 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Freed by task 595: 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+0x178/0x230 mm/kasan/common.c:487 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook mm/slub.c:1494 [inline] slab_free mm/slub.c:3080 [inline] kfree+0xeb/0x320 mm/slub.c:4071 skb_release_all net/core/skbuff.c:675 [inline] __kfree_skb net/core/skbuff.c:689 [inline] kfree_skb+0xb8/0x3c0 net/core/skbuff.c:708 __skb_queue_purge include/linux/skbuff.h:2825 [inline] tipc_mcast_xmit+0x15d3/0x1c30 net/tipc/bcast.c:421 tipc_send_group_bcast+0x9f4/0xd00 net/tipc/socket.c:1079 __tipc_sendmsg+0x1373/0x37b0 net/tipc/socket.c:1133 tipc_sendmsg+0x51/0x70 net/tipc/socket.c:1305 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg net/socket.c:658 [inline] kernel_sendmsg+0xf5/0x130 net/socket.c:678 sock_no_sendpage+0x144/0x1b0 net/core/sock.c:2778 kernel_sendpage net/socket.c:3755 [inline] sock_sendpage+0xd1/0x120 net/socket.c:936 pipe_to_sendpage+0x242/0x310 fs/splice.c:449 splice_from_pipe_feed fs/splice.c:500 [inline] __splice_from_pipe+0x2a0/0x830 fs/splice.c:624 splice_from_pipe fs/splice.c:659 [inline] generic_splice_sendpage+0x195/0x220 fs/splice.c:829 splice_direct_to_actor+0x497/0xae0 fs/splice.c:976 do_splice_direct+0x27f/0x3c0 fs/splice.c:1064 do_sendfile+0x854/0xee0 fs/read_write.c:1464 __do_sys_sendfile64 fs/read_write.c:1525 [inline] __se_sys_sendfile64 fs/read_write.c:1511 [inline] __x64_sys_sendfile64+0x1ce/0x230 fs/read_write.c:1511 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 The buggy address belongs to the object at ffff88819333f000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1160 bytes inside of 2048-byte region [ffff88819333f000, ffff88819333f800) The buggy address belongs to the page: page:ffffea00064cce00 refcount:1 mapcount:0 mapping:ffff8881f5c0c000 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 0000000000000000 0000000500000001 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+0x18f/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x2ce8/0x2d70 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4891 alloc_slab_page+0x39/0x3c0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x97/0x440 mm/slub.c:1749 new_slab_objects mm/slub.c:2505 [inline] ___slab_alloc+0x2fe/0x490 mm/slub.c:2667 __slab_alloc+0x5a/0x90 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc_trace+0x128/0x240 mm/slub.c:2854 kmalloc include/linux/slab.h:556 [inline] kzalloc include/linux/slab.h:690 [inline] copy_verifier_state+0x50f/0xae0 kernel/bpf/verifier.c:746 push_stack+0x163/0x520 kernel/bpf/verifier.c:819 check_cond_jmp_op+0x68e/0x1720 kernel/bpf/verifier.c:6172 do_check+0x44e0/0x8920 kernel/bpf/verifier.c:8089 bpf_check+0x20c1/0xabf0 kernel/bpf/verifier.c:9617 bpf_prog_load kernel/bpf/syscall.c:1724 [inline] __do_sys_bpf kernel/bpf/syscall.c:2891 [inline] __se_sys_bpf+0x7db1/0xb870 kernel/bpf/syscall.c:2849 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 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+0x83d/0x940 mm/page_alloc.c:1438 free_the_page mm/page_alloc.c:4953 [inline] __free_pages+0x91/0x140 mm/page_alloc.c:4959 __free_slab+0x221/0x2e0 mm/slub.c:1774 __slab_free+0x33e/0x350 mm/slub.c:3012 qlist_free_all+0x43/0xb0 mm/kasan/quarantine.c:167 quarantine_reduce+0x174/0x190 mm/kasan/quarantine.c:260 __kasan_kmalloc+0x43/0x1d0 mm/kasan/common.c:507 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2829 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc+0xd0/0x220 mm/slub.c:2842 kmem_cache_zalloc include/linux/slab.h:680 [inline] alloc_buffer_head+0x22/0xe0 fs/buffer.c:3352 alloc_page_buffers+0xfb/0x3f0 fs/buffer.c:832 grow_dev_page fs/buffer.c:969 [inline] grow_buffers fs/buffer.c:1019 [inline] __getblk_slow fs/buffer.c:1046 [inline] __getblk_gfp+0x3a2/0x720 fs/buffer.c:1323 __getblk include/linux/buffer_head.h:422 [inline] jbd2_journal_get_descriptor_buffer+0x157/0x410 fs/jbd2/journal.c:844 journal_submit_commit_record+0x119/0xaa0 fs/jbd2/commit.c:131 jbd2_journal_commit_transaction+0x3ea7/0x6700 fs/jbd2/commit.c:879 kjournald2+0x486/0x880 fs/jbd2/journal.c:209 kthread+0x2da/0x360 kernel/kthread.c:288 Memory state around the buggy address: ffff88819333f380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88819333f400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88819333f480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88819333f500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88819333f580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== syz-executor.0 invoked oom-killer: gfp_mask=0xcc0(GFP_KERNEL), order=0, oom_score_adj=1000 CPU: 1 PID: 891 Comm: syz-executor.0 Tainted: G B 5.4.233-syzkaller-00032-g21086923c1e6 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 dump_header+0xd5/0x670 mm/oom_kill.c:460 oom_kill_process+0xeb/0x2c0 mm/oom_kill.c:974 out_of_memory+0x5e1/0x890 mm/oom_kill.c:1111 mem_cgroup_out_of_memory+0x211/0x270 mm/memcontrol.c:1611 memory_max_write+0x331/0x3c0 mm/memcontrol.c:6227 cgroup_file_write+0x275/0x5c0 kernel/cgroup/cgroup.c:3898 kernfs_fop_write+0x2e2/0x3e0 fs/kernfs/file.c:315 __vfs_write+0x103/0x750 fs/read_write.c:494 vfs_write+0x206/0x4e0 fs/read_write.c:558 ksys_write+0x199/0x2c0 fs/read_write.c:611 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 memory: usage 22044kB, limit 0kB, failcnt 42 swap: usage 0kB, limit 9007199254740988kB, failcnt 0 Memory cgroup stats for /syz1: anon 12140544 file 10493952 kernel_stack 0 slab 0 sock 4096 shmem 10563584 file_mapped 405504 file_dirty 0 file_writeback 0 anon_thp 0 inactive_anon 11894784 active_anon 10813440 inactive_file 135168 active_file 0 unevictable 135168 slab_reclaimable 0 slab_unreclaimable 0 pgfault 1745799 pgmajfault 0 workingset_refault 99 workingset_activate 0 workingset_nodereclaim 0 pgrefill 352 pgscan 1502 pgsteal 1298 pgactivate 3894 oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=syz0,mems_allowed=0,oom_memcg=/syz1,task_memcg=/syz1,task=syz-executor.1,pid=30114,uid=0 Memory cgroup out of memory: Killed process 30114 (syz-executor.1) total-vm:54536kB, anon-rss:11992kB, file-rss:14336kB, shmem-rss:0kB, UID:0 pgtables:104kB oom_score_adj:1000 syz-executor.0 invoked oom-killer: gfp_mask=0xcc0(GFP_KERNEL), order=0, oom_score_adj=1000 CPU: 0 PID: 891 Comm: syz-executor.0 Tainted: G B 5.4.233-syzkaller-00032-g21086923c1e6 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 dump_header+0xd5/0x670 mm/oom_kill.c:460 oom_kill_process+0xeb/0x2c0 mm/oom_kill.c:974 out_of_memory+0x5e1/0x890 mm/oom_kill.c:1111 mem_cgroup_out_of_memory+0x211/0x270 mm/memcontrol.c:1611 memory_max_write+0x331/0x3c0 mm/memcontrol.c:6227 cgroup_file_write+0x275/0x5c0 kernel/cgroup/cgroup.c:3898 kernfs_fop_write+0x2e2/0x3e0 fs/kernfs/file.c:315 __vfs_write+0x103/0x750 fs/read_write.c:494 vfs_write+0x206/0x4e0 fs/read_write.c:558 ksys_write+0x199/0x2c0 fs/read_write.c:611 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 memory: usage 10496kB, limit 0kB, failcnt 66 swap: usage 0kB, limit 9007199254740988kB, failcnt 0 Memory cgroup stats for /syz1: anon 323584 file 10493952 kernel_stack 0 slab 0 sock 4096 shmem 10563584 file_mapped 405504 file_dirty 0 file_writeback 0 anon_thp 0 inactive_anon 135168 active_anon 10813440 inactive_file 135168 active_file 0 unevictable 135168 slab_reclaimable 0 slab_unreclaimable 0 pgfault 1745799 pgmajfault 0 workingset_refault 99 workingset_activate 0 workingset_nodereclaim 0 pgrefill 419 pgscan 1535 pgsteal 1298 pgactivate 3927 oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=syz0,mems_allowed=0,oom_memcg=/syz1,task_memcg=/syz1,task=syz-executor.1,pid=24414,uid=0 Memory cgroup out of memory: Killed process 24414 (syz-executor.1) total-vm:48516kB, anon-rss:476kB, file-rss:15244kB, shmem-rss:64kB, UID:0 pgtables:88kB oom_score_adj:0