syzbot


KASAN: use-after-free Read in __rhashtable_lookup

Status: closed as dup on 2018/08/08 09:26
Subsystems: rds
[Documentation on labels]
Reported-by: syzbot+c6369755db236fb370e7@syzkaller.appspotmail.com
First crash: 2301d, last: 2301d
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
KASAN: use-after-free Read in rds_find_bound rds 1 2522d 2518d
Discussions (1)
Title Replies (including bot) Last reply
KASAN: use-after-free Read in __rhashtable_lookup 1 (2) 2018/08/08 09:26
Similar bugs (7)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in __rhashtable_lookup (2) rds C 22 2261d 2281d 10/28 fixed on 2018/09/26 21:51
upstream KASAN: use-after-free Read in __rhashtable_lookup (3) net 1 1471d 1471d 0/28 auto-closed as invalid on 2021/02/08 22:50
upstream KASAN: use-after-free Read in __rhashtable_lookup (6) net 1 1186d 1186d 0/28 auto-closed as invalid on 2021/11/20 20:36
upstream KASAN: use-after-free Read in __rhashtable_lookup (5) net 1 1281d 1281d 0/28 auto-closed as invalid on 2021/08/17 13:23
upstream KASAN: use-after-free Read in __rhashtable_lookup (8) net 1 1034d 1034d 0/28 auto-closed as invalid on 2022/04/22 11:27
upstream KASAN: use-after-free Read in __rhashtable_lookup (7) net 1 1088d 1088d 0/28 closed as invalid on 2022/01/07 18:56
upstream KASAN: use-after-free Read in __rhashtable_lookup (4) net 1 1374d 1370d 0/28 auto-closed as invalid on 2021/05/16 18:04

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in memcmp+0xe8/0x150 lib/string.c:861
Read of size 1 at addr ffff8801d811ec30 by task syz-executor6/10904

CPU: 1 PID: 10904 Comm: syz-executor6 Not tainted 4.18.0-rc7+ #169
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+0x1c9/0x2b4 lib/dump_stack.c:113
 print_address_description+0x6c/0x20b mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412
 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:430
 memcmp+0xe8/0x150 lib/string.c:861
 memcmp include/linux/string.h:386 [inline]
 rhashtable_compare include/linux/rhashtable.h:462 [inline]
 __rhashtable_lookup.isra.8.constprop.19+0x70f/0xd50 include/linux/rhashtable.h:484
 rhashtable_lookup include/linux/rhashtable.h:516 [inline]
 rhashtable_lookup_fast include/linux/rhashtable.h:542 [inline]
 rds_add_bound net/rds/bind.c:117 [inline]
 rds_bind+0x7c9/0x1510 net/rds/bind.c:238
 __sys_bind+0x331/0x440 net/socket.c:1500
 __do_sys_bind net/socket.c:1511 [inline]
 __se_sys_bind net/socket.c:1509 [inline]
 __x64_sys_bind+0x73/0xb0 net/socket.c:1509
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x456b29
Code: fd b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 
RSP: 002b:00007f6ae7f39c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000031
RAX: ffffffffffffffda RBX: 00007f6ae7f3a6d4 RCX: 0000000000456b29
RDX: 0000000000000010 RSI: 0000000020000840 RDI: 0000000000000014
RBP: 0000000000930140 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 00000000004ca698 R14: 00000000004c26f1 R15: 0000000000000001

Allocated by task 10898:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553
 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:490
 kmem_cache_alloc+0x12e/0x760 mm/slab.c:3554
 sk_prot_alloc+0x69/0x2e0 net/core/sock.c:1462
 sk_alloc+0x106/0x17b0 net/core/sock.c:1522
 rds_create+0x14f/0x770 net/rds/af_rds.c:666
 __sock_create+0x53c/0x940 net/socket.c:1294
 sock_create net/socket.c:1334 [inline]
 __sys_socket+0x106/0x260 net/socket.c:1364
 __do_sys_socket net/socket.c:1373 [inline]
 __se_sys_socket net/socket.c:1371 [inline]
 __x64_sys_socket+0x73/0xb0 net/socket.c:1371
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 10895:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:521
 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528
 __cache_free mm/slab.c:3498 [inline]
 kmem_cache_free+0x86/0x2d0 mm/slab.c:3756
 sk_prot_free net/core/sock.c:1503 [inline]
 __sk_destruct+0x70a/0xa60 net/core/sock.c:1587
 sk_destruct+0x78/0x90 net/core/sock.c:1595
 __sk_free+0xcf/0x300 net/core/sock.c:1606
 sk_free+0x42/0x50 net/core/sock.c:1617
 sock_put include/net/sock.h:1691 [inline]
 rds_release+0x3e9/0x570 net/rds/af_rds.c:91
 __sock_release+0xd7/0x250 net/socket.c:598
 sock_close+0x19/0x20 net/socket.c:1158
 __fput+0x355/0x8b0 fs/file_table.c:209
 ____fput+0x15/0x20 fs/file_table.c:243
 task_work_run+0x1ec/0x2a0 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:192 [inline]
 exit_to_usermode_loop+0x313/0x370 arch/x86/entry/common.c:166
 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:268 [inline]
 do_syscall_64+0x6be/0x820 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8801d811e7c0
 which belongs to the cache RDS of size 1608
The buggy address is located 1136 bytes inside of
 1608-byte region [ffff8801d811e7c0, ffff8801d811ee08)
The buggy address belongs to the page:
page:ffffea0007604780 count:1 mapcount:0 mapping:ffff8801cd8a0300 index:0x0
flags: 0x2fffc0000000100(slab)
raw: 02fffc0000000100 ffff8801cd89f348 ffffea000716f8c8 ffff8801cd8a0300
raw: 0000000000000000 ffff8801d811e0c0 0000000100000002 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801d811eb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801d811eb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8801d811ec00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                     ^
 ffff8801d811ec80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801d811ed00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/08/04 00:44 net-next-old a394b3af206c df7f6947 .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.