KASAN: use-after-free Read in tipc_sub_unsubscribe

5 views
Skip to first unread message

syzbot

unread,
Mar 30, 2018, 4:01:03 PM3/30/18
to syzkaller-upst...@googlegroups.com
Hello,

syzbot hit the following crash on net-next commit
18845557fd6fc1998f2d0d8c30467f86db587529 (Thu Mar 29 20:24:06 2018 +0000)
Merge tag 'wireless-drivers-next-for-davem-2018-03-29' of
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
syzbot dashboard link:
https://syzkaller.appspot.com/bug?extid=6c044019a7d406e78f16

Unfortunately, I don't have any reproducer for this crash yet.
Raw console output:
https://syzkaller.appspot.com/x/log.txt?id=5798263756161024
Kernel config: https://syzkaller.appspot.com/x/.config?id=-37309782588693906
compiler: gcc (GCC) 7.1.1 20170620
CC: [da...@davemloft.net jon....@ericsson.com
linux-...@vger.kernel.org net...@vger.kernel.org
tipc-di...@lists.sourceforge.net ying...@windriver.com]

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+6c0440...@syzkaller.appspotmail.com
It will help syzbot understand when the bug is fixed. See footer for
details.
If you forward the report, please keep this part and the footer.

R10: 0000000020000040 R11: 0000000000000246 R12: 0000000000000014
R13: 00000000000005ee R14: 00000000006faef0 R15: 0000000000000003
Name sequence creation failed, no memory
Failed to create subscription for {2147483648,0,4294967295}
==================================================================
BUG: KASAN: use-after-free in tipc_sub_unsubscribe+0x203/0x2e0
net/tipc/subscr.c:165
Read of size 4 at addr ffff8801b240fd98 by task syz-executor5/20849

CPU: 0 PID: 20849 Comm: syz-executor5 Not tainted 4.16.0-rc6+ #286
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+0x194/0x24d lib/dump_stack.c:53
print_address_description+0x73/0x250 mm/kasan/report.c:256
kasan_report_error mm/kasan/report.c:354 [inline]
kasan_report+0x23c/0x360 mm/kasan/report.c:412
__asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432
tipc_sub_unsubscribe+0x203/0x2e0 net/tipc/subscr.c:165
tipc_conn_delete_sub+0x324/0x4a0 net/tipc/topsrv.c:245
tipc_topsrv_kern_unsubscr+0x21d/0x350 net/tipc/topsrv.c:598
tipc_group_delete+0x2c0/0x3d0 net/tipc/group.c:231
tipc_sk_leave+0x10b/0x200 net/tipc/socket.c:2800
tipc_release+0x154/0xff0 net/tipc/socket.c:576
sock_release+0x8d/0x1e0 net/socket.c:594
sock_close+0x16/0x20 net/socket.c:1149
__fput+0x327/0x7e0 fs/file_table.c:209
____fput+0x15/0x20 fs/file_table.c:243
task_work_run+0x199/0x270 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:191 [inline]
exit_to_usermode_loop+0x275/0x2f0 arch/x86/entry/common.c:166
prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline]
syscall_return_slowpath arch/x86/entry/common.c:265 [inline]
do_syscall_64+0x6ec/0x940 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x4548b9
RSP: 002b:00007f74359d4c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 00007f74359d56d4 RCX: 00000000004548b9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000013
RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 0000000000000052 R14: 00000000006f2850 R15: 0000000000000000

Allocated by task 20849:
save_stack+0x43/0xd0 mm/kasan/kasan.c:447
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:552
kmem_cache_alloc_trace+0x136/0x740 mm/slab.c:3607
kmalloc include/linux/slab.h:512 [inline]
tipc_sub_subscribe+0x200/0x510 net/tipc/subscr.c:143
tipc_conn_rcv_sub.isra.5+0x383/0x760 net/tipc/topsrv.c:381
tipc_topsrv_kern_subscr+0x5fb/0x9d0 net/tipc/topsrv.c:582
tipc_group_create+0x6f2/0x990 net/tipc/group.c:194
tipc_sk_join net/tipc/socket.c:2766 [inline]
tipc_setsockopt+0x28a/0xcf0 net/tipc/socket.c:2881
SYSC_setsockopt net/socket.c:1850 [inline]
SyS_setsockopt+0x189/0x360 net/socket.c:1829
do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 20849:
save_stack+0x43/0xd0 mm/kasan/kasan.c:447
set_track mm/kasan/kasan.c:459 [inline]
__kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520
kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527
__cache_free mm/slab.c:3485 [inline]
kfree+0xd9/0x260 mm/slab.c:3800
tipc_sub_kref_release net/tipc/subscr.c:117 [inline]
kref_put include/linux/kref.h:70 [inline]
tipc_sub_put+0x26/0x30 net/tipc/subscr.c:122
tipc_nametbl_unsubscribe+0x473/0x990 net/tipc/name_table.c:809
tipc_sub_unsubscribe+0x6d/0x2e0 net/tipc/subscr.c:164
tipc_conn_delete_sub+0x324/0x4a0 net/tipc/topsrv.c:245
tipc_topsrv_kern_unsubscr+0x21d/0x350 net/tipc/topsrv.c:598
tipc_group_delete+0x2c0/0x3d0 net/tipc/group.c:231
tipc_sk_leave+0x10b/0x200 net/tipc/socket.c:2800
tipc_release+0x154/0xff0 net/tipc/socket.c:576
sock_release+0x8d/0x1e0 net/socket.c:594
sock_close+0x16/0x20 net/socket.c:1149
__fput+0x327/0x7e0 fs/file_table.c:209
____fput+0x15/0x20 fs/file_table.c:243
task_work_run+0x199/0x270 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:191 [inline]
exit_to_usermode_loop+0x275/0x2f0 arch/x86/entry/common.c:166
prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline]
syscall_return_slowpath arch/x86/entry/common.c:265 [inline]
do_syscall_64+0x6ec/0x940 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff8801b240fd00
which belongs to the cache kmalloc-256 of size 256
The buggy address is located 152 bytes inside of
256-byte region [ffff8801b240fd00, ffff8801b240fe00)
The buggy address belongs to the page:
page:ffffea0006c903c0 count:1 mapcount:0 mapping:ffff8801b240f080
index:0xffff8801b240fbc0
flags: 0x2fffc0000000100(slab)
raw: 02fffc0000000100 ffff8801b240f080 ffff8801b240fbc0 0000000100000008
raw: ffffea000730d1a0 ffffea0006d19820 ffff8801dac007c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8801b240fc80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff8801b240fd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
> ffff8801b240fd80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8801b240fe00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
ffff8801b240fe80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This bug is generated by a dumb bot. It may contain errors.
See https://goo.gl/tpsmEJ for details.
Direct all questions to syzk...@googlegroups.com.

syzbot will keep track of this bug report.
If you forgot to add the Reported-by tag, once the fix for this bug is
merged
into any tree, please reply to this email with:
#syz fix: exact-commit-title
To mark this as a duplicate of another syzbot report, please reply with:
#syz dup: exact-subject-of-another-report
If it's a one-off invalid bug report, please reply with:
#syz invalid
Note: if the crash happens again, it will cause creation of a new bug
report.
Note: all commands must start from beginning of the line in the email body.
To upstream this report, please reply with:
#syz upstream

Dmitry Vyukov

unread,
Apr 10, 2018, 11:19:08 AM4/10/18
to syzbot, 'Dmitry Vyukov' via syzkaller-upstream-moderation
Let's assume this is fixed by "vlan: Fix vlan insertion for packets
without ethernet header", which caused a splash of random crashes.

#syz invalid
> --
> You received this message because you are subscribed to the Google Groups
> "syzkaller-upstream-moderation" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to syzkaller-upstream-m...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/syzkaller-upstream-moderation/00000000000026d9e20568a6b3a5%40google.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages