Test attempted using jonmason/ntb at dfb7d24c5ad5c986f2417f52784738b67cfedd4d.

 

With latest, it crashes when removing the modules.

 

[ 1494.330594] ntb_hw_intel 0000:80:03.0: qp 0: Send Link Down

[ 1494.358126] ntb_hw_intel 0000:80:03.0: NTB Transport QP 0 freed

[ 1494.364771] ntb_hw_intel 0000:00:03.0: qp 0: Send Link Down

[ 1494.400171] ntb_hw_intel 0000:00:03.0: NTB Transport QP 0 freed

[ 1494.431502] BUG: unable to handle kernel NULL pointer dereference at 00000000000000a8

[ 1494.440267] IP: [<ffffffff816c3def>] down_write+0x1f/0x40

[ 1494.446312] PGD ff3231067 [ 1494.449136] PUD ff5600067

PMD 0 [ 1494.452760]

[ 1494.454430] Oops: 0002 [#1] SMP

 

Entering kdb (current=0xffff880ff4ea2c00, pid 1297) on processor 1 Oops: (null)

due to oops @ 0xffffffff816c3def

CPU: 1 PID: 1297 Comm: rmmod Not tainted 4.9.0-ntb #25

Hardware name: EMC 900-565-027/110-325-102B-00, BIOS 23.27 12/10/2014

task: ffff880ff4ea2c00 task.stack: ffffc9000d784000

RIP: 0010:[<ffffffff816c3def>]  [<ffffffff816c3def>] down_write+0x1f/0x40

RSP: 0018:ffffc9000d787d98  EFLAGS: 00010246

RAX: 00000000000000a8 RBX: 00000000000000a8 RCX: 0000000000000001

RDX: ffffffff00000001 RSI: ffff881ff5d49258 RDI: 00000000000000a8

RBP: ffffc9000d787da0 R08: ffffffffa01b2500 R09: 000000018022000f

R10: 00000000f7f6f701 R11: ffff880ff7f6f4b0 R12: ffff880ff3e53d98

R13: ffff880ff3e53de0 R14: ffff880ff3e53d40 R15: ffff880ff3e53d40

FS:  00007f65381b3740(0000) GS:ffff880fffc40000(0000) knlGS:0000000000000000

CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033

CR2: 00000000000000a8 CR3: 0000000ff69e9000 CR4: 00000000001406e0

Stack:

ffff881ff5d49200 ffffc9000d787de0 ffffffff812ad0ed ffffffffa01390e0

ffff881ff5d49200 ffff881ff467cc00 0000000000000001 0000000000000000

ffff881ff4569800 ffffc9000d787e18 ffffffffa0135171 ffff881ff4569800

Call Trace:

[<ffffffff812ad0ed>] debugfs_remove_recursive+0x4d/0x190

[<ffffffffa0135171>] ntb_transport_free+0x61/0x160 [ntb_transport]

[<ffffffffa0031115>] ntb_remove+0x25/0x40 [ntb]

[<ffffffff8147e81a>] __device_release_driver+0x9a/0x140

[<ffffffff8147e9c8>] driver_detach+0xb8/0xc0

[<ffffffff8147d7f5>] bus_remove_driver+0x55/0xd0

[<ffffffff8147f18c>] driver_unregister+0x2c/0x50

[<ffffffffa003117e>] ntb_unregister_client+0xe/0x10 [ntb]

[<ffffffffa01379ae>] ntb_transport_exit+0x1c/0x66e [ntb_transport]

[<ffffffff8110d3ba>] SyS_delete_module+0x1ba/0x220

[<ffffffff81003a47>] do_syscall_64+0x67/0x180

[<ffffffff816c64ab>] entry_SYSCALL64_slow_path+0x25/0x25

Code: 66 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48 89 e5 53 48 89 fb e8 3e e1 ff ff 48 ba 01 00 00 00 ff ff ff ff 48 89 d8 <f0> 48 0f c1 10 85 d2 74 05 e8 53 2d c9 ff 65 48 8b 04 25 c0 d2