Skip to content

Commit d90ad15

Browse files
sudhakar-dindukurtiSomasundaram Krishnasamy
authored andcommitted
A/A Bonding: Skip sending GARPs when module unload is in progress
Commit 5f9bb24 ("rdmaip: Fix gratuitous ARP storm") added a new work queue to send the GARP messages. During module unload, the rdmaip_garps_wq is deleted and accessed after that. The following crash occurred during module unload if one of the port is down. Workqueue: rdmaip_garps 0xffffffffc0666a40 task: ffff8dea20ae97c0 task.stack: ffff9d6f4d3e8000 RIP: 0010:0xffffffffc0666a40 RSP: 0018:ffff9d6f4d3ebe60 EFLAGS: 00010202 RAX: ffffffffc0666a40 RBX: ffff8e209f523b00 RCX: ffff8e087faa2460 RDX: 0000000000000001 RSI: ffff8e209f523b00 RDI: ffff8e209f523b00 RBP: ffff9d6f4d3ebea0 R08: 0000000000000001 R09: 00000000ffffffff R10: 0000000000000000 R11: 0000000000000008 R12: ffff8dec4855c180 R13: ffff8e087faa2440 R14: ffffbd572028c200 R15: ffff8e209f523b08 FS: 0000000000000000(0000) GS:ffff8e087fa80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffc0666a40 CR3: 000000097b40a004 CR4: 00000000003606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ? process_one_work+0x169/0x3a6 worker_thread+0x4d/0x3e5 kthread+0x105/0x138 ? rescuer_thread+0x380/0x375 ? kthread_bind+0x20/0x15 ret_from_fork+0x3e/0x49 Code: Bad RIP value. RIP: 0xffffffffc0666a40 RSP: ffff9d6f4d3ebe60 CR2: ffffffffc0666a40 rdmaip_send_gratuitous_arp() function has been updated not to queue any new work to the rdmaip_garps_wq work queue when module unload is in progress. Fixes: 5f9bb24 ("rdmaip: Fix gratuitous ARP storm") Orabug: 29781216 Signed-off-by: Sudhakar Dindukurti <[email protected]> Reviewed-by: Yuval Shaia <[email protected]> Signed-off-by: Somasundaram Krishnasamy <[email protected]>
1 parent 2b3fd77 commit d90ad15

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/infiniband/core/rdmaip.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,19 @@ static void rdmaip_send_gratuitous_arp(struct net_device *out_dev,
323323
RDMAIP_DBG2_PTR("Sending GARP message for adding IP addr %pI4 on %s\n",
324324
(void *)&ip_addr, out_dev->name);
325325

326+
/*
327+
* If module unload in progress, dont queue the work request to the
328+
* rdmaip_garps_wq.
329+
*/
330+
mutex_lock(&rdmaip_global_flag_lock);
331+
if (rdmaip_is_teardown_flag_set()) {
332+
RDMAIP_DBG2("%s: unload inprogress, dont queue GARP send\n",
333+
out_dev->name);
334+
mutex_unlock(&rdmaip_global_flag_lock);
335+
return;
336+
}
337+
mutex_unlock(&rdmaip_global_flag_lock);
338+
326339
if (rdmaip_active_bonding_arps_gap_ms == 0 ||
327340
rdmaip_active_bonding_arps_gap_ms > 100) {
328341
pr_warn("arp gap (%d) out of range, using default (%d)\n",

0 commit comments

Comments
 (0)