Re: WARNING in ib_unregister_device_queued

From: Jason Gunthorpe
Date: Mon Apr 27 2020 - 20:10:38 EST


On Sun, Apr 26, 2020 at 06:43:13AM -0700, syzbot wrote:
> Hello,
>
> syzbot found the following crash on:
>
> HEAD commit: b9663b7c net: stmmac: Enable SERDES power up/down sequence
> git tree: net
> console output: https://syzkaller.appspot.com/x/log.txt?x=166bf717e00000
> kernel config: https://syzkaller.appspot.com/x/.config?x=5d351a1019ed81a2
> dashboard link: https://syzkaller.appspot.com/bug?extid=4088ed905e4ae2b0e13b
> 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+4088ed905e4ae2b0e13b@xxxxxxxxxxxxxxxxxxxxxxxxx
>
> rdma_rxe: ignoring netdev event = 10 for netdevsim0
> infiniband yz2: set down
> WARNING: CPU: 0 PID: 22753 at drivers/infiniband/core/device.c:1565 ib_unregister_device_queued+0x122/0x160 drivers/infiniband/core/device.c:1565

The only thing I can think of for this is that ib_register_driver()
is racing with __ib_unregister_device() and took the special error
unwind.

I suspect this is not a bug, but over complexity triggering a
pre-condition WARN_ON..

Maybe the solution is to swap the dealloc_driver = NULL for some other flag.

Jason