================================================================== BUG: KASAN: use-after-free in rfcomm_dlc_get net/bluetooth/rfcomm/core.c:360 [inline] BUG: KASAN: use-after-free in rfcomm_dlc_exists+0x17d/0x1a0 net/bluetooth/rfcomm/core.c:550 Read of size 1 at addr ffff88801ec52144 by task syz-executor.2/4139 CPU: 1 PID: 4139 Comm: syz-executor.2 Not tainted 5.5.0-rc6-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x197/0x210 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374 __kasan_report.cold+0x1b/0x41 mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:639 __asan_report_load1_noabort+0x14/0x20 mm/kasan/generic_report.c:132 rfcomm_dlc_get net/bluetooth/rfcomm/core.c:360 [inline] rfcomm_dlc_exists+0x17d/0x1a0 net/bluetooth/rfcomm/core.c:550 __rfcomm_create_dev net/bluetooth/rfcomm/tty.c:413 [inline] rfcomm_create_dev net/bluetooth/rfcomm/tty.c:486 [inline] rfcomm_dev_ioctl+0x9ff/0x1e80 net/bluetooth/rfcomm/tty.c:588 rfcomm_sock_ioctl+0x90/0xb0 net/bluetooth/rfcomm/sock.c:902 rfcomm_sock_compat_ioctl+0x24/0x30 net/bluetooth/rfcomm/sock.c:915 compat_sock_ioctl+0x169/0x2240 net/socket.c:3568 __do_compat_sys_ioctl fs/compat_ioctl.c:214 [inline] __se_compat_sys_ioctl fs/compat_ioctl.c:142 [inline] __ia32_compat_sys_ioctl+0x233/0x610 fs/compat_ioctl.c:142 do_syscall_32_irqs_on arch/x86/entry/common.c:337 [inline] do_fast_syscall_32+0x27b/0xe16 arch/x86/entry/common.c:408 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 RIP: 0023:0xf7f2ea39 Code: 00 00 00 89 d3 5b 5e 5f 5d c3 b8 80 96 98 00 eb c4 8b 04 24 c3 8b 1c 24 c3 8b 34 24 c3 8b 3c 24 c3 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 002b:00000000f5d2a0cc EFLAGS: 00000296 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00000000400452c8 RDX: 0000000020000100 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 19501: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:486 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:527 kmem_cache_alloc_trace+0x158/0x790 mm/slab.c:3551 kmalloc include/linux/slab.h:556 [inline] kzalloc include/linux/slab.h:670 [inline] rfcomm_dlc_alloc+0x82/0x410 net/bluetooth/rfcomm/core.c:305 rfcomm_sock_alloc.constprop.0+0xb3/0x370 net/bluetooth/rfcomm/sock.c:286 rfcomm_sock_create+0xf3/0x2b0 net/bluetooth/rfcomm/sock.c:329 bt_sock_create+0x16a/0x2d0 net/bluetooth/af_bluetooth.c:130 __sock_create+0x3ce/0x730 net/socket.c:1420 sock_create net/socket.c:1471 [inline] __sys_socket+0x103/0x220 net/socket.c:1513 __do_sys_socket net/socket.c:1522 [inline] __se_sys_socket net/socket.c:1520 [inline] __ia32_sys_socket+0x73/0xb0 net/socket.c:1520 do_syscall_32_irqs_on arch/x86/entry/common.c:337 [inline] do_fast_syscall_32+0x27b/0xe16 arch/x86/entry/common.c:408 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 Freed by task 4134: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:335 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:474 kasan_slab_free+0xe/0x10 mm/kasan/common.c:483 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x2c0 mm/slab.c:3757 rfcomm_dlc_free+0x20/0x30 net/bluetooth/rfcomm/core.c:328 rfcomm_dlc_put include/net/bluetooth/rfcomm.h:258 [inline] __rfcomm_create_dev net/bluetooth/rfcomm/tty.c:417 [inline] rfcomm_create_dev net/bluetooth/rfcomm/tty.c:486 [inline] rfcomm_dev_ioctl+0x1b9d/0x1e80 net/bluetooth/rfcomm/tty.c:588 rfcomm_sock_ioctl+0x90/0xb0 net/bluetooth/rfcomm/sock.c:902 rfcomm_sock_compat_ioctl+0x24/0x30 net/bluetooth/rfcomm/sock.c:915 compat_sock_ioctl+0x169/0x2240 net/socket.c:3568 __do_compat_sys_ioctl fs/compat_ioctl.c:214 [inline] __se_compat_sys_ioctl fs/compat_ioctl.c:142 [inline] __ia32_compat_sys_ioctl+0x233/0x610 fs/compat_ioctl.c:142 do_syscall_32_irqs_on arch/x86/entry/common.c:337 [inline] do_fast_syscall_32+0x27b/0xe16 arch/x86/entry/common.c:408 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 The buggy address belongs to the object at ffff88801ec52000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 324 bytes inside of 512-byte region [ffff88801ec52000, ffff88801ec52200) The buggy address belongs to the page: page:ffffea00007b1480 refcount:1 mapcount:0 mapping:ffff88802cc00a80 index:0xffff88801ec52800 raw: 00fffe0000000200 ffffea00008d3588 ffffea000072c308 ffff88802cc00a80 raw: ffff88801ec52800 ffff88801ec52000 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88801ec52000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801ec52080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88801ec52100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801ec52180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801ec52200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================