KASAN: use-after-free Read in l2cap_sock_close_cb

11 visualitzacions
Ves al primer missatge no llegit

syzbot

no llegida,
31 de jul. 2020, 1:53:1931/7/20
a syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: e5a54aa2 Linux 4.14.190
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=12a1d2a2900000
kernel config: https://syzkaller.appspot.com/x/.config?x=dbb53fc7192d83c3
dashboard link: https://syzkaller.appspot.com/bug?extid=161f0e5d0dcee3e5af70
compiler: gcc (GCC) 10.1.0-syz 20200507

Unfortunately, I don't have any reproducer for this issue yet.

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+161f0e...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in constant_test_bit arch/x86/include/asm/bitops.h:328 [inline]
BUG: KASAN: use-after-free in sock_flag include/net/sock.h:810 [inline]
BUG: KASAN: use-after-free in l2cap_sock_kill net/bluetooth/l2cap_sock.c:1047 [inline]
BUG: KASAN: use-after-free in l2cap_sock_close_cb+0xa7/0xb0 net/bluetooth/l2cap_sock.c:1312
Read of size 8 at addr ffff888063ee0ce0 by task kworker/0:1/24

CPU: 0 PID: 24 Comm: kworker/0:1 Not tainted 4.14.190-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events l2cap_chan_timeout
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x1b2/0x283 lib/dump_stack.c:58
print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
kasan_report_error.cold+0x8a/0x194 mm/kasan/report.c:351
kasan_report mm/kasan/report.c:409 [inline]
__asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430
constant_test_bit arch/x86/include/asm/bitops.h:328 [inline]
sock_flag include/net/sock.h:810 [inline]
l2cap_sock_kill net/bluetooth/l2cap_sock.c:1047 [inline]
l2cap_sock_close_cb+0xa7/0xb0 net/bluetooth/l2cap_sock.c:1312
l2cap_chan_timeout+0x182/0x1e0 net/bluetooth/l2cap_core.c:431
process_one_work+0x793/0x14a0 kernel/workqueue.c:2116
worker_thread+0x5cc/0xff0 kernel/workqueue.c:2250
kthread+0x30d/0x420 kernel/kthread.c:232
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

Allocated by task 1870:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
__do_kmalloc mm/slab.c:3720 [inline]
__kmalloc+0x15a/0x400 mm/slab.c:3729
kmalloc include/linux/slab.h:493 [inline]
sk_prot_alloc+0x1ba/0x290 net/core/sock.c:1467
sk_alloc+0x36/0xcd0 net/core/sock.c:1521
l2cap_sock_alloc.constprop.0+0x31/0x210 net/bluetooth/l2cap_sock.c:1591
l2cap_sock_create+0xdd/0x170 net/bluetooth/l2cap_sock.c:1637
bt_sock_create+0x13b/0x280 net/bluetooth/af_bluetooth.c:130
__sock_create+0x303/0x620 net/socket.c:1275
rfcomm_l2sock_create net/bluetooth/rfcomm/core.c:203 [inline]
rfcomm_session_create net/bluetooth/rfcomm/core.c:738 [inline]
__rfcomm_dlc_open net/bluetooth/rfcomm/core.c:388 [inline]
rfcomm_dlc_open+0x6ec/0xc00 net/bluetooth/rfcomm/core.c:431
rfcomm_sock_connect+0x2c6/0x3c0 net/bluetooth/rfcomm/sock.c:415
SYSC_connect net/socket.c:1655 [inline]
SyS_connect+0x1f4/0x240 net/socket.c:1636
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 3544:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
__cache_free mm/slab.c:3496 [inline]
kfree+0xc9/0x250 mm/slab.c:3815
sk_prot_free net/core/sock.c:1504 [inline]
__sk_destruct+0x577/0x6e0 net/core/sock.c:1582
sk_destruct net/core/sock.c:1597 [inline]
__sk_free+0xd9/0x2d0 net/core/sock.c:1605
sk_free+0x2b/0x40 net/core/sock.c:1616
sock_put include/net/sock.h:1658 [inline]
l2cap_sock_kill.part.0+0x5b/0x70 net/bluetooth/l2cap_sock.c:1056
l2cap_sock_kill net/bluetooth/l2cap_sock.c:1207 [inline]
l2cap_sock_release+0x146/0x180 net/bluetooth/l2cap_sock.c:1205
__sock_release net/socket.c:602 [inline]
sock_release+0x87/0x1e0 net/socket.c:623
rfcomm_session_del+0x14f/0x1e0 net/bluetooth/rfcomm/core.c:684
rfcomm_session_close net/bluetooth/rfcomm/core.c:723 [inline]
rfcomm_process_rx net/bluetooth/rfcomm/core.c:1916 [inline]
rfcomm_process_sessions net/bluetooth/rfcomm/core.c:2000 [inline]
rfcomm_run+0x1127/0x3ca0 net/bluetooth/rfcomm/core.c:2087
kthread+0x30d/0x420 kernel/kthread.c:232
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

The buggy address belongs to the object at ffff888063ee0c80
which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 96 bytes inside of
2048-byte region [ffff888063ee0c80, ffff888063ee1480)
The buggy address belongs to the page:
page:ffffea00018fb800 count:1 mapcount:0 mapping:ffff888063ee0400 index:0xffff888063ee0400 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffff888063ee0400 ffff888063ee0400 0000000100000002
raw: ffffea00020b86a0 ffffea00025c86a0 ffff88812fe52c40 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff888063ee0b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888063ee0c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888063ee0c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888063ee0d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888063ee0d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This report 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 syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

no llegida,
1 d’ag. 2020, 17:47:161/8/20
a syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 13af6c74 Linux 4.19.136
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=11834598900000
kernel config: https://syzkaller.appspot.com/x/.config?x=5b7578d3b5457a49
dashboard link: https://syzkaller.appspot.com/bug?extid=0fe4efc137563eac3894
compiler: gcc (GCC) 10.1.0-syz 20200507

Unfortunately, I don't have any reproducer for this issue yet.

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+0fe4ef...@syzkaller.appspotmail.com

CR3 = 0x0000000000000000
RSP = 0x0000000000000f80 RIP = 0x0000000000000000
RFLAGS=0x00000002 DR7 = 0x0000000000000400
==================================================================
BUG: KASAN: use-after-free in constant_test_bit arch/x86/include/asm/bitops.h:317 [inline]
BUG: KASAN: use-after-free in sock_flag include/net/sock.h:839 [inline]
BUG: KASAN: use-after-free in l2cap_sock_kill net/bluetooth/l2cap_sock.c:1046 [inline]
BUG: KASAN: use-after-free in l2cap_sock_close_cb+0xbd/0xd0 net/bluetooth/l2cap_sock.c:1311
Read of size 8 at addr ffff888096dc4d20 by task kworker/0:0/5

CPU: 0 PID: 5 Comm: kworker/0:0 Not tainted 4.19.136-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events l2cap_chan_timeout
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fc/0x2fe lib/dump_stack.c:118
print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
kasan_report_error.cold+0x8a/0x1c7 mm/kasan/report.c:354
kasan_report mm/kasan/report.c:412 [inline]
__asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433
constant_test_bit arch/x86/include/asm/bitops.h:317 [inline]
sock_flag include/net/sock.h:839 [inline]
l2cap_sock_kill net/bluetooth/l2cap_sock.c:1046 [inline]
l2cap_sock_close_cb+0xbd/0xd0 net/bluetooth/l2cap_sock.c:1311
l2cap_chan_timeout+0x1bb/0x210 net/bluetooth/l2cap_core.c:431
process_one_work+0x864/0x1570 kernel/workqueue.c:2155
worker_thread+0x64c/0x1130 kernel/workqueue.c:2298
kthread+0x30b/0x410 kernel/kthread.c:246
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

Allocated by task 23936:
__do_kmalloc mm/slab.c:3727 [inline]
__kmalloc+0x15a/0x3c0 mm/slab.c:3736
kmalloc include/linux/slab.h:520 [inline]
sk_prot_alloc+0x1e2/0x2d0 net/core/sock.c:1466
sk_alloc+0x36/0xec0 net/core/sock.c:1520
l2cap_sock_alloc.constprop.0+0x31/0x210 net/bluetooth/l2cap_sock.c:1590
l2cap_sock_create+0x110/0x1b0 net/bluetooth/l2cap_sock.c:1636
bt_sock_create+0x154/0x2a0 net/bluetooth/af_bluetooth.c:130
__sock_create+0x3d8/0x740 net/socket.c:1276
rfcomm_l2sock_create net/bluetooth/rfcomm/core.c:203 [inline]
rfcomm_session_create net/bluetooth/rfcomm/core.c:738 [inline]
__rfcomm_dlc_open net/bluetooth/rfcomm/core.c:388 [inline]
rfcomm_dlc_open+0x6e2/0xcb0 net/bluetooth/rfcomm/core.c:431
rfcomm_sock_connect+0x317/0x420 net/bluetooth/rfcomm/sock.c:416
__sys_connect+0x265/0x2c0 net/socket.c:1663
__do_sys_connect net/socket.c:1674 [inline]
__se_sys_connect net/socket.c:1671 [inline]
__x64_sys_connect+0x6f/0xb0 net/socket.c:1671
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 3597:
__cache_free mm/slab.c:3503 [inline]
kfree+0xcc/0x210 mm/slab.c:3822
sk_prot_free net/core/sock.c:1503 [inline]
__sk_destruct+0x5ff/0x810 net/core/sock.c:1584
sk_destruct net/core/sock.c:1599 [inline]
__sk_free+0x165/0x3b0 net/core/sock.c:1610
sk_free+0x3b/0x50 net/core/sock.c:1621
sock_put include/net/sock.h:1707 [inline]
l2cap_sock_kill.part.0+0x6b/0x80 net/bluetooth/l2cap_sock.c:1055
l2cap_sock_kill net/bluetooth/l2cap_sock.c:1206 [inline]
l2cap_sock_release+0x158/0x190 net/bluetooth/l2cap_sock.c:1204
__sock_release net/socket.c:579 [inline]
sock_release+0x87/0x1d0 net/socket.c:599
rfcomm_session_del+0x15a/0x1f0 net/bluetooth/rfcomm/core.c:684
rfcomm_session_close net/bluetooth/rfcomm/core.c:723 [inline]
rfcomm_process_rx net/bluetooth/rfcomm/core.c:1916 [inline]
rfcomm_process_sessions net/bluetooth/rfcomm/core.c:2000 [inline]
rfcomm_run+0x12ed/0x4250 net/bluetooth/rfcomm/core.c:2087
kthread+0x30b/0x410 kernel/kthread.c:246
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

The buggy address belongs to the object at ffff888096dc4cc0
which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 96 bytes inside of
2048-byte region [ffff888096dc4cc0, ffff888096dc54c0)
The buggy address belongs to the page:
page:ffffea00025b7100 count:1 mapcount:0 mapping:ffff88812c39cc40 index:0x0 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffffea00015c8d88 ffffea0002a1c688 ffff88812c39cc40
raw: 0000000000000000 ffff888096dc4440 0000000100000003 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff888096dc4c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888096dc4c80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
>ffff888096dc4d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888096dc4d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888096dc4e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Sysenter RSP=0000000000000000 CS:RIP=0000:0000000000000000
CS: sel=0x0000, attr=0x0009b, limit=0x0000ffff, base=0x0000000000000000
DS: sel=0x0000, attr=0x00093, limit=0x0000ffff, base=0x0000000000000000
SS: sel=0x0000, attr=0x00081, limit=0x0000ffff, base=0x0000000000000000
platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
audit: type=1804 audit(1596318366.514:413): pid=26262 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op=invalid_pcr cause=ToMToU comm="syz-executor.0" name="/root/syzkaller-testdir234422321/syzkaller.lSt80x/585/bus" dev="sda1" ino=15812 res=1
ES: sel=0x0000, attr=0x00093, limit=0x0000ffff, base=0x0000000000000000
FS: sel=0x0000, attr=0x00093, limit=0x0000ffff, base=0x0000000000000000
GS: sel=0x0000, attr=0x00093, limit=0x0000ffff, base=0x0000000000000000
GDTR: limit=0x000007ff, base=0x0000000000001000
audit: type=1804 audit(1596318366.544:414): pid=26268 uid=0 auid=0 ses=4 subj=system_u:system_r:kernel_t:s0 op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir234422321/syzkaller.lSt80x/585/bus" dev="sda1" ino=15812 res=1
LDTR: sel=0x0008, attr=0x04082, limit=0x000007ff, base=0x0000000000001800
IDTR: limit=0x0000ffff, base=0x0000000000000000
TR: sel=0x0000, attr=0x0008b, limit=0x0000ffff, base=0x0000000000000000
EFER = 0x0000000000000000 PAT = 0x0007040600070406

syzbot

no llegida,
2 d’ag. 2020, 12:24:182/8/20
a syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 13af6c74 Linux 4.19.136
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14e55078900000
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1644b16c900000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=148d030c900000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+0fe4ef...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in constant_test_bit arch/x86/include/asm/bitops.h:317 [inline]
BUG: KASAN: use-after-free in sock_flag include/net/sock.h:839 [inline]
BUG: KASAN: use-after-free in l2cap_sock_kill net/bluetooth/l2cap_sock.c:1046 [inline]
BUG: KASAN: use-after-free in l2cap_sock_close_cb+0xbd/0xd0 net/bluetooth/l2cap_sock.c:1311
Read of size 8 at addr ffff88809e9182a0 by task syz-executor979/26954

CPU: 0 PID: 26954 Comm: syz-executor979 Not tainted 4.19.136-syzkaller #0
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+0x1fc/0x2fe lib/dump_stack.c:118
print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
kasan_report_error.cold+0x8a/0x1c7 mm/kasan/report.c:354
kasan_report mm/kasan/report.c:412 [inline]
__asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433
constant_test_bit arch/x86/include/asm/bitops.h:317 [inline]
sock_flag include/net/sock.h:839 [inline]
l2cap_sock_kill net/bluetooth/l2cap_sock.c:1046 [inline]
l2cap_sock_close_cb+0xbd/0xd0 net/bluetooth/l2cap_sock.c:1311
l2cap_conn_del+0x3db/0x6b0 net/bluetooth/l2cap_core.c:1730
l2cap_disconn_cfm net/bluetooth/l2cap_core.c:7435 [inline]
l2cap_disconn_cfm+0x85/0xa0 net/bluetooth/l2cap_core.c:7428
hci_disconn_cfm include/net/bluetooth/hci_core.h:1261 [inline]
hci_conn_hash_flush+0x114/0x220 net/bluetooth/hci_conn.c:1495
hci_dev_do_close+0x624/0xe70 net/bluetooth/hci_core.c:1666
hci_unregister_dev+0x17c/0x7f0 net/bluetooth/hci_core.c:3271
vhci_release+0x70/0xe0 drivers/bluetooth/hci_vhci.c:354
__fput+0x2ce/0x890 fs/file_table.c:278
task_work_run+0x148/0x1c0 kernel/task_work.c:113
exit_task_work include/linux/task_work.h:22 [inline]
do_exit+0xbb2/0x2b70 kernel/exit.c:887
do_group_exit+0x125/0x310 kernel/exit.c:990
get_signal+0x3f2/0x1f70 kernel/signal.c:2588
do_signal+0x8f/0x1670 arch/x86/kernel/signal.c:821
exit_to_usermode_loop+0x204/0x2a0 arch/x86/entry/common.c:163
prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline]
syscall_return_slowpath arch/x86/entry/common.c:271 [inline]
do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x447169
Code: e8 4c e7 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 00 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 3b 07 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fa8bff16db8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 00000000006dcc28 RCX: 0000000000447169
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00000000006dcc28
RBP: 00000000006dcc20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dcc2c
R13: 00007ffd57ed7e7f R14: 00007fa8bff179c0 R15: 0000000000000064

Allocated by task 21624:
__do_kmalloc mm/slab.c:3727 [inline]
__kmalloc+0x15a/0x3c0 mm/slab.c:3736
kmalloc include/linux/slab.h:520 [inline]
sk_prot_alloc+0x1e2/0x2d0 net/core/sock.c:1466
sk_alloc+0x36/0xec0 net/core/sock.c:1520
l2cap_sock_alloc.constprop.0+0x31/0x210 net/bluetooth/l2cap_sock.c:1590
l2cap_sock_create+0x110/0x1b0 net/bluetooth/l2cap_sock.c:1636
bt_sock_create+0x154/0x2a0 net/bluetooth/af_bluetooth.c:130
__sock_create+0x3d8/0x740 net/socket.c:1276
sock_create net/socket.c:1316 [inline]
__sys_socket+0xef/0x200 net/socket.c:1346
__do_sys_socket net/socket.c:1355 [inline]
__se_sys_socket net/socket.c:1353 [inline]
__x64_sys_socket+0x6f/0xb0 net/socket.c:1353
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 21626:
__cache_free mm/slab.c:3503 [inline]
kfree+0xcc/0x210 mm/slab.c:3822
sk_prot_free net/core/sock.c:1503 [inline]
__sk_destruct+0x5ff/0x810 net/core/sock.c:1584
sk_destruct net/core/sock.c:1599 [inline]
__sk_free+0x165/0x3b0 net/core/sock.c:1610
sk_free+0x3b/0x50 net/core/sock.c:1621
sock_put include/net/sock.h:1707 [inline]
l2cap_sock_kill.part.0+0x6b/0x80 net/bluetooth/l2cap_sock.c:1055
l2cap_sock_kill net/bluetooth/l2cap_sock.c:1206 [inline]
l2cap_sock_release+0x158/0x190 net/bluetooth/l2cap_sock.c:1204
__sock_release+0xcd/0x2a0 net/socket.c:579
sock_close+0x15/0x20 net/socket.c:1140
__fput+0x2ce/0x890 fs/file_table.c:278
task_work_run+0x148/0x1c0 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:193 [inline]
exit_to_usermode_loop+0x251/0x2a0 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+0x538/0x620 arch/x86/entry/common.c:296
entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff88809e918240
which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 96 bytes inside of
2048-byte region [ffff88809e918240, ffff88809e918a40)
The buggy address belongs to the page:
page:ffffea00027a4600 count:1 mapcount:0 mapping:ffff88812c39cc40 index:0x0 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffffea00021ea508 ffffea0002792888 ffff88812c39cc40
raw: 0000000000000000 ffff88809e918240 0000000100000003 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88809e918180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88809e918200: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
>ffff88809e918280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88809e918300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88809e918380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

syzbot

no llegida,
9 d’ag. 2020, 7:14:179/8/20
a syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 14b58326 Linux 4.14.193
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1201f026900000
kernel config: https://syzkaller.appspot.com/x/.config?x=68ef0287ccbc3b42
dashboard link: https://syzkaller.appspot.com/bug?extid=161f0e5d0dcee3e5af70
compiler: gcc (GCC) 10.1.0-syz 20200507
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17a5e376900000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+161f0e...@syzkaller.appspotmail.com

NOHZ: local_softirq_pending 08
NOHZ: local_softirq_pending 08
==================================================================
BUG: KASAN: use-after-free in constant_test_bit arch/x86/include/asm/bitops.h:328 [inline]
BUG: KASAN: use-after-free in sock_flag include/net/sock.h:810 [inline]
BUG: KASAN: use-after-free in l2cap_sock_kill net/bluetooth/l2cap_sock.c:1047 [inline]
BUG: KASAN: use-after-free in l2cap_sock_close_cb+0xa7/0xb0 net/bluetooth/l2cap_sock.c:1312
Read of size 8 at addr ffff8880a5241420 by task syz-executor.5/6378

CPU: 1 PID: 6378 Comm: syz-executor.5 Not tainted 4.14.193-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x1b2/0x283 lib/dump_stack.c:58
print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
kasan_report_error.cold+0x8a/0x194 mm/kasan/report.c:351
kasan_report mm/kasan/report.c:409 [inline]
__asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430
constant_test_bit arch/x86/include/asm/bitops.h:328 [inline]
sock_flag include/net/sock.h:810 [inline]
l2cap_sock_kill net/bluetooth/l2cap_sock.c:1047 [inline]
l2cap_sock_close_cb+0xa7/0xb0 net/bluetooth/l2cap_sock.c:1312
l2cap_conn_del+0x3a3/0x670 net/bluetooth/l2cap_core.c:1730
l2cap_disconn_cfm net/bluetooth/l2cap_core.c:7435 [inline]
l2cap_disconn_cfm+0x6b/0x80 net/bluetooth/l2cap_core.c:7428
hci_disconn_cfm include/net/bluetooth/hci_core.h:1226 [inline]
hci_conn_hash_flush+0x114/0x220 net/bluetooth/hci_conn.c:1376
hci_dev_do_close+0x542/0xc50 net/bluetooth/hci_core.c:1620
hci_unregister_dev+0x170/0x7a0 net/bluetooth/hci_core.c:3191
vhci_release+0x70/0xe0 drivers/bluetooth/hci_vhci.c:354
__fput+0x25f/0x7a0 fs/file_table.c:210
task_work_run+0x11f/0x190 kernel/task_work.c:113
exit_task_work include/linux/task_work.h:22 [inline]
do_exit+0xa08/0x27f0 kernel/exit.c:865
do_group_exit+0x100/0x2e0 kernel/exit.c:962
SYSC_exit_group kernel/exit.c:973 [inline]
SyS_exit_group+0x19/0x20 kernel/exit.c:971
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x45ce69
RSP: 002b:00007ffd2fe91cd8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000045ce69
RDX: 00000000004168c1 RSI: 00000000016a85f0 RDI: 0000000000000043
RBP: 00000000004c2b1b R08: 000000000000000b R09: 0000000000000000
R10: 0000000002cb8940 R11: 0000000000000246 R12: 000000000000000c
R13: 00007ffd2fe91e20 R14: 000000000011da6c R15: 00007ffd2fe91e30

Allocated by task 11999:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
__do_kmalloc mm/slab.c:3720 [inline]
__kmalloc+0x15a/0x400 mm/slab.c:3729
kmalloc include/linux/slab.h:493 [inline]
sk_prot_alloc+0x1ba/0x290 net/core/sock.c:1467
sk_alloc+0x36/0xcd0 net/core/sock.c:1521
l2cap_sock_alloc.constprop.0+0x31/0x210 net/bluetooth/l2cap_sock.c:1591
l2cap_sock_create+0xdd/0x170 net/bluetooth/l2cap_sock.c:1637
bt_sock_create+0x13b/0x280 net/bluetooth/af_bluetooth.c:130
__sock_create+0x303/0x620 net/socket.c:1275
sock_create net/socket.c:1315 [inline]
SYSC_socket net/socket.c:1345 [inline]
SyS_socket+0xd1/0x1b0 net/socket.c:1325
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 11998:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
__cache_free mm/slab.c:3496 [inline]
kfree+0xc9/0x250 mm/slab.c:3815
sk_prot_free net/core/sock.c:1504 [inline]
__sk_destruct+0x577/0x6e0 net/core/sock.c:1582
sk_destruct net/core/sock.c:1597 [inline]
__sk_free+0xd9/0x2d0 net/core/sock.c:1605
sk_free+0x2b/0x40 net/core/sock.c:1616
sock_put include/net/sock.h:1658 [inline]
l2cap_sock_kill.part.0+0x5b/0x70 net/bluetooth/l2cap_sock.c:1056
l2cap_sock_kill net/bluetooth/l2cap_sock.c:1207 [inline]
l2cap_sock_release+0x146/0x180 net/bluetooth/l2cap_sock.c:1205
__sock_release+0xcd/0x2b0 net/socket.c:602
sock_close+0x15/0x20 net/socket.c:1139
__fput+0x25f/0x7a0 fs/file_table.c:210
task_work_run+0x11f/0x190 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:191 [inline]
exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164
prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
syscall_return_slowpath arch/x86/entry/common.c:270 [inline]
do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297
entry_SYSCALL_64_after_hwframe+0x46/0xbb

The buggy address belongs to the object at ffff8880a52413c0
which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 96 bytes inside of
2048-byte region [ffff8880a52413c0, ffff8880a5241bc0)
The buggy address belongs to the page:
page:ffffea0002949000 count:1 mapcount:0 mapping:ffff8880a52402c0 index:0x0 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffff8880a52402c0 0000000000000000 0000000100000003
raw: ffffea000296f7a0 ffff88812fe50948 ffff88812fe52c40 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8880a5241300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880a5241380: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
>ffff8880a5241400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880a5241480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880a5241500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Respon a tots
Respon a l'autor
Reenvia
0 missatges nous