[syzbot] BUG: corrupted list in rdma_listen (2)

13 views
Skip to first unread message

syzbot

unread,
Dec 4, 2021, 4:54:18ā€ÆAM12/4/21
to avi...@nvidia.com, dled...@redhat.com, haakon...@oracle.com, j...@ziepe.ca, le...@kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: bf152b0b41dc Merge tag 'for_linus' of git://git.kernel.org..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=136e3a46b00000
kernel config: https://syzkaller.appspot.com/x/.config?x=4a0a845d34d07474
dashboard link: https://syzkaller.appspot.com/bug?extid=c94a3675a626f6333d74
userspace arch: arm

Unfortunately, I don't have any reproducer for this issue yet.

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

list_add corruption. prev->next should be next (82bbca08), but was 00000000. (prev=865e75ac).
------------[ cut here ]------------
kernel BUG at lib/list_debug.c:26!
Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 1 PID: 5339 Comm: syz-executor.1 Not tainted 5.12.0-rc3-syzkaller #0
Hardware name: ARM-Versatile Express
PC is at __list_add_valid+0x80/0x84 lib/list_debug.c:26
LR is at wake_up_klogd.part.0+0x7c/0xb4 kernel/printk/printk.c:3118
pc : [<808072b8>] lr : [<802d21b0>] psr: 60000013
sp : 86657e30 ip : 86657d60 fp : 86657e3c
r10: 81104354 r9 : 00000010 r8 : 865e75ac
r7 : 82bbca08 r6 : 865e7400 r5 : 865e75ac r4 : 82bbc6d8
r3 : 00000000 r2 : 00000000 r1 : ddfd6688 r0 : 0000005d
Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
Control: 30c5387d Table: 86712700 DAC: 00000000
Process syz-executor.1 (pid: 5339, stack limit = 0x86656210)
Stack: (0x86657e30 to 0x86658000)
7e20: 86657e6c 86657e40 810e61b8 80807244
7e40: 00000010 56b92eae 86657e6c 86424900 86ca70c0 86424948 811034c0 84343b40
7e60: 86657e9c 86657e70 811035a0 810e6048 8046d9e4 00000000 00000005 56b92eae
7e80: 86ca70c0 00000010 200008c0 86ca70c0 86657ed4 86657ea0 811044a0 811034cc
7ea0: 804d8fc8 00000007 fa000008 56b92eae 00004000 00000000 86c46140 200008c0
7ec0: ffffe000 00000000 86657f64 86657ed8 804da914 81104360 853d5140 82bfd5ec
7ee0: 86c46140 81f40284 86657f3c 86657ef8 80502e64 802bf578 00000000 00000000
7f00: 80502d24 835f4000 86657f3c 81f718ac 8020d140 00000000 00000000 200008c0
7f20: 00000010 80200224 86656000 00000004 86657f4c 56b92eae 80502f48 86c46141
7f40: 86c46140 200008c0 00000010 80200224 86656000 00000004 86657f94 86657f68
7f60: 804dad30 804da838 86657f94 86657f78 828abd1c 56b92eae 00000000 00000000
7f80: ffffffff 00000004 86657fa4 86657f98 804dad78 804dac88 00000000 86657fa8
7fa0: 80200060 804dad74 00000000 00000000 00000003 200008c0 00000010 00000000
7fc0: 00000000 00000000 ffffffff 00000004 7ebc531a 76f7b6d0 7ebc54a4 76f7b20c
7fe0: 76f7b048 76f7b038 00018e9c 0004ba40 60000010 00000003 00000000 00000000
Backtrace:
[<80807238>] (__list_add_valid) from [<810e61b8>] (__list_add include/linux/list.h:67 [inline])
[<80807238>] (__list_add_valid) from [<810e61b8>] (list_add_tail include/linux/list.h:100 [inline])
[<80807238>] (__list_add_valid) from [<810e61b8>] (cma_listen_on_all drivers/infiniband/core/cma.c:2557 [inline])
[<80807238>] (__list_add_valid) from [<810e61b8>] (rdma_listen+0x17c/0x37c drivers/infiniband/core/cma.c:3751)
[<810e603c>] (rdma_listen) from [<811035a0>] (ucma_listen+0xe0/0x130 drivers/infiniband/core/ucma.c:1102)
r8:84343b40 r7:811034c0 r6:86424948 r5:86ca70c0 r4:86424900
[<811034c0>] (ucma_listen) from [<811044a0>] (ucma_write+0x14c/0x1b0 drivers/infiniband/core/ucma.c:1732)
r6:86ca70c0 r5:200008c0 r4:00000010
[<81104354>] (ucma_write) from [<804da914>] (vfs_write+0xe8/0x350 fs/read_write.c:603)
r8:00000000 r7:ffffe000 r6:200008c0 r5:86c46140 r4:00000000
[<804da82c>] (vfs_write) from [<804dad30>] (ksys_write+0xb4/0xec fs/read_write.c:658)
r10:00000004 r9:86656000 r8:80200224 r7:00000010 r6:200008c0 r5:86c46140
r4:86c46141
[<804dac7c>] (ksys_write) from [<804dad78>] (__do_sys_write fs/read_write.c:670 [inline])
[<804dac7c>] (ksys_write) from [<804dad78>] (sys_write+0x10/0x14 fs/read_write.c:667)
r7:00000004 r6:ffffffff r5:00000000 r4:00000000
[<804dad68>] (sys_write) from [<80200060>] (ret_fast_syscall+0x0/0x2c arch/arm/mm/proc-v7.S:64)
Exception stack(0x86657fa8 to 0x86657ff0)
7fa0: 00000000 00000000 00000003 200008c0 00000010 00000000
7fc0: 00000000 00000000 ffffffff 00000004 7ebc531a 76f7b6d0 7ebc54a4 76f7b20c
7fe0: 76f7b048 76f7b038 00018e9c 0004ba40
Code: e34801fa e1a02001 e1a0100c eb3ffb2e (e7f001f2)
---[ end trace 7ea3f2e08d88cef1 ]---
----------------
Code disassembly (best guess):
0: e34801fa movt r0, #33274 ; 0x81fa
4: e1a02001 mov r2, r1
8: e1a0100c mov r1, ip
c: eb3ffb2e bl 0xffeccc
* 10: e7f001f2 udf #18 <-- trapping instruction


---
This report 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 issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

Jason Gunthorpe

unread,
Dec 6, 2021, 10:42:02ā€ÆAM12/6/21
to syzbot, avi...@nvidia.com, dled...@redhat.com, haakon...@oracle.com, le...@kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, syzkall...@googlegroups.com
On Sat, Dec 04, 2021 at 01:54:17AM -0800, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: bf152b0b41dc Merge tag 'for_linus' of git://git.kernel.org..

??

This commit is nearly a year old?

$ git describe --contains bf152b0b41dc
v5.12-rc4~28

I think this has probably been fixed since, why did a report for such
an old kernel get sent?

Jason

Dmitry Vyukov

unread,
Dec 6, 2021, 10:46:55ā€ÆAM12/6/21
to Jason Gunthorpe, syzbot, avi...@nvidia.com, dled...@redhat.com, haakon...@oracle.com, le...@kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, syzkall...@googlegroups.com
Hi Jason,

Oh, that's because the arm32 kernel was broken for that period, so
syzbot tested the latest working kernel. There is a more fresh x86_64
crash available on the dashboard:
https://syzkaller.appspot.com/bug?extid=c94a3675a626f6333d74

Jason Gunthorpe

unread,
Dec 6, 2021, 12:35:53ā€ÆPM12/6/21
to Dmitry Vyukov, syzbot, avi...@nvidia.com, dled...@redhat.com, haakon...@oracle.com, le...@kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, syzkall...@googlegroups.com
??

There is nothing there newer than a year?

Jason

Dmitry Vyukov

unread,
Dec 7, 2021, 3:37:42ā€ÆAM12/7/21
to Jason Gunthorpe, syzbot, avi...@nvidia.com, dled...@redhat.com, haakon...@oracle.com, le...@kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, syzkall...@googlegroups.com
In the Crashes table there are 2 crashes, one is the one that was
reported in this email and the second happened on upstream commit
5833291ab6de (you can search by this hash on the page).
5833291ab6de is newer than a year:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=5833291ab6de

Jason Gunthorpe

unread,
Dec 7, 2021, 12:15:39ā€ÆPM12/7/21
to Dmitry Vyukov, syzbot, avi...@nvidia.com, dled...@redhat.com, haakon...@oracle.com, le...@kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, syzkall...@googlegroups.com
On Tue, Dec 07, 2021 at 09:37:30AM +0100, Dmitry Vyukov wrote:

> > > https://syzkaller.appspot.com/bug?extid=c94a3675a626f6333d74
>
> In the Crashes table there are 2 crashes, one is the one that was
> reported in this email and the second happened on upstream commit
> 5833291ab6de (you can search by this hash on the page).
> 5833291ab6de is newer than a year:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=5833291ab6de

Oh I see, I did not read it properly then

Sigh, OK

I thought we fixed this :(

Jason

syzbot

unread,
Feb 8, 2022, 11:46:20ā€ÆAM2/8/22
to avi...@nvidia.com, dled...@redhat.com, dvy...@google.com, fghee...@gmail.com, haakon...@oracle.com, j...@ziepe.ca, le...@kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, syzkall...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 555f3d7be91a Merge tag '5.17-rc3-ksmbd-server-fixes' of gi..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=16c4c44fb00000
kernel config: https://syzkaller.appspot.com/x/.config?x=266de9da75c71a45
dashboard link: https://syzkaller.appspot.com/bug?extid=c94a3675a626f6333d74
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=137e0c77b00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=140b1eaa700000

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

==================================================================
BUG: KASAN: use-after-free in __list_add_valid+0x93/0xa0 lib/list_debug.c:26
Read of size 8 at addr ffff88807d24c1e0 by task syz-executor341/3597

CPU: 1 PID: 3597 Comm: syz-executor341 Not tainted 5.17.0-rc3-syzkaller-00020-g555f3d7be91a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
print_address_description.constprop.0.cold+0x8d/0x336 mm/kasan/report.c:255
__kasan_report mm/kasan/report.c:442 [inline]
kasan_report.cold+0x83/0xdf mm/kasan/report.c:459
__list_add_valid+0x93/0xa0 lib/list_debug.c:26
__list_add include/linux/list.h:69 [inline]
list_add_tail include/linux/list.h:102 [inline]
cma_listen_on_all drivers/infiniband/core/cma.c:2593 [inline]
rdma_listen+0x86e/0xde0 drivers/infiniband/core/cma.c:3862
ucma_listen+0x16a/0x210 drivers/infiniband/core/ucma.c:1105
ucma_write+0x25c/0x350 drivers/infiniband/core/ucma.c:1744
vfs_write+0x28e/0xae0 fs/read_write.c:588
ksys_write+0x1ee/0x250 fs/read_write.c:643
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f0aca906fb9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 14 00 00 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 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fffc9f11448 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f0aca906fb9
RDX: 0000000000000010 RSI: 0000000020000040 RDI: 0000000000000003
RBP: 0000000000000000 R08: 00007fffc9f115e8 R09: 00007fffc9f115e8
R10: 00007fffc9f115e8 R11: 0000000000000246 R12: 00007fffc9f1145c
R13: 431bde82d7b634db R14: 0000000000000000 R15: 0000000000000000
</TASK>

Allocated by task 3596:
kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:436 [inline]
____kasan_kmalloc mm/kasan/common.c:515 [inline]
____kasan_kmalloc mm/kasan/common.c:474 [inline]
__kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:524
kmalloc include/linux/slab.h:581 [inline]
kzalloc include/linux/slab.h:715 [inline]
__rdma_create_id+0x5b/0x5c0 drivers/infiniband/core/cma.c:845
rdma_create_user_id+0x79/0xd0 drivers/infiniband/core/cma.c:900
ucma_create_id+0x162/0x360 drivers/infiniband/core/ucma.c:464
ucma_write+0x25c/0x350 drivers/infiniband/core/ucma.c:1744
vfs_write+0x28e/0xae0 fs/read_write.c:588
ksys_write+0x1ee/0x250 fs/read_write.c:643
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae

Freed by task 3596:
kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38
kasan_set_track+0x21/0x30 mm/kasan/common.c:45
kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370
____kasan_slab_free mm/kasan/common.c:366 [inline]
____kasan_slab_free+0x130/0x160 mm/kasan/common.c:328
kasan_slab_free include/linux/kasan.h:236 [inline]
slab_free_hook mm/slub.c:1728 [inline]
slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754
slab_free mm/slub.c:3509 [inline]
kfree+0xcb/0x280 mm/slub.c:4562
ucma_close_id drivers/infiniband/core/ucma.c:187 [inline]
ucma_destroy_private_ctx+0x9ca/0xd20 drivers/infiniband/core/ucma.c:579
ucma_close+0x10a/0x180 drivers/infiniband/core/ucma.c:1809
__fput+0x286/0x9f0 fs/file_table.c:311
task_work_run+0xdd/0x1a0 kernel/task_work.c:164
exit_task_work include/linux/task_work.h:32 [inline]
do_exit+0xb29/0x2a30 kernel/exit.c:806
do_group_exit+0xd2/0x2f0 kernel/exit.c:935
__do_sys_exit_group kernel/exit.c:946 [inline]
__se_sys_exit_group kernel/exit.c:944 [inline]
__x64_sys_exit_group+0x3a/0x50 kernel/exit.c:944
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae

Last potentially related work creation:
kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38
__kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348
__call_rcu kernel/rcu/tree.c:3026 [inline]
call_rcu+0xb1/0x740 kernel/rcu/tree.c:3106
netlink_release+0xf08/0x1db0 net/netlink/af_netlink.c:813
__sock_release+0xcd/0x280 net/socket.c:650
sock_close+0x18/0x20 net/socket.c:1318
__fput+0x286/0x9f0 fs/file_table.c:311
task_work_run+0xdd/0x1a0 kernel/task_work.c:164
tracehook_notify_resume include/linux/tracehook.h:188 [inline]
exit_to_user_mode_loop kernel/entry/common.c:175 [inline]
exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:207
__syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline]
syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300
do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x44/0xae

The buggy address belongs to the object at ffff88807d24c000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 480 bytes inside of
2048-byte region [ffff88807d24c000, ffff88807d24c800)
The buggy address belongs to the page:
page:ffffea0001f49200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7d248
head:ffffea0001f49200 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea00052c7e00 dead000000000002 ffff888010c42000
raw: 0000000000000000 0000000080080008 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 2947, ts 17013492589, free_ts 15683127625
prep_new_page mm/page_alloc.c:2434 [inline]
get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4165
__alloc_pages+0x1b2/0x500 mm/page_alloc.c:5389
alloc_pages+0x1aa/0x310 mm/mempolicy.c:2271
alloc_slab_page mm/slub.c:1799 [inline]
allocate_slab mm/slub.c:1944 [inline]
new_slab+0x28a/0x3b0 mm/slub.c:2004
___slab_alloc+0x87c/0xe90 mm/slub.c:3018
__slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105
slab_alloc_node mm/slub.c:3196 [inline]
slab_alloc mm/slub.c:3238 [inline]
__kmalloc+0x2fb/0x340 mm/slub.c:4420
kmalloc include/linux/slab.h:586 [inline]
sk_prot_alloc+0x110/0x290 net/core/sock.c:1923
sk_alloc+0x32/0xa80 net/core/sock.c:1976
__netlink_create+0x63/0x2f0 net/netlink/af_netlink.c:645
netlink_create+0x3ad/0x5e0 net/netlink/af_netlink.c:708
__sock_create+0x353/0x790 net/socket.c:1468
sock_create net/socket.c:1519 [inline]
__sys_socket+0xef/0x200 net/socket.c:1561
__do_sys_socket net/socket.c:1570 [inline]
__se_sys_socket net/socket.c:1568 [inline]
__x64_sys_socket+0x6f/0xb0 net/socket.c:1568
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1352 [inline]
free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1404
free_unref_page_prepare mm/page_alloc.c:3325 [inline]
free_unref_page+0x19/0x690 mm/page_alloc.c:3404
free_contig_range+0xa8/0xf0 mm/page_alloc.c:9335
destroy_args+0xa8/0x646 mm/debug_vm_pgtable.c:1018
debug_vm_pgtable+0x298e/0x2a20 mm/debug_vm_pgtable.c:1332
do_one_initcall+0x103/0x650 init/main.c:1300
do_initcall_level init/main.c:1373 [inline]
do_initcalls init/main.c:1389 [inline]
do_basic_setup init/main.c:1408 [inline]
kernel_init_freeable+0x6b1/0x73a init/main.c:1613
kernel_init+0x1a/0x1d0 init/main.c:1502
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Memory state around the buggy address:
ffff88807d24c080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807d24c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807d24c180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807d24c200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807d24c280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Reply all
Reply to author
Forward
0 new messages