Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2352073pxb; Mon, 20 Sep 2021 19:48:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtWylbjFdnyAyEkGDdDN7+Ax0S8cbImsxT1UFyyMvAZKL8lmPersLiUj13KeZNjmJ8JQdR X-Received: by 2002:a17:906:25d7:: with SMTP id n23mr32997376ejb.322.1632192534891; Mon, 20 Sep 2021 19:48:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192534; cv=none; d=google.com; s=arc-20160816; b=l+rPo18QBEp1sWq1/4oFXSBjnkIuUyGCUdaOe0NJDfVna0a0elNNV6Jm0vu+SMdxCl NlpKOTYis+C3S/Ilr3n7wdFvJOqX6Kka5oqO2EndmNNsk7mw9egeUY8JhtSo3Ajc6oGv IE5Wo+LdQEE1jSENIvXGWwzkb3tRa9eTC9xVehCwHWgPlUAg7lJWrf9jCh7MbeZkmzMe +iz9sI25cBYJQG/1pp7i3USRNHpCdbcUAqGkUKTNRmWJhPZYJe5LDU64Qn72+QwOMM2M hESxHI1Xejt9AXO0s2MR7NAyKR6X6MPjoLGBIhbdqRiZYwl1GtBZaKjgioarGkO/P/D8 jVAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Xf38HrBCOOv0eGddSUyGeBkPVCBhIWY/WjZb63SH+fs=; b=bBRIyLl4OZHlXz2i7qfYPeck/Rk6iBgTduLovWFEj45Jc69F4DV0tEe7N+kGJDXLJu sKBU6zSpfC4DPEjOkxl2LWnXtLGZQaseeb4R84peIKGZnDnfiBDT8Dbn03z7zxl0cPzW QsmA+5oCEpDJBrCt9kF8xvV3Hr/T7yLZDZ5nhTqkiQsMS89w7bMFhpBkoc1N2s2W5n4C nmgmG3VXyhYzlgyT1c9yEP7QixOLHpR7sY7nktmu/KvQCt1hIjj894vviFLt96G5z5A2 uKwbJrq4xyudWDCAPu6Me6JRKsftfhdANBV1EGQLZg4yv0GEHwgfOAihEIvkeS4bVBpy azcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TJqTxJm3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ha25si1555875ejb.302.2021.09.20.19.48.29; Mon, 20 Sep 2021 19:48:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TJqTxJm3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348439AbhITS2L (ORCPT + 99 others); Mon, 20 Sep 2021 14:28:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:44436 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377970AbhITSWV (ORCPT ); Mon, 20 Sep 2021 14:22:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0BE24632B8; Mon, 20 Sep 2021 17:24:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158658; bh=IZK9OZv12p0XxyvgtipBzxEnU5T0Fdju4ohFkjkdYYQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TJqTxJm3ZrhKC4KrcG5vXOwaJKALLiQq1JKNQkOPa/V+Q2aNIIOmGa6BC+S+XqI5k bowivuTlSvh8v64xclDxdWUBuwSbFReYQvqyh+oKfRgZxxKIks5BKk+jdsMNQMRhDj B1wCG+Oy8NWFtEdD7yoHV8Wjb6nKUoUZiEpSXgoc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sukadev Bhattiprolu , "David S. Miller" Subject: [PATCH 5.4 226/260] ibmvnic: check failover_pending in login response Date: Mon, 20 Sep 2021 18:44:04 +0200 Message-Id: <20210920163938.794105888@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sukadev Bhattiprolu commit 273c29e944bda9a20a30c26cfc34c9a3f363280b upstream. If a failover occurs before a login response is received, the login response buffer maybe undefined. Check that there was no failover before accessing the login response buffer. Fixes: 032c5e82847a ("Driver for IBM System i/p VNIC protocol") Signed-off-by: Sukadev Bhattiprolu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/ibm/ibmvnic.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -4277,6 +4277,14 @@ static int handle_login_rsp(union ibmvni return 0; } + if (adapter->failover_pending) { + adapter->init_done_rc = -EAGAIN; + netdev_dbg(netdev, "Failover pending, ignoring login response\n"); + complete(&adapter->init_done); + /* login response buffer will be released on reset */ + return 0; + } + netdev->mtu = adapter->req_mtu - ETH_HLEN; netdev_dbg(adapter->netdev, "Login Response Buffer:\n");