================================================================== BUG: KASAN: slab-out-of-bounds in __lock_acquire+0x3d86/0x54a0 kernel/locking/lockdep.c:4885 Read of size 8 at addr ffff88808b7200a0 by task kworker/0:8/9767 CPU: 0 PID: 9767 Comm: kworker/0:8 Not tainted 5.14.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events l2cap_chan_timeout Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:105 print_address_description.constprop.0.cold+0x6c/0x2d6 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:436 __lock_acquire+0x3d86/0x54a0 kernel/locking/lockdep.c:4885 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x2f/0x40 kernel/locking/spinlock.c:175 spin_lock_bh include/linux/spinlock.h:359 [inline] lock_sock_nested+0x40/0x120 net/core/sock.c:3101 l2cap_sock_teardown_cb+0xa1/0x660 net/bluetooth/l2cap_sock.c:1528 l2cap_chan_del+0xbc/0xa80 net/bluetooth/l2cap_core.c:622 l2cap_chan_close+0x1b9/0xaf0 net/bluetooth/l2cap_core.c:825 l2cap_chan_timeout+0x17e/0x2f0 net/bluetooth/l2cap_core.c:436 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 worker_thread+0x658/0x11f0 kernel/workqueue.c:2422 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 13687: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0x98/0xc0 mm/kasan/common.c:522 kmalloc_reserve net/core/skbuff.c:355 [inline] __alloc_skb+0xde/0x340 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1112 [inline] alloc_skb_with_frags+0x93/0x620 net/core/skbuff.c:6004 sock_alloc_send_pskb+0x793/0x920 net/core/sock.c:2400 unix_dgram_sendmsg+0x3dc/0x1d40 net/unix/af_unix.c:1676 sock_sendmsg_nosec net/socket.c:702 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:722 sock_write_iter+0x289/0x3c0 net/socket.c:1049 call_write_iter include/linux/fs.h:2114 [inline] new_sync_write+0x426/0x650 fs/read_write.c:518 vfs_write+0x75a/0xa40 fs/read_write.c:605 ksys_write+0x1ee/0x250 fs/read_write.c:658 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 4868: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:360 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xcd/0x100 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:229 [inline] __cache_free mm/slab.c:3445 [inline] kfree+0x106/0x2c0 mm/slab.c:3803 skb_free_head net/core/skbuff.c:654 [inline] skb_release_data+0x627/0x750 net/core/skbuff.c:676 skb_release_all net/core/skbuff.c:730 [inline] __kfree_skb net/core/skbuff.c:744 [inline] consume_skb net/core/skbuff.c:900 [inline] consume_skb+0xc2/0x160 net/core/skbuff.c:894 skb_free_datagram+0x16/0xf0 net/core/datagram.c:325 unix_dgram_recvmsg+0x6ee/0xb60 net/unix/af_unix.c:2185 sock_recvmsg_nosec net/socket.c:936 [inline] sock_recvmsg net/socket.c:954 [inline] sock_recvmsg net/socket.c:950 [inline] ____sys_recvmsg+0x2c4/0x600 net/socket.c:2604 ___sys_recvmsg+0x127/0x200 net/socket.c:2646 __sys_recvmsg+0xe2/0x1a0 net/socket.c:2676 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88808b720000 which belongs to the cache kmalloc-cg-512 of size 512 The buggy address is located 160 bytes inside of 512-byte region [ffff88808b720000, ffff88808b720200) The buggy address belongs to the page: page:ffffea00022dc800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x8b720 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea000232be48 ffffea0000871e88 ffff888010843a00 raw: 0000000000000000 ffff88808b720000 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2c20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_THISNODE), pid 15046, ts 376176451660, free_ts 376170716377 prep_new_page mm/page_alloc.c:2433 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4166 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5374 __alloc_pages_node include/linux/gfp.h:570 [inline] kmem_getpages mm/slab.c:1377 [inline] cache_grow_begin+0x75/0x460 mm/slab.c:2593 cache_alloc_refill+0x27f/0x380 mm/slab.c:2965 ____cache_alloc mm/slab.c:3048 [inline] ____cache_alloc mm/slab.c:3031 [inline] slab_alloc_node mm/slab.c:3249 [inline] kmem_cache_alloc_node_trace+0x4ca/0x5d0 mm/slab.c:3617 __do_kmalloc_node mm/slab.c:3639 [inline] __kmalloc_node_track_caller+0x38/0x60 mm/slab.c:3654 kmalloc_reserve net/core/skbuff.c:355 [inline] __alloc_skb+0xde/0x340 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1112 [inline] alloc_skb_with_frags+0x93/0x620 net/core/skbuff.c:6004 sock_alloc_send_pskb+0x793/0x920 net/core/sock.c:2400 unix_dgram_sendmsg+0x3dc/0x1d40 net/unix/af_unix.c:1676 unix_seqpacket_sendmsg+0x111/0x1a0 net/unix/af_unix.c:2060 sock_sendmsg_nosec net/socket.c:702 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:722 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2385 __sys_sendmsg_sock+0x26/0x30 net/socket.c:2451 io_sendmsg+0x489/0x640 fs/io_uring.c:4363 io_issue_sqe+0x11ee/0x6920 fs/io_uring.c:6153 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1343 [inline] free_pcp_prepare+0x2c5/0x780 mm/page_alloc.c:1394 free_unref_page_prepare mm/page_alloc.c:3329 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3408 slab_destroy mm/slab.c:1627 [inline] slabs_destroy+0x89/0xc0 mm/slab.c:1647 cache_flusharray mm/slab.c:3418 [inline] ___cache_free+0x4ba/0x600 mm/slab.c:3480 qlink_free mm/kasan/quarantine.c:146 [inline] qlist_free_all+0x4e/0x110 mm/kasan/quarantine.c:165 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x8b/0xa0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slab.h:512 [inline] slab_alloc mm/slab.c:3323 [inline] __do_kmalloc mm/slab.c:3700 [inline] __kmalloc+0x284/0x4d0 mm/slab.c:3711 kmalloc include/linux/slab.h:596 [inline] tomoyo_realpath_from_path+0xc3/0x620 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x21b/0x400 security/tomoyo/file.c:822 security_inode_getattr+0xcf/0x140 security/security.c:1332 vfs_getattr fs/stat.c:139 [inline] vfs_statx+0x164/0x390 fs/stat.c:207 vfs_fstatat fs/stat.c:225 [inline] vfs_lstat include/linux/fs.h:3386 [inline] __do_sys_newlstat+0x91/0x110 fs/stat.c:380 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff88808b71ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88808b720000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88808b720080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808b720100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808b720180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================