BUG: corrupted list in _cma_attach_to_dev

11 views
Skip to first unread message

syzbot

unread,
Mar 1, 2020, 2:13:16 PM3/1/20
to chuck...@oracle.com, dled...@redhat.com, j...@ziepe.ca, le...@kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, pa...@mellanox.com, syzkall...@googlegroups.com, wi...@infradead.org
Hello,

syzbot found the following crash on:

HEAD commit: 63623fd4 Merge tag 'for-linus' of git://git.kernel.org/pub..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=16a8fa81e00000
kernel config: https://syzkaller.appspot.com/x/.config?x=9833e26bab355358
dashboard link: https://syzkaller.appspot.com/bug?extid=06b50ee4a9bd73e8b89f
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14e804f9e00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15d6fd29e00000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+06b50e...@syzkaller.appspotmail.com

list_add corruption. prev->next should be next (ffff888092dbd570), but was ffffffff8a5d2f20. (prev=ffff8880965fb1e0).
------------[ cut here ]------------
kernel BUG at lib/list_debug.c:26!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 10633 Comm: syz-executor222 Not tainted 5.6.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__list_add_valid.cold+0x3a/0x3c lib/list_debug.c:26
Code: 0b 48 89 f2 4c 89 e1 4c 89 ee 48 c7 c7 80 da 91 88 e8 29 3a b8 fd 0f 0b 48 89 f1 48 c7 c7 00 da 91 88 4c 89 e6 e8 15 3a b8 fd <0f> 0b 4c 89 f6 48 c7 c7 a0 db 91 88 e8 04 3a b8 fd 0f 0b 4c 89 ea
RSP: 0018:ffffc90002197b70 EFLAGS: 00010286
RAX: 0000000000000075 RBX: ffff88809db2b000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff815ebe46 RDI: fffff52000432f60
RBP: ffffc90002197b88 R08: 0000000000000075 R09: ffffed1015d26659
R10: ffffed1015d26658 R11: ffff8880ae9332c7 R12: ffff888092dbd570
R13: ffff88809db2b1e0 R14: ffff8880965fb1e0 R15: ffff88809db2b1e0
FS: 00007f32e8400700(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 00000000a71ef000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__list_add include/linux/list.h:67 [inline]
list_add_tail include/linux/list.h:100 [inline]
_cma_attach_to_dev+0x150/0x2f0 drivers/infiniband/core/cma.c:471
cma_listen_on_dev+0x252/0x6a0 drivers/infiniband/core/cma.c:2493
cma_listen_on_all drivers/infiniband/core/cma.c:2514 [inline]
rdma_listen+0x772/0x970 drivers/infiniband/core/cma.c:3622
ucma_listen+0x14d/0x1c0 drivers/infiniband/core/ucma.c:1092
ucma_write+0x2d7/0x3c0 drivers/infiniband/core/ucma.c:1684
__vfs_write+0x8a/0x110 fs/read_write.c:494
vfs_write+0x268/0x5d0 fs/read_write.c:558
ksys_write+0x220/0x290 fs/read_write.c:611
__do_sys_write fs/read_write.c:623 [inline]
__se_sys_write fs/read_write.c:620 [inline]
__x64_sys_write+0x73/0xb0 fs/read_write.c:620
do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4495e9
Code: e8 8c e7 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 00 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 fb 07 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f32e83ffda8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00000000006dec68 RCX: 00000000004495e9
RDX: 0000000000000010 RSI: 0000000020000100 RDI: 0000000000000004
RBP: 00000000006dec60 R08: 00007f32e8400700 R09: 0000000000000000
R10: 00007f32e8400700 R11: 0000000000000246 R12: 00000000006dec6c
R13: 0000000000000000 R14: 0000000000006f6c R15: 00000000006dec6c
Modules linked in:
---[ end trace 55770a30f050c228 ]---
RIP: 0010:__list_add_valid.cold+0x3a/0x3c lib/list_debug.c:26
Code: 0b 48 89 f2 4c 89 e1 4c 89 ee 48 c7 c7 80 da 91 88 e8 29 3a b8 fd 0f 0b 48 89 f1 48 c7 c7 00 da 91 88 4c 89 e6 e8 15 3a b8 fd <0f> 0b 4c 89 f6 48 c7 c7 a0 db 91 88 e8 04 3a b8 fd 0f 0b 4c 89 ea
RSP: 0018:ffffc90002197b70 EFLAGS: 00010286
RAX: 0000000000000075 RBX: ffff88809db2b000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff815ebe46 RDI: fffff52000432f60
RBP: ffffc90002197b88 R08: 0000000000000075 R09: ffffed1015d26659
R10: ffffed1015d26658 R11: ffff8880ae9332c7 R12: ffff888092dbd570
R13: ffff88809db2b1e0 R14: ffff8880965fb1e0 R15: ffff88809db2b1e0
FS: 00007f32e8400700(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 00000000a71ef000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
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 can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches

Jason Gunthorpe

unread,
Mar 9, 2020, 1:24:33 PM3/9/20
to syzbot, chuck...@oracle.com, dled...@redhat.com, le...@kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, pa...@mellanox.com, syzkall...@googlegroups.com, wi...@infradead.org
On Sun, Mar 01, 2020 at 11:13:15AM -0800, syzbot wrote:
> Hello,
>
> syzbot found the following crash on:
>
> HEAD commit: 63623fd4 Merge tag 'for-linus' of git://git.kernel.org/pub..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=16a8fa81e00000
> kernel config: https://syzkaller.appspot.com/x/.config?x=9833e26bab355358
> dashboard link: https://syzkaller.appspot.com/bug?extid=06b50ee4a9bd73e8b89f
> compiler: gcc (GCC) 9.0.0 20181231 (experimental)
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14e804f9e00000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15d6fd29e00000

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next

syzbot

unread,
Mar 9, 2020, 4:20:05 PM3/9/20
to chuck...@oracle.com, dled...@redhat.com, j...@ziepe.ca, le...@kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, pa...@mellanox.com, syzkall...@googlegroups.com, wi...@infradead.org
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger crash:

Reported-and-tested-by: syzbot+06b50e...@syzkaller.appspotmail.com

Tested on:

commit: 0aeb3622 RDMA/hns: fix spelling mistake "attatch" -> "atta..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
kernel config: https://syzkaller.appspot.com/x/.config?x=b58f96e9824c82cb
dashboard link: https://syzkaller.appspot.com/bug?extid=06b50ee4a9bd73e8b89f
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

Note: testing is done by a robot and is best-effort only.

Jason Gunthorpe

unread,
Mar 9, 2020, 7:03:49 PM3/9/20
to syzbot, chuck...@oracle.com, dled...@redhat.com, le...@kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, pa...@mellanox.com, syzkall...@googlegroups.com, wi...@infradead.org
#syz dup: KASAN: use-after-free Read in rdma_listen (2)
Reply all
Reply to author
Forward
0 new messages