================================================================== 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+0x152/0x170 net/bluetooth/rfcomm/core.c:549 Read of size 1 at addr ffff888063d2a68c by task syz-executor.2/32356 CPU: 1 PID: 32356 Comm: syz-executor.2 Not tainted 4.14.142 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x138/0x197 lib/dump_stack.c:53 print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report mm/kasan/report.c:409 [inline] kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:427 rfcomm_dlc_get net/bluetooth/rfcomm/core.c:360 [inline] rfcomm_dlc_exists+0x152/0x170 net/bluetooth/rfcomm/core.c:549 __rfcomm_create_dev net/bluetooth/rfcomm/tty.c:413 [inline] rfcomm_create_dev net/bluetooth/rfcomm/tty.c:486 [inline] rfcomm_dev_ioctl+0x4a7/0x18b0 net/bluetooth/rfcomm/tty.c:588 rfcomm_sock_ioctl+0x82/0xa0 net/bluetooth/rfcomm/sock.c:902 sock_do_ioctl+0x64/0xb0 net/socket.c:974 sock_ioctl+0x2a6/0x470 net/socket.c:1071 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x7ae/0x1060 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x4598e9 RSP: 002b:00007f92bdd0dc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00000000004598e9 RDX: 0000000020000100 RSI: 00000000400452c8 RDI: 0000000000000004 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f92bdd0e6d4 R13: 00000000004c2027 R14: 00000000004d5478 R15: 00000000ffffffff Allocated by task 26276: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x45/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc mm/kasan/kasan.c:551 [inline] kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529 kmem_cache_alloc_trace+0x152/0x790 mm/slab.c:3618 kmalloc include/linux/slab.h:488 [inline] kzalloc include/linux/slab.h:661 [inline] rfcomm_dlc_alloc+0x59/0x440 net/bluetooth/rfcomm/core.c:305 rfcomm_sock_alloc.constprop.0+0xb3/0x360 net/bluetooth/rfcomm/sock.c:285 rfcomm_sock_create+0xdb/0x2a0 net/bluetooth/rfcomm/sock.c:328 bt_sock_create+0x14c/0x2b0 net/bluetooth/af_bluetooth.c:130 __sock_create+0x2f6/0x620 net/socket.c:1275 sock_create net/socket.c:1315 [inline] SYSC_socket net/socket.c:1345 [inline] SyS_socket+0xd3/0x170 net/socket.c:1325 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 32338: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x45/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 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+0x1590/0x18b0 net/bluetooth/rfcomm/tty.c:588 rfcomm_sock_ioctl+0x82/0xa0 net/bluetooth/rfcomm/sock.c:902 sock_do_ioctl+0x64/0xb0 net/socket.c:974 sock_ioctl+0x2a6/0x470 net/socket.c:1071 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x7ae/0x1060 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff888063d2a540 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 332 bytes inside of 512-byte region [ffff888063d2a540, ffff888063d2a740) The buggy address belongs to the page: page:ffffea00018f4a80 count:1 mapcount:0 mapping:ffff888063d2a040 index:0xffff888063d2a040 flags: 0x1fffc0000000100(slab) raw: 01fffc0000000100 ffff888063d2a040 ffff888063d2a040 0000000100000005 raw: ffffea000119b5e0 ffffea0001928160 ffff8880aa800940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888063d2a580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888063d2a600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888063d2a680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888063d2a700: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888063d2a780: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ==================================================================