================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x79/0x1f60 kernel/locking/lockdep.c:4925 Read of size 8 at addr ffff88807b987130 by task syz-executor.5/8176 CPU: 1 PID: 8176 Comm: syz-executor.5 Not tainted 6.2.0-rc3-syzkaller-00008-g1fe4fd6f5cad #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x74/0x340 mm/kasan/report.c:306 print_report+0x107/0x220 mm/kasan/report.c:417 kasan_report+0x139/0x170 mm/kasan/report.c:517 __lock_acquire+0x79/0x1f60 kernel/locking/lockdep.c:4925 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 lock_sock_nested+0x44/0xf0 net/core/sock.c:3470 lock_sock include/net/sock.h:1725 [inline] nr_accept+0x510/0x660 net/netrom/af_netrom.c:805 do_accept+0x4d0/0x6d0 net/socket.c:1856 __sys_accept4_file net/socket.c:1897 [inline] __sys_accept4+0x97/0x100 net/socket.c:1927 __do_sys_accept net/socket.c:1944 [inline] __se_sys_accept net/socket.c:1941 [inline] __x64_sys_accept+0x79/0x90 net/socket.c:1941 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f03c548c0c9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f03c61ac168 EFLAGS: 00000246 ORIG_RAX: 000000000000002b RAX: ffffffffffffffda RBX: 00007f03c55ac050 RCX: 00007f03c548c0c9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00007f03c54e7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc691948ff R14: 00007f03c61ac300 R15: 0000000000022000 Allocated by task 8170: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:380 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:968 [inline] __kmalloc+0xaf/0x190 mm/slab_common.c:981 kmalloc include/linux/slab.h:584 [inline] sk_prot_alloc+0xde/0x200 net/core/sock.c:2038 sk_alloc+0x34/0x360 net/core/sock.c:2091 nr_create+0x9d/0x500 net/netrom/af_netrom.c:433 __sock_create+0x3fd/0x850 net/socket.c:1515 sock_create net/socket.c:1566 [inline] __sys_socket_create net/socket.c:1603 [inline] __sys_socket+0x137/0x3a0 net/socket.c:1636 __do_sys_socket net/socket.c:1649 [inline] __se_sys_socket net/socket.c:1647 [inline] __x64_sys_socket+0x76/0x80 net/socket.c:1647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 8149: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:518 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1807 slab_free mm/slub.c:3787 [inline] __kmem_cache_free+0x71/0x110 mm/slub.c:3800 sk_prot_free net/core/sock.c:2074 [inline] __sk_destruct+0x48c/0x5e0 net/core/sock.c:2166 call_timer_fn+0xf5/0x210 kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1751 [inline] __run_timers+0x775/0x990 kernel/time/timer.c:2022 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:2035 __do_softirq+0x277/0x75b kernel/softirq.c:571 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:488 __call_rcu_common kernel/rcu/tree.c:2755 [inline] call_rcu+0x163/0xab0 kernel/rcu/tree.c:2868 netlink_release+0x13e1/0x1820 net/netlink/af_netlink.c:826 __sock_release net/socket.c:650 [inline] sock_release+0x7a/0x140 net/socket.c:678 rdma_dev_exit_net+0x2b9/0x360 drivers/infiniband/core/device.c:1152 ops_exit_list net/core/net_namespace.c:169 [inline] cleanup_net+0x758/0xc60 net/core/net_namespace.c:606 process_one_work+0x81c/0xd10 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff88807b987000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 304 bytes inside of 2048-byte region [ffff88807b987000, ffff88807b987800) The buggy address belongs to the physical page: page:ffffea0001ee6000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7b980 head:ffffea0001ee6000 order:3 compound_mapcount:0 subpages_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff888012842000 ffffea0001d51400 dead000000000002 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 0x152800(GFP_NOWAIT|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 5215, tgid 5214 (syz-executor.1), ts 164664464816, free_ts 164661147251 prep_new_page mm/page_alloc.c:2531 [inline] get_page_from_freelist+0x72b/0x7a0 mm/page_alloc.c:4283 __alloc_pages+0x259/0x560 mm/page_alloc.c:5549 alloc_slab_page+0xbd/0x190 mm/slub.c:1851 allocate_slab+0x5e/0x3c0 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0x7f4/0xeb0 mm/slub.c:3193 __slab_alloc mm/slub.c:3292 [inline] __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] __kmem_cache_alloc_node+0x25b/0x340 mm/slub.c:3491 kmalloc_node_trace+0x23/0x60 mm/slab_common.c:1075 kmalloc_node include/linux/slab.h:606 [inline] kzalloc_node include/linux/slab.h:731 [inline] throtl_pd_alloc+0x9b/0x5f0 block/blk-throttle.c:345 blkg_alloc+0x74f/0x870 block/blk-cgroup.c:284 blkg_create+0x3f4/0x11c0 block/blk-cgroup.c:326 blkg_lookup_create block/blk-cgroup.c:439 [inline] blkg_tryget_closest block/blk-cgroup.c:1904 [inline] bio_associate_blkg_from_css+0x8bd/0xb90 block/blk-cgroup.c:1938 bio_associate_blkg+0xf0/0x170 block/blk-cgroup.c:1966 bio_init block/bio.c:266 [inline] bio_alloc_bioset+0x4d5/0x1380 block/bio.c:570 bio_alloc include/linux/bio.h:423 [inline] submit_bh_wbc+0x25c/0x4c0 fs/buffer.c:2682 __ext4_read_bh fs/ext4/super.c:174 [inline] ext4_read_bh+0x17e/0x230 fs/ext4/super.c:198 ext4_read_bh_lock fs/ext4/super.c:213 [inline] __ext4_sb_bread_gfp+0x17b/0x1c0 fs/ext4/super.c:235 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1446 [inline] free_pcp_prepare+0x751/0x780 mm/page_alloc.c:1496 free_unref_page_prepare mm/page_alloc.c:3369 [inline] free_unref_page+0x19/0x4c0 mm/page_alloc.c:3464 discard_slab mm/slub.c:2098 [inline] __unfreeze_partials+0x1a5/0x1e0 mm/slub.c:2637 put_cpu_partial+0x116/0x180 mm/slub.c:2713 qlist_free_all+0x2b/0x70 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x156/0x170 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x1f/0x70 mm/kasan/common.c:302 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:761 [inline] slab_alloc_node mm/slub.c:3452 [inline] __kmem_cache_alloc_node+0x1e0/0x340 mm/slub.c:3491 kmalloc_trace+0x26/0x60 mm/slab_common.c:1062 kmalloc include/linux/slab.h:580 [inline] kzalloc include/linux/slab.h:720 [inline] hfsplus_btree_open+0x5a/0xd00 fs/hfsplus/btree.c:142 hfsplus_fill_super+0xaa2/0x1c60 fs/hfsplus/super.c:473 mount_bdev+0x26c/0x3a0 fs/super.c:1359 legacy_get_tree+0xea/0x180 fs/fs_context.c:610 vfs_get_tree+0x88/0x270 fs/super.c:1489 do_new_mount+0x289/0xad0 fs/namespace.c:3145 do_mount fs/namespace.c:3488 [inline] __do_sys_mount fs/namespace.c:3697 [inline] __se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3674 Memory state around the buggy address: ffff88807b987000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807b987080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807b987100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807b987180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807b987200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================