================================================================== BUG: KASAN: use-after-free in rfcomm_dlc_get net/bluetooth/rfcomm/core.c:360 [inline] BUG: KASAN: use-after-free in __rfcomm_dlc_open net/bluetooth/rfcomm/core.c:396 [inline] BUG: KASAN: use-after-free in rfcomm_dlc_open+0xc85/0xd60 net/bluetooth/rfcomm/core.c:431 Read of size 1 at addr ffff8880936eb204 by task syz-executor.5/11203 CPU: 0 PID: 11203 Comm: syz-executor.5 Not tainted 5.1.0-rc6+ #183 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+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 __asan_report_load1_noabort+0x14/0x20 mm/kasan/generic_report.c:129 rfcomm_dlc_get net/bluetooth/rfcomm/core.c:360 [inline] __rfcomm_dlc_open net/bluetooth/rfcomm/core.c:396 [inline] rfcomm_dlc_open+0xc85/0xd60 net/bluetooth/rfcomm/core.c:431 rfcomm_sock_connect+0x38a/0x4b0 net/bluetooth/rfcomm/sock.c:416 __sys_connect+0x266/0x330 net/socket.c:1808 __do_sys_connect net/socket.c:1819 [inline] __se_sys_connect net/socket.c:1816 [inline] __x64_sys_connect+0x73/0xb0 net/socket.c:1816 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x458da9 Code: ad b8 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 b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007efd8b269c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000458da9 RDX: 000000000000000e RSI: 0000000020000140 RDI: 0000000000000005 RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007efd8b26a6d4 R13: 00000000004bf18a R14: 00000000004d0218 R15: 00000000ffffffff Allocated by task 9006: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_kmalloc mm/kasan/common.c:497 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:470 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:511 __do_kmalloc_node mm/slab.c:3687 [inline] __kmalloc_node_track_caller+0x4e/0x70 mm/slab.c:3701 __kmalloc_reserve.isra.0+0x40/0xf0 net/core/skbuff.c:140 __alloc_skb+0x10b/0x5e0 net/core/skbuff.c:208 alloc_skb include/linux/skbuff.h:1058 [inline] alloc_skb_with_frags+0x93/0x580 net/core/skbuff.c:5295 sock_alloc_send_pskb+0x72d/0x8a0 net/core/sock.c:2220 sock_alloc_send_skb+0x32/0x40 net/core/sock.c:2237 __ip_append_data.isra.0+0x19ab/0x2de0 net/ipv4/ip_output.c:998 ip_make_skb+0x249/0x2c0 net/ipv4/ip_output.c:1531 udp_sendmsg+0x1db0/0x2820 net/ipv4/udp.c:1183 inet_sendmsg+0x147/0x5d0 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xdd/0x130 net/socket.c:661 ___sys_sendmsg+0x3e2/0x930 net/socket.c:2260 __sys_sendmmsg+0x1bf/0x4d0 net/socket.c:2355 __do_sys_sendmmsg net/socket.c:2384 [inline] __se_sys_sendmmsg net/socket.c:2381 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2381 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 9059: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:459 kasan_slab_free+0xe/0x10 mm/kasan/common.c:467 __cache_free mm/slab.c:3499 [inline] kfree+0xcf/0x230 mm/slab.c:3822 skb_free_head+0x93/0xb0 net/core/skbuff.c:557 skb_release_data+0x576/0x7a0 net/core/skbuff.c:577 skb_release_all+0x4d/0x60 net/core/skbuff.c:631 __kfree_skb net/core/skbuff.c:645 [inline] consume_skb net/core/skbuff.c:705 [inline] consume_skb+0xe2/0x380 net/core/skbuff.c:699 tun_do_read+0xbee/0x1cb0 drivers/net/tun.c:2237 tun_chr_read_iter+0xe4/0x1e0 drivers/net/tun.c:2252 call_read_iter include/linux/fs.h:1860 [inline] new_sync_read+0x4c4/0x740 fs/read_write.c:406 __vfs_read+0xe4/0x110 fs/read_write.c:418 vfs_read+0x194/0x3e0 fs/read_write.c:452 ksys_read+0x14f/0x2d0 fs/read_write.c:579 __do_sys_read fs/read_write.c:589 [inline] __se_sys_read fs/read_write.c:587 [inline] __x64_sys_read+0x73/0xb0 fs/read_write.c:587 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880936eb0c0 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 324 bytes inside of 512-byte region [ffff8880936eb0c0, ffff8880936eb2c0) The buggy address belongs to the page: page:ffffea00024dbac0 count:1 mapcount:0 mapping:ffff88812c3f0940 index:0xffff8880936eb840 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0002a5aec8 ffffea0001864b48 ffff88812c3f0940 raw: ffff8880936eb840 ffff8880936eb0c0 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880936eb100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880936eb180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880936eb200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880936eb280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880936eb300: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ==================================================================