================================================================== BUG: KASAN: slab-use-after-free in memcmp lib/string.c:699 [inline] BUG: KASAN: slab-use-after-free in bcmp+0x204/0x230 lib/string.c:720 Read of size 1 at addr ffff88805c2093d6 by task syz.3.339/7618 CPU: 0 PID: 7618 Comm: syz.3.339 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call Trace: dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xa8/0x210 mm/kasan/report.c:468 kasan_report+0x117/0x150 mm/kasan/report.c:581 memcmp lib/string.c:699 [inline] bcmp+0x204/0x230 lib/string.c:720 memcmp include/linux/fortify-string.h:740 [inline] bacmp include/net/bluetooth/bluetooth.h:367 [inline] hci_conn_hash_lookup_ba include/net/bluetooth/hci_core.h:1176 [inline] rfcomm_reparent_device+0x178/0x440 net/bluetooth/rfcomm/tty.c:188 rfcomm_dev_add net/bluetooth/rfcomm/tty.c:339 [inline] __rfcomm_create_dev net/bluetooth/rfcomm/tty.c:424 [inline] rfcomm_create_dev net/bluetooth/rfcomm/tty.c:480 [inline] rfcomm_dev_ioctl+0x17f5/0x1ca0 net/bluetooth/rfcomm/tty.c:582 sock_do_ioctl+0xfc/0x310 net/socket.c:1220 sock_ioctl+0x5be/0x7e0 net/socket.c:1341 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7ff3059a9519 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ff306959028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007ff305c35fa0 RCX: 00007ff3059a9519 RDX: 0000200000000000 RSI: 00000000400452c8 RDI: 0000000000000006 RBP: 00007ff305a39136 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ff305c36038 R14: 00007ff305c35fa0 R15: 00007ffd0daa6448 Allocated by task 7618: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4e/0x70 mm/kasan/common.c:53 ____kasan_kmalloc mm/kasan/common.c:375 [inline] __kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:384 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] __rfcomm_dev_add net/bluetooth/rfcomm/tty.c:224 [inline] rfcomm_dev_add net/bluetooth/rfcomm/tty.c:325 [inline] __rfcomm_create_dev net/bluetooth/rfcomm/tty.c:424 [inline] rfcomm_create_dev net/bluetooth/rfcomm/tty.c:480 [inline] rfcomm_dev_ioctl+0xada/0x1ca0 net/bluetooth/rfcomm/tty.c:582 sock_do_ioctl+0xfc/0x310 net/socket.c:1220 sock_ioctl+0x5be/0x7e0 net/socket.c:1341 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Freed by task 24: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4e/0x70 mm/kasan/common.c:53 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522 ____kasan_slab_free+0x126/0x1f0 mm/kasan/common.c:237 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1839 [inline] slab_free_freelist_hook+0x154/0x240 mm/slub.c:1865 slab_free mm/slub.c:3859 [inline] __kmem_cache_free+0xba/0x1f0 mm/slub.c:3872 rfcomm_dev_destruct+0x25c/0x2d0 net/bluetooth/rfcomm/tty.c:102 release_one_tty+0xae/0x270 drivers/tty/tty_io.c:1531 process_one_work kernel/workqueue.c:2657 [inline] process_scheduled_works+0xa60/0x1600 kernel/workqueue.c:2734 worker_thread+0xa5e/0xfe0 kernel/workqueue.c:2815 kthread+0x2fa/0x390 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293 Last potentially related work creation: kasan_save_stack+0x3e/0x60 mm/kasan/common.c:46 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:492 __call_rcu_common kernel/rcu/tree.c:2689 [inline] call_rcu+0x153/0x900 kernel/rcu/tree.c:2805 netlink_release+0x1692/0x1a80 net/netlink/af_netlink.c:801 __sock_release net/socket.c:659 [inline] sock_close+0xa7/0x210 net/socket.c:1421 __fput+0x221/0x940 fs/file_table.c:418 task_work_run+0x1d4/0x260 kernel/task_work.c:245 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:180 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:213 __syscall_exit_to_user_mode_work kernel/entry/common.c:294 [inline] syscall_exit_to_user_mode+0x1a/0x50 kernel/entry/common.c:305 do_syscall_64+0x61/0xb0 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff88805c209000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 982 bytes inside of freed 2048-byte region [ffff88805c209000, ffff88805c209800) The buggy address belongs to the physical page: page:ffffea0001708200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5c208 head:ffffea0001708200 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888018c42000 dead000000000100 dead000000000122 raw: 0000000000000000 0000000080080008 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5784, tgid 5784 (syz-executor), ts 79886195992, free_ts 24859748276 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1c1/0x200 mm/page_alloc.c:1583 prep_new_page mm/page_alloc.c:1590 [inline] get_page_from_freelist+0x219a/0x22c0 mm/page_alloc.c:3231 __alloc_pages+0x1f0/0x460 mm/page_alloc.c:4511 alloc_slab_page+0x5d/0x180 mm/slub.c:1909 allocate_slab mm/slub.c:2056 [inline] new_slab+0x87/0x2d0 mm/slub.c:2109 ___slab_alloc+0xc5c/0x12f0 mm/slub.c:3281 __slab_alloc mm/slub.c:3367 [inline] __slab_alloc_node mm/slub.c:3420 [inline] slab_alloc_node mm/slub.c:3514 [inline] __kmem_cache_alloc_node+0x122/0x260 mm/slub.c:3563 kmalloc_trace+0x2a/0xe0 mm/slab_common.c:1098 kmalloc include/linux/slab.h:600 [inline] rtnl_newlink+0x10d/0x2170 net/core/rtnetlink.c:3763 rtnetlink_rcv_msg+0x843/0xf90 net/core/rtnetlink.c:6489 netlink_rcv_skb+0x235/0x4c0 net/netlink/af_netlink.c:2562 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x856/0x9e0 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x8d0/0xbf0 net/netlink/af_netlink.c:1903 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] __sys_sendto+0x4a9/0x6b0 net/socket.c:2201 __do_sys_sendto net/socket.c:2213 [inline] __se_sys_sendto net/socket.c:2209 [inline] __x64_sys_sendto+0xde/0xf0 net/socket.c:2209 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1183 [inline] free_unref_page_prepare+0x7d7/0x8f0 mm/page_alloc.c:2374 free_unref_page+0x32/0x2e0 mm/page_alloc.c:2467 free_contig_range+0xa1/0x150 mm/page_alloc.c:6441 destroy_args+0x7d/0x840 mm/debug_vm_pgtable.c:1015 debug_vm_pgtable+0x411/0x440 mm/debug_vm_pgtable.c:1400 do_one_initcall+0x242/0x790 init/main.c:1215 do_initcall_level+0x13d/0x1f0 init/main.c:1277 do_initcalls+0x69/0xd0 init/main.c:1293 kernel_init_freeable+0x3d9/0x560 init/main.c:1530 kernel_init+0x1d/0x1c0 init/main.c:1420 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293 Memory state around the buggy address: ffff88805c209280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805c209300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88805c209380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805c209400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805c209480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================