================================================================== 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+0x2f8/0x350 net/bluetooth/rfcomm/core.c:550 Read of size 1 at addr ffff888095adf144 by task syz-executor.4/11494 CPU: 1 PID: 11494 Comm: syz-executor.4 Not tainted 5.6.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1e9/0x30e lib/dump_stack.c:118 print_address_description+0x74/0x5c0 mm/kasan/report.c:374 __kasan_report+0x14b/0x1c0 mm/kasan/report.c:506 kasan_report+0x25/0x50 mm/kasan/common.c:641 rfcomm_dlc_get net/bluetooth/rfcomm/core.c:360 [inline] rfcomm_dlc_exists+0x2f8/0x350 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+0x93c/0x2340 net/bluetooth/rfcomm/tty.c:588 rfcomm_sock_ioctl+0x79/0xa0 net/bluetooth/rfcomm/sock.c:902 sock_do_ioctl+0x7b/0x260 net/socket.c:1053 sock_ioctl+0x4aa/0x690 net/socket.c:1204 vfs_ioctl fs/ioctl.c:47 [inline] ksys_ioctl fs/ioctl.c:763 [inline] __do_sys_ioctl fs/ioctl.c:772 [inline] __se_sys_ioctl+0xf9/0x160 fs/ioctl.c:770 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45c849 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f28b1964c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f28b19656d4 RCX: 000000000045c849 RDX: 0000000020000100 RSI: 00000000400452c8 RDI: 0000000000000005 RBP: 000000000076bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000316 R14: 00000000004c57dd R15: 000000000076bf0c Allocated by task 9646: save_stack mm/kasan/common.c:72 [inline] set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc+0x118/0x1c0 mm/kasan/common.c:515 kmem_cache_alloc_trace+0x234/0x300 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:669 [inline] rfcomm_dlc_alloc+0x7c/0x380 net/bluetooth/rfcomm/core.c:305 rfcomm_sock_alloc+0xb0/0x2e0 net/bluetooth/rfcomm/sock.c:286 rfcomm_sock_create+0xb4/0x270 net/bluetooth/rfcomm/sock.c:329 bt_sock_create+0x15b/0x220 net/bluetooth/af_bluetooth.c:130 __sock_create+0x5c9/0x8d0 net/socket.c:1433 sock_create net/socket.c:1484 [inline] __sys_socket+0xde/0x2d0 net/socket.c:1526 __do_sys_socket net/socket.c:1535 [inline] __se_sys_socket net/socket.c:1533 [inline] __x64_sys_socket+0x76/0x80 net/socket.c:1533 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 11260: save_stack mm/kasan/common.c:72 [inline] set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:337 [inline] __kasan_slab_free+0x12e/0x1e0 mm/kasan/common.c:476 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x220 mm/slab.c:3757 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+0xe37/0x2340 net/bluetooth/rfcomm/tty.c:588 rfcomm_sock_ioctl+0x79/0xa0 net/bluetooth/rfcomm/sock.c:902 sock_do_ioctl+0x7b/0x260 net/socket.c:1053 sock_ioctl+0x4aa/0x690 net/socket.c:1204 vfs_ioctl fs/ioctl.c:47 [inline] ksys_ioctl fs/ioctl.c:763 [inline] __do_sys_ioctl fs/ioctl.c:772 [inline] __se_sys_ioctl+0xf9/0x160 fs/ioctl.c:770 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888095adf000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 324 bytes inside of 512-byte region [ffff888095adf000, ffff888095adf200) The buggy address belongs to the page: page:ffffea000256b7c0 refcount:1 mapcount:0 mapping:ffff8880aa400a80 index:0xffff888095adf800 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00029fc688 ffffea000243e308 ffff8880aa400a80 raw: ffff888095adf800 ffff888095adf000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888095adf000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888095adf080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888095adf100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888095adf180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888095adf200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================