KASAN: use-after-free Read in rfcomm_dlc_open (2)
From: syzbot
Date: Tue Apr 23 2019 - 12:22:12 EST
Hello,
syzbot found the following crash on:
HEAD commit: 432bc230 Merge branch 'hsr-next'
git tree: net-next
console output: https://syzkaller.appspot.com/x/log.txt?x=169eb223200000
kernel config: https://syzkaller.appspot.com/x/.config?x=4f97fc6e35679794
dashboard link: https://syzkaller.appspot.com/bug?extid=0b0fd24d40f358830891
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
Unfortunately, I don't have any reproducer for this crash yet.
IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+0b0fd24d40f358830891@xxxxxxxxxxxxxxxxxxxxxxxxx
==================================================================
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 ffff888096921444 by task syz-executor.1/12781
CPU: 1 PID: 12781 Comm: syz-executor.1 Not tainted 5.1.0-rc4+ #140
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:0x458c29
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:00007f730c7eac78 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000458c29
RDX: 000000000000000e RSI: 0000000020000040 RDI: 0000000000000004
RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f730c7eb6d4
R13: 00000000004beff7 R14: 00000000004d0098 R15: 00000000ffffffff
Allocated by task 12282:
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:3688 [inline]
__kmalloc_node_track_caller+0x4e/0x70 mm/slab.c:3702
__kmalloc_reserve.isra.0+0x40/0xf0 net/core/skbuff.c:142
__alloc_skb+0x10b/0x5e0 net/core/skbuff.c:210
alloc_skb include/linux/skbuff.h:1056 [inline]
netlink_alloc_large_skb net/netlink/af_netlink.c:1182 [inline]
netlink_sendmsg+0x97b/0xd70 net/netlink/af_netlink.c:1900
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 12282:
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:3500 [inline]
kfree+0xcf/0x230 mm/slab.c:3823
skb_free_head+0x93/0xb0 net/core/skbuff.c:559
skb_release_data+0x576/0x7a0 net/core/skbuff.c:579
skb_release_all+0x4d/0x60 net/core/skbuff.c:633
__kfree_skb net/core/skbuff.c:647 [inline]
consume_skb net/core/skbuff.c:707 [inline]
consume_skb+0xe2/0x380 net/core/skbuff.c:701
netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline]
netlink_unicast+0x53e/0x720 net/netlink/af_netlink.c:1336
netlink_sendmsg+0x8ae/0xd70 net/netlink/af_netlink.c:1925
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
The buggy address belongs to the object at ffff888096921300
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 324 bytes inside of
512-byte region [ffff888096921300, ffff888096921500)
The buggy address belongs to the page:
page:ffffea00025a4840 count:1 mapcount:0 mapping:ffff88812c3f0940
index:0xffff888096921d00
flags: 0x1fffc0000000200(slab)
raw: 01fffc0000000200 ffffea000285acc8 ffffea00021aaa88 ffff88812c3f0940
raw: ffff888096921d00 ffff888096921080 0000000100000003 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff888096921300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888096921380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888096921400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888096921480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888096921500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@xxxxxxxxxxxxxxxxx
syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.