syzbot


KASAN: use-after-free Read in tipc_nametbl_lookup_dst_nodes

Status: auto-closed as invalid on 2020/09/11 20:22
Reported-by: syzbot+5357c5f935a0e414b851@syzkaller.appspotmail.com
First crash: 783d, last: 783d

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in tipc_nametbl_lookup_dst_nodes+0x4ad/0x4c0 net/tipc/name_table.c:670
Read of size 4 at addr ffff88808f6f3440 by task syz-executor.5/10885

CPU: 1 PID: 10885 Comm: syz-executor.5 Not tainted 4.14.180-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+0x13e/0x194 lib/dump_stack.c:58
 print_address_description.cold+0x7c/0x1e2 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/0x2ae mm/kasan/report.c:393
 tipc_nametbl_lookup_dst_nodes+0x4ad/0x4c0 net/tipc/name_table.c:670
 tipc_sendmcast+0x599/0xb60 net/tipc/socket.c:767
 __tipc_sendmsg+0xbc5/0xfd0 net/tipc/socket.c:971
 tipc_sendmsg+0x4c/0x70 net/tipc/socket.c:919
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xc5/0x100 net/socket.c:656
 ___sys_sendmsg+0x70a/0x840 net/socket.c:2062
 __sys_sendmsg+0xa3/0x120 net/socket.c:2096
 SYSC_sendmsg net/socket.c:2107 [inline]
 SyS_sendmsg+0x27/0x40 net/socket.c:2103
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x45c829
RSP: 002b:00007fe7f792ec78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000500e20 RCX: 000000000045c829
RDX: 0000000000000000 RSI: 0000000020000940 RDI: 0000000000000005
RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 0000000000000a09 R14: 00000000004ccc1d R15: 00007fe7f792f6d4

Allocated by task 10885:
 save_stack+0x32/0xa0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc mm/kasan/kasan.c:551 [inline]
 kasan_kmalloc+0xbf/0xe0 mm/kasan/kasan.c:529
 kmem_cache_alloc_trace+0x14d/0x7b0 mm/slab.c:3618
 kmalloc include/linux/slab.h:488 [inline]
 kmalloc_array include/linux/slab.h:606 [inline]
 kcalloc include/linux/slab.h:618 [inline]
 tipc_subseq_alloc net/tipc/name_table.c:141 [inline]
 tipc_nameseq_create+0x7e/0x2d0 net/tipc/name_table.c:152
 tipc_nametbl_insert_publ+0x6b1/0x1450 net/tipc/name_table.c:476
 tipc_nametbl_publish+0x211/0x3f0 net/tipc/name_table.c:701
 tipc_sk_publish net/tipc/socket.c:2203 [inline]
 tipc_bind+0x2c4/0x600 net/tipc/socket.c:629
 SYSC_bind+0x1a0/0x1e0 net/socket.c:1489
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 10882:
 save_stack+0x32/0xa0 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+0xcb/0x260 mm/slab.c:3815
 tipc_nametbl_remove_publ+0x1e1/0x260 net/tipc/name_table.c:501
 tipc_nametbl_withdraw+0x19b/0x4c0 net/tipc/name_table.c:727
 tipc_sk_withdraw+0x30b/0x580 net/tipc/socket.c:2237
 tipc_release+0xb1/0xcc0 net/tipc/socket.c:562
 __sock_release+0xcd/0x2b0 net/socket.c:602
 sock_close+0x15/0x20 net/socket.c:1139
 __fput+0x25f/0x790 fs/file_table.c:210
 task_work_run+0x113/0x190 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:191 [inline]
 exit_to_usermode_loop+0x1d6/0x220 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+0x42/0xb7

The buggy address belongs to the object at ffff88808f6f3440
 which belongs to the cache kmalloc-32 of size 32
cannot load conntrack support for proto=10
The buggy address is located 0 bytes inside of
 32-byte region [ffff88808f6f3440, ffff88808f6f3460)
The buggy address belongs to the page:
page:ffffea00023dbcc0 count:1 mapcount:0 mapping:ffff88808f6f3000 index:0xffff88808f6f3fc1
flags: 0xfffe0000000100(slab)
raw: 00fffe0000000100 ffff88808f6f3000 ffff88808f6f3fc1 000000010000003f
raw: ffffea00029f71e0 ffffea000234ac60 ffff88812fe541c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88808f6f3300: 00 00 01 fc fc fc fc fc 00 fc fc fc fc fc fc fc
 ffff88808f6f3380: fb fb fb fb fc fc fc fc 00 fc fc fc fc fc fc fc
>ffff88808f6f3400: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc
                                           ^
 ffff88808f6f3480: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc
 ffff88808f6f3500: 00 00 01 fc fc fc fc fc fb fb fb fb fc fc fc fc
==================================================================

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-14 2020/05/14 20:21 linux-4.14.y ab9dfda23248 2d572622 .config log report