================================================================== 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 ffff88809ae5ae04 by task syz-executor.5/1771 CPU: 0 PID: 1771 Comm: syz-executor.5 Not tainted 5.1.0-rc7+ #2 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:1840 __do_sys_connect net/socket.c:1851 [inline] __se_sys_connect net/socket.c:1848 [inline] __x64_sys_connect+0x73/0xb0 net/socket.c:1848 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:00007f9576953c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000458da9 RDX: 000000000000000e RSI: 0000000020000080 RDI: 0000000000000004 RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f95769546d4 R13: 00000000004bf184 R14: 00000000004d0218 R15: 00000000ffffffff Allocated by task 31765: 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_slab_alloc+0xf/0x20 mm/kasan/common.c:505 slab_post_alloc_hook mm/slab.h:437 [inline] slab_alloc mm/slab.c:3393 [inline] kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3555 kmem_cache_zalloc include/linux/slab.h:732 [inline] __proc_create+0x2c9/0x860 fs/proc/generic.c:408 proc_create_reg+0xba/0x180 fs/proc/generic.c:528 proc_create_data+0x9d/0x120 fs/proc/generic.c:544 create_cache_proc_entries net/sunrpc/cache.c:1676 [inline] cache_register_net+0x334/0x5e0 net/sunrpc/cache.c:1703 nfsd_export_init+0x1f4/0x480 fs/nfsd/export.c:1239 nfsd_init_net+0x16f/0x4b0 fs/nfsd/nfsctl.c:1236 ops_init+0xb6/0x410 net/core/net_namespace.c:129 setup_net+0x2d3/0x740 net/core/net_namespace.c:315 copy_net_ns+0x1df/0x340 net/core/net_namespace.c:438 create_new_namespaces+0x400/0x7b0 kernel/nsproxy.c:107 unshare_nsproxy_namespaces+0xc2/0x200 kernel/nsproxy.c:206 ksys_unshare+0x440/0x980 kernel/fork.c:2549 __do_sys_unshare kernel/fork.c:2617 [inline] __se_sys_unshare kernel/fork.c:2615 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:2615 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 22023: 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] kmem_cache_free+0x86/0x260 mm/slab.c:3765 pde_free+0xb5/0x110 fs/proc/generic.c:42 pde_put fs/proc/generic.c:647 [inline] pde_put+0x87/0xa0 fs/proc/generic.c:643 remove_proc_subtree+0x211/0x310 fs/proc/generic.c:725 proc_remove fs/proc/generic.c:745 [inline] proc_remove+0x6a/0x90 fs/proc/generic.c:742 remove_cache_proc_entries net/sunrpc/cache.c:1648 [inline] cache_unregister_net+0x4b/0xa0 net/sunrpc/cache.c:1712 nfsd_export_shutdown+0x1e9/0x37d fs/nfsd/export.c:1285 nfsd_exit_net+0x1e/0x30 fs/nfsd/nfsctl.c:1262 ops_exit_list.isra.0+0xb0/0x160 net/core/net_namespace.c:153 cleanup_net+0x3fb/0x960 net/core/net_namespace.c:552 process_one_work+0x98e/0x1790 kernel/workqueue.c:2269 worker_thread+0x98/0xe40 kernel/workqueue.c:2415 kthread+0x357/0x430 kernel/kthread.c:253 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 The buggy address belongs to the object at ffff88809ae5adc0 which belongs to the cache proc_dir_entry of size 256 The buggy address is located 68 bytes inside of 256-byte region [ffff88809ae5adc0, ffff88809ae5aec0) The buggy address belongs to the page: page:ffffea00026b9680 count:1 mapcount:0 mapping:ffff88821bc45b00 index:0xffff88809ae5ab40 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea00027bfc88 ffffea0001a671c8 ffff88821bc45b00 raw: ffff88809ae5ab40 ffff88809ae5a000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809ae5ad00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809ae5ad80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff88809ae5ae00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809ae5ae80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88809ae5af00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================