KASAN: use-after-free Read in af_alg_accept

5 views
Skip to first unread message

syzbot

unread,
Apr 29, 2020, 7:09:19 AM4/29/20
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 5ef58e29 Merge tag 'scsi-fixes' of git://git.kernel.org/pu..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1731c4b0100000
kernel config: https://syzkaller.appspot.com/x/.config?x=78a7d8adda44b4b
dashboard link: https://syzkaller.appspot.com/bug?extid=ff7e2c6754f4db954fad
compiler: clang version 10.0.0 (https://github.com/llvm/llvm-project/ c2443155a0fb245c8f17f2c1c72b6ea391e86e81)
CC: [da...@davemloft.net her...@gondor.apana.org.au linux-...@vger.kernel.org linux-...@vger.kernel.org]

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+ff7e2c...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in af_alg_accept+0x10d/0x480 crypto/af_alg.c:295
Read of size 8 at addr ffff888055c7f4d0 by task syz-executor.1/16819

CPU: 1 PID: 16819 Comm: syz-executor.1 Not tainted 5.7.0-rc2-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+0x1e9/0x30e lib/dump_stack.c:118
print_address_description+0x74/0x5c0 mm/kasan/report.c:382
__kasan_report+0x103/0x1a0 mm/kasan/report.c:511
kasan_report+0x4d/0x80 mm/kasan/common.c:625

Allocated by task 16819:
save_stack mm/kasan/common.c:49 [inline]
set_track mm/kasan/common.c:57 [inline]
__kasan_kmalloc+0x114/0x160 mm/kasan/common.c:495
__do_kmalloc mm/slab.c:3656 [inline]
__kmalloc+0x24b/0x330 mm/slab.c:3665
kmalloc include/linux/slab.h:560 [inline]
sk_prot_alloc+0xa7/0x2b0 net/core/sock.c:1604
sk_alloc+0x35/0x990 net/core/sock.c:1658
alg_create+0x9a/0x130 crypto/af_alg.c:373
__sock_create+0x5c9/0x8d0 net/socket.c:1433
sock_create net/socket.c:1484 [inline]
__sys_socket+0xde/0x2d0 net/socket.c:1526
__do_sys_socket net/socket.c:1535 [inline]
__se_sys_socket net/socket.c:1533 [inline]
__x64_sys_socket+0x76/0x80 net/socket.c:1533
do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:295
entry_SYSCALL_64_after_hwframe+0x49/0xb3

Freed by task 16817:
save_stack mm/kasan/common.c:49 [inline]
set_track mm/kasan/common.c:57 [inline]
kasan_set_free_info mm/kasan/common.c:317 [inline]
__kasan_slab_free+0x125/0x190 mm/kasan/common.c:456
__cache_free mm/slab.c:3426 [inline]
kfree+0x10a/0x220 mm/slab.c:3757
sk_prot_free net/core/sock.c:1641 [inline]
__sk_destruct+0x61d/0x740 net/core/sock.c:1725
__sk_destruct+0x50/0x740 net/core/sock.c:1696
sock_put include/net/sock.h:1778 [inline]
af_alg_release+0x81/0xf0 crypto/af_alg.c:121
__sock_release net/socket.c:605 [inline]
sock_close+0xd8/0x260 net/socket.c:1283
__fput+0x2ed/0x750 fs/file_table.c:280
task_work_run+0x147/0x1d0 kernel/task_work.c:123
tracehook_notify_resume include/linux/tracehook.h:188 [inline]
exit_to_usermode_loop arch/x86/entry/common.c:165 [inline]
prepare_exit_to_usermode+0x48e/0x600 arch/x86/entry/common.c:196
entry_SYSCALL_64_after_hwframe+0x49/0xb3

The buggy address belongs to the object at ffff888055c7f000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 1232 bytes inside of
2048-byte region [ffff888055c7f000, ffff888055c7f800)
The buggy address belongs to the page:
page:ffffea0001571fc0 refcount:1 mapcount:0 mapping:000000007e5067b6 index:0x0
flags: 0xfffe0000000200(slab)
raw: 00fffe0000000200 ffffea00026415c8 ffffea00028dc208 ffff8880aa400e00
raw: 0000000000000000 ffff888055c7f000 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff888055c7f380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888055c7f400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888055c7f480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888055c7f500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888055c7f580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


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

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

syzbot

unread,
Jul 24, 2020, 7:01:10 AM7/24/20
to syzkaller-upst...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages