================================================================== BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:71 [inline] BUG: KASAN: use-after-free in atomic_long_read include/linux/atomic/atomic-instrumented.h:1183 [inline] BUG: KASAN: use-after-free in __down_read_trylock kernel/locking/rwsem.c:1348 [inline] BUG: KASAN: use-after-free in down_read_trylock+0xb5/0x7d0 kernel/locking/rwsem.c:1624 Read of size 8 at addr ffff888110550070 by task kworker/u4:0/8 CPU: 1 PID: 8 Comm: kworker/u4:0 Not tainted 5.15.173-syzkaller-00161-gb4bd207b0380 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: writeback wb_workfn (flush-7:2) Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1c0 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 kasan_check_range+0x293/0x2a0 mm/kasan/generic.c:189 __kasan_check_read+0x11/0x20 mm/kasan/shadow.c:31 instrument_atomic_read include/linux/instrumented.h:71 [inline] atomic_long_read include/linux/atomic/atomic-instrumented.h:1183 [inline] __down_read_trylock kernel/locking/rwsem.c:1348 [inline] down_read_trylock+0xb5/0x7d0 kernel/locking/rwsem.c:1624 trylock_super+0x1f/0xf0 fs/super.c:418 __writeback_inodes_wb+0x101/0x3f0 fs/fs-writeback.c:1992 wb_writeback+0x3cd/0x9e0 fs/fs-writeback.c:2106 wb_check_old_data_flush fs/fs-writeback.c:2206 [inline] wb_do_writeback fs/fs-writeback.c:2259 [inline] wb_workfn+0xb3d/0x1110 fs/fs-writeback.c:2288 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472 kthread+0x421/0x510 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Allocated by task 4650: 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] __kmalloc_track_caller+0x13e/0x2c0 mm/slub.c:4954 copy_array kernel/bpf/verifier.c:776 [inline] copy_stack_state kernel/bpf/verifier.c:827 [inline] copy_func_state kernel/bpf/verifier.c:944 [inline] copy_verifier_state+0x862/0xcc0 kernel/bpf/verifier.c:980 push_stack+0x19d/0x4f0 kernel/bpf/verifier.c:1051 check_cond_jmp_op kernel/bpf/verifier.c:9316 [inline] do_check+0xceae/0xf2c0 kernel/bpf/verifier.c:11441 do_check_common+0x909/0x1290 kernel/bpf/verifier.c:13454 do_check_main kernel/bpf/verifier.c:13517 [inline] bpf_check+0x3851/0x12c60 kernel/bpf/verifier.c:14088 bpf_prog_load+0x12ac/0x1b50 kernel/bpf/syscall.c:2333 __sys_bpf+0x4bc/0x760 kernel/bpf/syscall.c:4633 __do_sys_bpf kernel/bpf/syscall.c:4737 [inline] __se_sys_bpf kernel/bpf/syscall.c:4735 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:4735 x64_sys_call+0x87f/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:322 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 4650: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x126/0x160 mm/kasan/common.c:365 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373 kasan_slab_free include/linux/kasan.h:193 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1749 slab_free mm/slub.c:3521 [inline] kfree+0xcc/0x270 mm/slub.c:4583 free_func_state kernel/bpf/verifier.c:907 [inline] free_verifier_state+0xdb/0x220 kernel/bpf/verifier.c:924 pop_stack+0x3bf/0x530 kernel/bpf/verifier.c:1026 do_check+0x8249/0xf2c0 kernel/bpf/verifier.c:11430 do_check_common+0x909/0x1290 kernel/bpf/verifier.c:13454 do_check_main kernel/bpf/verifier.c:13517 [inline] bpf_check+0x3851/0x12c60 kernel/bpf/verifier.c:14088 bpf_prog_load+0x12ac/0x1b50 kernel/bpf/syscall.c:2333 __sys_bpf+0x4bc/0x760 kernel/bpf/syscall.c:4633 __do_sys_bpf kernel/bpf/syscall.c:4737 [inline] __se_sys_bpf kernel/bpf/syscall.c:4735 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:4735 x64_sys_call+0x87f/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:322 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff888110550000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 112 bytes inside of 8192-byte region [ffff888110550000, ffff888110552000) The buggy address belongs to the page: page:ffffea0004415400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x110550 head:ffffea0004415400 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100043500 raw: 0000000000000000 0000000000020002 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 4650, ts 236950401625, free_ts 236771451214 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1b/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5779 allocate_slab mm/slub.c:1932 [inline] new_slab+0x9a/0x4e0 mm/slub.c:1995 ___slab_alloc+0x39e/0x830 mm/slub.c:3028 __slab_alloc+0x4a/0x90 mm/slub.c:3115 slab_alloc_node mm/slub.c:3206 [inline] slab_alloc mm/slub.c:3250 [inline] __kmalloc_track_caller+0x171/0x2c0 mm/slub.c:4949 copy_array kernel/bpf/verifier.c:776 [inline] copy_stack_state kernel/bpf/verifier.c:827 [inline] copy_func_state kernel/bpf/verifier.c:944 [inline] copy_verifier_state+0x862/0xcc0 kernel/bpf/verifier.c:980 push_stack+0x19d/0x4f0 kernel/bpf/verifier.c:1051 check_cond_jmp_op kernel/bpf/verifier.c:9316 [inline] do_check+0xceae/0xf2c0 kernel/bpf/verifier.c:11441 do_check_common+0x909/0x1290 kernel/bpf/verifier.c:13454 do_check_main kernel/bpf/verifier.c:13517 [inline] bpf_check+0x3851/0x12c60 kernel/bpf/verifier.c:14088 bpf_prog_load+0x12ac/0x1b50 kernel/bpf/syscall.c:2333 __sys_bpf+0x4bc/0x760 kernel/bpf/syscall.c:4633 __do_sys_bpf kernel/bpf/syscall.c:4737 [inline] __se_sys_bpf kernel/bpf/syscall.c:4735 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:4735 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1472 [inline] free_pcp_prepare mm/page_alloc.c:1544 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3534 free_unref_page+0xe8/0x750 mm/page_alloc.c:3616 free_the_page mm/page_alloc.c:805 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5855 __free_slab+0xec/0x1d0 mm/slub.c:2020 free_slab mm/slub.c:2035 [inline] discard_slab+0x29/0x40 mm/slub.c:2041 __slab_free+0x205/0x290 mm/slub.c:3426 do_slab_free mm/slub.c:3509 [inline] ___cache_free+0x109/0x120 mm/slub.c:3530 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_krealloc+0x93/0xd0 mm/kasan/common.c:580 kasan_krealloc include/linux/kasan.h:247 [inline] __do_krealloc mm/slab_common.c:1234 [inline] krealloc+0xbe/0x110 mm/slab_common.c:1271 push_jmp_history kernel/bpf/verifier.c:2119 [inline] is_state_visited kernel/bpf/verifier.c:11036 [inline] do_check+0x2633/0xf2c0 kernel/bpf/verifier.c:11176 do_check_common+0x909/0x1290 kernel/bpf/verifier.c:13454 do_check_main kernel/bpf/verifier.c:13517 [inline] bpf_check+0x3851/0x12c60 kernel/bpf/verifier.c:14088 Memory state around the buggy address: ffff88811054ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811054ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888110550000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888110550080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888110550100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== attempt to access beyond end of device loop4: rw=2049, want=40984, limit=40427