KASAN: slab-out-of-bounds Read in rdma_listen

6 views
Skip to first unread message

syzbot

unread,
Dec 16, 2019, 2:11:10 PM12/16/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: a844dc4c Linux 4.14.158
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16a89ddee00000
kernel config: https://syzkaller.appspot.com/x/.config?x=c02bef505ffc02ff
dashboard link: https://syzkaller.appspot.com/bug?extid=af6dcbfcd80595aaea81
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

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

==================================================================
BUG: KASAN: slab-out-of-bounds in __list_add_valid+0x9a/0xa0
lib/list_debug.c:26
Read of size 8 at addr ffff8880819f7d18 by task syz-executor.0/20476

CPU: 1 PID: 20476 Comm: syz-executor.0 Not tainted 4.14.158-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+0x142/0x197 lib/dump_stack.c:58
print_address_description.cold+0x7c/0x1dc 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/0x2af mm/kasan/report.c:393
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
__list_add_valid+0x9a/0xa0 lib/list_debug.c:26
__list_add include/linux/list.h:60 [inline]
list_add_tail include/linux/list.h:93 [inline]
cma_listen_on_all drivers/infiniband/core/cma.c:2321 [inline]
rdma_listen+0x5a7/0x840 drivers/infiniband/core/cma.c:3319
ucma_listen+0x10e/0x170 drivers/infiniband/core/ucma.c:1078
ucma_write+0x231/0x310 drivers/infiniband/core/ucma.c:1672
__vfs_write+0x105/0x6b0 fs/read_write.c:480
vfs_write+0x198/0x500 fs/read_write.c:544
SYSC_write fs/read_write.c:590 [inline]
SyS_write+0xfd/0x230 fs/read_write.c:582
do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x45a909
RSP: 002b:00007f82cdb06c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045a909
RDX: 0000000000000010 RSI: 00000000200001c0 RDI: 0000000000000003
RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f82cdb076d4
R13: 00000000004cbc11 R14: 00000000004e57b8 R15: 00000000ffffffff

Allocated by task 19734:
save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
save_stack+0x45/0xd0 mm/kasan/kasan.c:447
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc mm/kasan/kasan.c:551 [inline]
kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529
kasan_slab_alloc+0xf/0x20 mm/kasan/kasan.c:489
kmem_cache_alloc+0x12e/0x780 mm/slab.c:3552
getname_flags fs/namei.c:138 [inline]
getname_flags+0xcb/0x580 fs/namei.c:128
getname+0x1a/0x20 fs/namei.c:209
do_sys_open+0x1e7/0x430 fs/open.c:1078
SYSC_open fs/open.c:1102 [inline]
SyS_open+0x2d/0x40 fs/open.c:1097
do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 19734:
save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
save_stack+0x45/0xd0 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]
kmem_cache_free+0x83/0x2b0 mm/slab.c:3758
putname+0xdb/0x120 fs/namei.c:259
do_sys_open+0x21c/0x430 fs/open.c:1093
SYSC_open fs/open.c:1102 [inline]
SyS_open+0x2d/0x40 fs/open.c:1097
do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff8880819f6400
which belongs to the cache names_cache of size 4096
The buggy address is located 2328 bytes to the right of
4096-byte region [ffff8880819f6400, ffff8880819f7400)
The buggy address belongs to the page:
page:ffffea0002067d80 count:1 mapcount:0 mapping:ffff8880819f6400 index:0x0
compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffff8880819f6400 0000000000000000 0000000100000001
raw: ffffea00016cf0a0 ffffea000280f8a0 ffff8880aa9e9cc0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8880819f7c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880819f7c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
> ffff8880819f7d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff8880819f7d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880819f7e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
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,
Aug 24, 2020, 11:19:18 PM8/24/20
to syzkaller...@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