Skip to contentSkip to conversation

ibmvnic: Skip fatal error reset after passive init

PATCH Applied Juliet Kim 2 participants 2 messages Apr 30, 2020

Subsystems (4)
lore
Share & tools
lore

Juliet Kim

author
#0 lore raw

PATCH 1/1 ibmvnic: Skip fatal error reset after passive init

During MTU change, the following events may happen. Client-driven CRQ initialization fails due to partner’s CRQ closed, causing client to enqueue a reset task for FATAL_ERROR. Then passive (server-driven) CRQ initialization succeeds, causing client to release CRQ and enqueue a reset task for failover. If the passive CRQ initialization occurs before the FATAL reset task is processed, the FATAL error reset task would try to access a CRQ message queue that was freed, causing an oops. The problem may be most likely to occur during DLPAR add vNIC with a non-default MTU, because the DLPAR process will automatically issue a change MTU request.

Fix this by not processing fatal error reset if CRQ is passively initialized after client-driven CRQ initialization fails.

---
 drivers/net/ethernet/ibm/ibmvnic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/ibm/ibmvnic.c +2 -1
index 4bd33245bad6..3de549c6c693 100644
@@ -2189,7 +2189,8 @@ static void __ibmvnic_reset(struct work_struct *work)
 				rc = do_hard_reset(adapter, rwi, reset_state);
 				rtnl_unlock();
 			}
-		} else {
+		} else if (!(rwi->reset_reason == VNIC_RESET_FATAL &&
+				adapter->from_passive_init)) {
 			rc = do_reset(adapter, rwi, reset_state);
 		}
 		kfree(rwi);
Signature · 1 line
2.16.4
maintainer Applied
#1 lore raw

From: Juliet Kim <[email protected]>
Date: Thu, 30 Apr 2020 13:22:11 -0500

Quoted 11 lines

During MTU change, the following events may happen. Client-driven CRQ initialization fails due to partner’s CRQ closed, causing client to enqueue a reset task for FATAL_ERROR. Then passive (server-driven) CRQ initialization succeeds, causing client to release CRQ and enqueue a reset task for failover. If the passive CRQ initialization occurs before the FATAL reset task is processed, the FATAL error reset task would try to access a CRQ message queue that was freed, causing an oops. The problem may be most likely to occur during DLPAR add vNIC with a non-default MTU, because the DLPAR process will automatically issue a change MTU request.

Quoted 4 lines

Fix this by not processing fatal error reset if CRQ is passively initialized after client-driven CRQ initialization fails.

Applied, thanks.