syzbot


BUG: sleeping function called from invalid context in rxe_alloc_nl

Status: fixed on 2021/04/09 19:46
Subsystems: rdma
[Documentation on labels]
Reported-by: syzbot+ec2fd72374785d0e558e@syzkaller.appspotmail.com
Fix commit: c4369575b2bc RDMA/rxe: Fix bug in rxe_alloc()
First crash: 1414d, last: 1399d
Cause bisection: introduced by (bisect log) :
commit 3853c35e243d56238159e8365b6aca410bdd4576
Author: Bob Pearson <rpearsonhpe@gmail.com>
Date: Wed Dec 16 23:15:49 2020 +0000

  RDMA/rxe: Add unlocked versions of pool APIs

Crash: BUG: sleeping function called from invalid context in rxe_alloc_nl (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
BUG: sleeping function called from invalid context in rxe_alloc_nl 1 (2) 2021/01/19 18:44

Sample crash report:
netdevsim netdevsim0 netdevsim1: set [1, 0] type 2 family 0 port 6081 - 0
netdevsim netdevsim0 netdevsim2: set [1, 0] type 2 family 0 port 6081 - 0
netdevsim netdevsim0 netdevsim3: set [1, 0] type 2 family 0 port 6081 - 0
infiniband syz2: set active
infiniband syz2: added bond_slave_0
BUG: sleeping function called from invalid context at drivers/infiniband/sw/rxe/rxe_pool.c:346
in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 8459, name: syz-executor401
6 locks held by syz-executor401/8459:
 #0: ffffffff8fc4a418 (&rdma_nl_types[idx].sem){.+.+}-{3:3}, at: rdma_nl_rcv_msg+0x161/0x690 drivers/infiniband/core/netlink.c:164
 #1: ffffffff8c78ced0 (link_ops_rwsem){++++}-{3:3}, at: nldev_newlink+0x261/0x540 drivers/infiniband/core/nldev.c:1545
 #2: ffffffff8c77c470 (devices_rwsem){++++}-{3:3}, at: enable_device_and_get+0xfc/0x3b0 drivers/infiniband/core/device.c:1307
 #3: ffffffff8c77c330 (clients_rwsem){++++}-{3:3}, at: enable_device_and_get+0x15b/0x3b0 drivers/infiniband/core/device.c:1315
 #4: ffff88802adc8598 (&device->client_data_rwsem){++++}-{3:3}, at: add_client_context+0x3d0/0x5e0 drivers/infiniband/core/device.c:715
 #5: ffff88802adc9640 (&pool->pool_lock){....}-{2:2}, at: rxe_alloc+0x1b/0x40 drivers/infiniband/sw/rxe/rxe_pool.c:384
irq event stamp: 138912
hardirqs last  enabled at (138911): [<ffffffff88fe5c72>] __raw_read_unlock_irqrestore include/linux/rwlock_api_smp.h:235 [inline]
hardirqs last  enabled at (138911): [<ffffffff88fe5c72>] _raw_read_unlock_irqrestore+0x42/0x50 kernel/locking/spinlock.c:263
hardirqs last disabled at (138912): [<ffffffff88fe5955>] __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:157 [inline]
hardirqs last disabled at (138912): [<ffffffff88fe5955>] _raw_read_lock_irqsave+0x85/0x90 kernel/locking/spinlock.c:231
softirqs last  enabled at (138886): [<ffffffff89000eaf>] asm_call_irq_on_stack+0xf/0x20
softirqs last disabled at (138843): [<ffffffff89000eaf>] asm_call_irq_on_stack+0xf/0x20
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 1 PID: 8459 Comm: syz-executor401 Not tainted 5.11.0-rc4-next-20210119-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x107/0x163 lib/dump_stack.c:120
 ___might_sleep.cold+0x1f1/0x237 kernel/sched/core.c:8083
 rxe_alloc_nl+0x55c/0x710 drivers/infiniband/sw/rxe/rxe_pool.c:346
 rxe_alloc+0x26/0x40 drivers/infiniband/sw/rxe/rxe_pool.c:385
 rxe_get_dma_mr+0x49/0x110 drivers/infiniband/sw/rxe/rxe_verbs.c:870
 __ib_alloc_pd+0x277/0x6d0 drivers/infiniband/core/verbs.c:299
 ib_mad_port_open drivers/infiniband/core/mad.c:2981 [inline]
 ib_mad_init_device+0xc78/0x1400 drivers/infiniband/core/mad.c:3092
 add_client_context+0x405/0x5e0 drivers/infiniband/core/device.c:717
 enable_device_and_get+0x1cd/0x3b0 drivers/infiniband/core/device.c:1317
 ib_register_device drivers/infiniband/core/device.c:1399 [inline]
 ib_register_device+0x7c7/0xa50 drivers/infiniband/core/device.c:1351
 rxe_register_device+0x3b2/0x480 drivers/infiniband/sw/rxe/rxe_verbs.c:1147
 rxe_add+0x12fe/0x16d0 drivers/infiniband/sw/rxe/rxe.c:247
 rxe_net_add+0x8c/0xe0 drivers/infiniband/sw/rxe/rxe_net.c:489
 rxe_newlink drivers/infiniband/sw/rxe/rxe.c:269 [inline]
 rxe_newlink+0xb7/0xe0 drivers/infiniband/sw/rxe/rxe.c:250
 nldev_newlink+0x30e/0x540 drivers/infiniband/core/nldev.c:1555
 rdma_nl_rcv_msg+0x36d/0x690 drivers/infiniband/core/netlink.c:195
 rdma_nl_rcv_skb drivers/infiniband/core/netlink.c:239 [inline]
 rdma_nl_rcv+0x2ee/0x430 drivers/infiniband/core/netlink.c:259
 netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline]
 netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1330
 netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1919
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:672
 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2345
 ___sys_sendmsg+0xf3/0x170 net/socket.c:2399
 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2432
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x443689
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 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 eb 0d fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffd92ed8ec8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000443689
RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000003
RBP: 00007ffd92ed8ed0 R08: 0000000001bbbbbb R09: 0000000001bbbbbb
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffd92ed8ee0
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
RDS/IB: syz2: added
smc: adding ib device syz2 with port count 1
smc:    ib device syz2 port 1 has pnetid 

Crashes (475):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/01/19 12:32 linux-next b4bb878f3eb3 63631df1 .config console log report syz C ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/02 11:57 linux-next fd821bf0ed9a 19e09687 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/02 10:44 linux-next fd821bf0ed9a 19e09687 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/02 08:51 linux-next fd821bf0ed9a 19e09687 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/02 07:49 linux-next fd821bf0ed9a e6b95f32 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/02 05:40 linux-next fd821bf0ed9a e6b95f32 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/02 05:05 linux-next fd821bf0ed9a e6b95f32 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/02 03:55 linux-next fd821bf0ed9a e6b95f32 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/02 01:57 linux-next fd821bf0ed9a e6b95f32 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/02 00:26 linux-next fd821bf0ed9a e6b95f32 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/01 22:36 linux-next fd821bf0ed9a e6b95f32 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/01 21:20 linux-next fd821bf0ed9a e6b95f32 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/01 20:08 linux-next fd821bf0ed9a e6b95f32 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/01 19:43 linux-next fd821bf0ed9a e6b95f32 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/01 18:16 linux-next fd821bf0ed9a e6b95f32 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/01 16:35 linux-next fd821bf0ed9a e6b95f32 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/01 15:34 linux-next fd821bf0ed9a e6b95f32 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/01 11:26 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/01 10:18 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/01 08:47 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/01 04:34 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/01 03:41 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/02/01 02:37 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/31 18:04 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/31 14:57 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/31 12:08 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/31 09:12 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/31 05:49 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/31 02:15 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/30 15:08 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/30 13:16 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/30 12:27 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/30 07:30 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/30 06:22 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/30 00:55 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/29 23:26 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/29 22:20 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/29 21:15 linux-next b01f250d83f6 fc9fd31e .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/29 15:27 linux-next b01f250d83f6 6593fd32 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/29 13:30 linux-next b01f250d83f6 6593fd32 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/29 12:20 linux-next b01f250d83f6 6593fd32 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/29 11:01 linux-next b01f250d83f6 6593fd32 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/29 09:37 linux-next b01f250d83f6 6593fd32 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/28 23:40 linux-next d03154e8bb6a 7df34f59 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/28 18:11 linux-next d03154e8bb6a 7df34f59 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/28 17:00 linux-next d03154e8bb6a 7df34f59 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/28 15:57 linux-next d03154e8bb6a 7df34f59 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
2021/01/18 08:53 linux-next 93bf8b946e5f fd103621 .config console log report info ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in rxe_alloc_nl
* Struck through repros no longer work on HEAD.