Hello,
syzbot found the following crash on:
HEAD commit: 64f46940 Linux 4.19.62
git tree: linux-4.19.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=151064ec600000
kernel config:
https://syzkaller.appspot.com/x/.config?x=5a320a3fedf4c460
dashboard link:
https://syzkaller.appspot.com/bug?extid=b92eb4b74ca4c06dec76
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+b92eb4...@syzkaller.appspotmail.com
Bluetooth: hci0: sending frame failed (-49)
Bluetooth: hci0: command 0x1001 tx timeout
Bluetooth: hci0: sending frame failed (-49)
Bluetooth: hci0: command 0x1009 tx timeout
==================================================================
BUG: KASAN: use-after-free in atomic_read
include/asm-generic/atomic-instrumented.h:21 [inline]
BUG: KASAN: use-after-free in refcount_read include/linux/refcount.h:43
[inline]
BUG: KASAN: use-after-free in skb_unref include/linux/skbuff.h:967 [inline]
BUG: KASAN: use-after-free in kfree_skb+0x38/0x390 net/core/skbuff.c:659
Read of size 4 at addr ffff88808facbce4 by task syz-executor.0/12252
CPU: 1 PID: 12252 Comm: syz-executor.0 Not tainted 4.19.62 #36
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:256
kasan_report_error mm/kasan/report.c:354 [inline]
kasan_report mm/kasan/report.c:412 [inline]
kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:396
check_memory_region_inline mm/kasan/kasan.c:260 [inline]
check_memory_region+0x123/0x190 mm/kasan/kasan.c:267
kasan_check_read+0x11/0x20 mm/kasan/kasan.c:272
atomic_read include/asm-generic/atomic-instrumented.h:21 [inline]
refcount_read include/linux/refcount.h:43 [inline]
skb_unref include/linux/skbuff.h:967 [inline]
kfree_skb+0x38/0x390 net/core/skbuff.c:659
bcsp_close+0xc7/0x130 drivers/bluetooth/hci_bcsp.c:763
hci_uart_tty_close+0x1ea/0x250 drivers/bluetooth/hci_ldisc.c:542
tty_ldisc_close.isra.0+0xaf/0xe0 drivers/tty/tty_ldisc.c:486
tty_ldisc_kill+0x4b/0xc0 drivers/tty/tty_ldisc.c:632
tty_ldisc_release+0xc6/0x280 drivers/tty/tty_ldisc.c:799
tty_release_struct+0x1b/0x50 drivers/tty/tty_io.c:1611
tty_release+0xbcb/0xe90 drivers/tty/tty_io.c:1784
__fput+0x2dd/0x8b0 fs/file_table.c:278
____fput+0x16/0x20 fs/file_table.c:309
task_work_run+0x145/0x1c0 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:193 [inline]
exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:167
prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline]
syscall_return_slowpath arch/x86/entry/common.c:271 [inline]
do_syscall_64+0x53d/0x620 arch/x86/entry/common.c:296
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x413511
Code: 75 14 b8 03 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 04 1b 00 00 c3 48
83 ec 08 e8 0a fc ff ff 48 89 04 24 b8 03 00 00 00 0f 05 <48> 8b 3c 24 48
89 c2 e8 53 fc ff ff 48 89 d0 48 83 c4 08 48 3d 01
RSP: 002b:00007ffcd2865940 EFLAGS: 00000293 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000005 RCX: 0000000000413511
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 0000000000000001 R08: 00000000f58711af R09: 0000000092eccc80
R10: 00007ffcd2865a20 R11: 0000000000000293 R12: 000000000075c9a0
R13: 000000000075c9a0 R14: 00000000007605c0 R15: ffffffffffffffff
Allocated by task 23:
save_stack+0x45/0xd0 mm/kasan/kasan.c:448
set_track mm/kasan/kasan.c:460 [inline]
kasan_kmalloc mm/kasan/kasan.c:553 [inline]
kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:531
kasan_slab_alloc+0xf/0x20 mm/kasan/kasan.c:490
kmem_cache_alloc_node+0x144/0x710 mm/slab.c:3649
__alloc_skb+0xd5/0x5f0 net/core/skbuff.c:193
alloc_skb include/linux/skbuff.h:995 [inline]
bt_skb_alloc include/net/bluetooth/bluetooth.h:339 [inline]
bcsp_recv+0x8c7/0x13a0 drivers/bluetooth/hci_bcsp.c:685
hci_uart_tty_receive+0x225/0x530 drivers/bluetooth/hci_ldisc.c:607
tty_ldisc_receive_buf+0x15f/0x1c0 drivers/tty/tty_buffer.c:460
tty_port_default_receive_buf+0x7d/0xb0 drivers/tty/tty_port.c:38
receive_buf drivers/tty/tty_buffer.c:476 [inline]
flush_to_ldisc+0x222/0x390 drivers/tty/tty_buffer.c:528
process_one_work+0x989/0x1750 kernel/workqueue.c:2153
worker_thread+0x98/0xe40 kernel/workqueue.c:2296
kthread+0x354/0x420 kernel/kthread.c:246
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415
Freed by task 23:
save_stack+0x45/0xd0 mm/kasan/kasan.c:448
set_track mm/kasan/kasan.c:460 [inline]
__kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521
kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528
__cache_free mm/slab.c:3503 [inline]
kmem_cache_free+0x86/0x260 mm/slab.c:3765
kfree_skbmem net/core/skbuff.c:586 [inline]
kfree_skbmem+0xcb/0x150 net/core/skbuff.c:580
__kfree_skb net/core/skbuff.c:646 [inline]
kfree_skb net/core/skbuff.c:663 [inline]
kfree_skb+0xf0/0x390 net/core/skbuff.c:657
bcsp_recv+0x2d8/0x13a0 drivers/bluetooth/hci_bcsp.c:623
hci_uart_tty_receive+0x225/0x530 drivers/bluetooth/hci_ldisc.c:607
tty_ldisc_receive_buf+0x15f/0x1c0 drivers/tty/tty_buffer.c:460
tty_port_default_receive_buf+0x7d/0xb0 drivers/tty/tty_port.c:38
receive_buf drivers/tty/tty_buffer.c:476 [inline]
flush_to_ldisc+0x222/0x390 drivers/tty/tty_buffer.c:528
process_one_work+0x989/0x1750 kernel/workqueue.c:2153
worker_thread+0x98/0xe40 kernel/workqueue.c:2296
kthread+0x354/0x420 kernel/kthread.c:246
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415
The buggy address belongs to the object at ffff88808facbc00
which belongs to the cache skbuff_head_cache of size 232
The buggy address is located 228 bytes inside of
232-byte region [ffff88808facbc00, ffff88808facbce8)
The buggy address belongs to the page:
page:ffffea00023eb2c0 count:1 mapcount:0 mapping:ffff8880aa18b780
index:0xffff88808facb840
flags: 0x1fffc0000000100(slab)
raw: 01fffc0000000100 ffffea0002825e48 ffffea00023c6f48 ffff8880aa18b780
raw: ffff88808facb840 ffff88808facb0c0 0000000100000005 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88808facbb80: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc
ffff88808facbc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
> ffff88808facbc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
^
ffff88808facbd00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
ffff88808facbd80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb