================================================================== 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 ffff88809b13f8cc by task syz-executor.2/18740 CPU: 0 PID: 18740 Comm: syz-executor.2 Not tainted 4.14.157-syzkaller #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+0x142/0x197 lib/dump_stack.c:58 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+0x4bb/0x1920 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:0x45a679 RSP: 002b:00007ff50c1a7c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045a679 RDX: 0000000020000100 RSI: 00000000400452c8 RDI: 0000000000000004 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff50c1a86d4 R13: 00000000004c31d8 R14: 00000000004d8458 R15: 00000000ffffffff Allocated by task 29834: 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 18740: 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+0x1637/0x1920 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 ffff88809b13f780 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 332 bytes inside of 512-byte region [ffff88809b13f780, ffff88809b13f980) The buggy address belongs to the page: page:ffffea00026c4fc0 count:1 mapcount:0 mapping:ffff88809b13f000 index:0x0 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffff88809b13f000 0000000000000000 0000000100000006 raw: ffffea00020fa2e0 ffffea00028203e0 ffff8880aa800940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809b13f780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809b13f800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88809b13f880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809b13f900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809b13f980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================