Hello,
syzbot found the following crash on:
HEAD commit: e0f8b8a6 Linux 4.14.170
git tree: linux-4.14.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=11d9cca1e00000
kernel config:
https://syzkaller.appspot.com/x/.config?x=633dd9db249084f5
dashboard link:
https://syzkaller.appspot.com/bug?extid=b70b68318b213bb8c149
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro:
https://syzkaller.appspot.com/x/repro.syz?x=17ed7431e00000
C reproducer:
https://syzkaller.appspot.com/x/repro.c?x=14378301e00000
IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by:
syzbot+b70b68...@syzkaller.appspotmail.com
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
==================================================================
BUG: KASAN: use-after-free in l2cap_chan_close+0x540/0x830 net/bluetooth/l2cap_core.c:727
Read of size 1 at addr ffff8880a80f8160 by task kworker/0:0/3
CPU: 0 PID: 3 Comm: kworker/0:0 Not tainted 4.14.170-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events do_enable_set
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
l2cap_chan_close+0x540/0x830 net/bluetooth/l2cap_core.c:727
do_enable_set+0x48f/0x840 net/bluetooth/6lowpan.c:1086
process_one_work+0x863/0x1600 kernel/workqueue.c:2114
worker_thread+0x5d9/0x1050 kernel/workqueue.c:2248
kthread+0x319/0x430 kernel/kthread.c:232
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404
Allocated by task 7497:
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]
l2cap_chan_create+0x43/0x3c0 net/bluetooth/l2cap_core.c:441
chan_create+0x10/0xe0 net/bluetooth/6lowpan.c:652
bt_6lowpan_listen net/bluetooth/6lowpan.c:971 [inline]
do_enable_set+0x4c6/0x840 net/bluetooth/6lowpan.c:1090
process_one_work+0x863/0x1600 kernel/workqueue.c:2114
worker_thread+0x5d9/0x1050 kernel/workqueue.c:2248
kthread+0x319/0x430 kernel/kthread.c:232
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404
Freed by task 7497:
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
l2cap_chan_destroy+0x141/0x1b0 net/bluetooth/l2cap_core.c:479
kref_put include/linux/kref.h:70 [inline]
l2cap_chan_put+0x2c/0x40 net/bluetooth/l2cap_core.c:493
do_enable_set+0x49b/0x840 net/bluetooth/6lowpan.c:1087
process_one_work+0x863/0x1600 kernel/workqueue.c:2114
worker_thread+0x5d9/0x1050 kernel/workqueue.c:2248
kthread+0x319/0x430 kernel/kthread.c:232
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404
The buggy address belongs to the object at ffff8880a80f8140
which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 32 bytes inside of
2048-byte region [ffff8880a80f8140, ffff8880a80f8940)
The buggy address belongs to the page:
page:ffffea0002a03e00 count:1 mapcount:0 mapping:ffff8880a80f8140 index:0x0 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffff8880a80f8140 0000000000000000 0000000100000003
raw: ffffea0002a3dd20 ffffea0002a22a20 ffff8880aa800c40 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff8880a80f8000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880a80f8080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880a80f8100: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
^
ffff8880a80f8180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880a80f8200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
IPv6: ADDRCONF(NETDEV_UP): batadv_slave_0: link is not ready
batman_adv: batadv0: Interface activated: batadv_slave_0
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
IPv6: ADDRCONF(NETDEV_UP): batadv_slave_1: link is not ready
batman_adv: batadv0: Interface activated: batadv_slave_1