Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1946751ima; Thu, 25 Oct 2018 07:24:39 -0700 (PDT) X-Google-Smtp-Source: AJdET5fcJqFM4vAZ0izeucUzz3BvSlsyEQLsk+inuAtlPGWo1Ep4Xxip5DwjJzZokfrr76Y0wSpb X-Received: by 2002:a62:5d49:: with SMTP id r70-v6mr1784421pfb.123.1540477479633; Thu, 25 Oct 2018 07:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540477479; cv=none; d=google.com; s=arc-20160816; b=tgye6M9iWrfnpwR6vFK7t5e6TPfXiBW0Ap4XKYxK15oQi/IwtnP0Utaet0ys4sTRZU q4VikwB4RnMDIc2ykmF4tsW2RnfJ9x+tCEXiVGPA2C4FzFzEp+kWmFT04rcWMkpSSKqD 3rXz0s0GGgDmfT493levFFxARbiREO43v9N8KyroZw/1OCIB2ooe6TauEC4RA+swNuG2 S/S8l9Bt+CIQaFj6Nv6SdXsjycGrviaL7V45A0nPXEKlUUSMxrkKHNyfMGDUcuEoyqMF unLXmWKq+5F/zTMPzUVZ4+KH3290TZnKU+3+OchxBLdQA3bqyjse4KVyYWn9OPjTiHwF BK1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=mnAsCB+Fk8ULz+ULIJ/vS73Wh27UDq7/6fUt98j4yXc=; b=tPhn0iQ77ov5j47JogYefvzMj0O5tpWXFhso1ct40euiTGa3ZLk/6IbzAddAn2DLYK UCDe6+c3WmXwsKbiheveZt6J2CyNmETWX3pppoA8Li1Vohh/GOuzSvuXhvfGqfXjVJ+f fTuslWoQFB59w6BXJ0J0nuRLdGHth8IXxJjJa5cufoRN8goy377vZ1h9pxkqv8LKjOTZ zM4+fhraeMg1pvgNqcTk98imX7EIjY67TEZqt6pAIleZhLS2qb+oPLwCSc515sWMPmRu OST4brWrlIHkLVoWjM7TbkBNkAdvjY5vGIMJ242QNKFrUCBcmznWVEe0hrjY4gzYtvdl 1Lfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vletjZDk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7-v6si8068013pgh.131.2018.10.25.07.23.58; Thu, 25 Oct 2018 07:24:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vletjZDk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731470AbeJYWyR (ORCPT + 99 others); Thu, 25 Oct 2018 18:54:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:37188 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731391AbeJYWyQ (ORCPT ); Thu, 25 Oct 2018 18:54:16 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2F71A20870; Thu, 25 Oct 2018 14:21:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540477278; bh=MPWFi560yOeX4JgVSuJpYQypv0uTb7WtGvIpj3T+jTE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vletjZDkq65gOUqI9IM6SX4Ogvzh5/yh20E+cp0P2PnVB2djR1R8vq/dThDckv04S nP8puJ5oJ99dtGFsVfO4dlfzVg8AtDDDH8eKJMGmyVWbO+IuEad1UB1RqBHSHAQsAk sLxvrpt7ccYEr/N6TdrG3ozodQjweZV5i0ak+c/c= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jan Beulich , Jan Beulich , Jeff Kirsher , Sasha Levin Subject: [PATCH AUTOSEL 3.18 93/98] igb: fix NULL derefs due to skipped SR-IOV enabling Date: Thu, 25 Oct 2018 10:18:48 -0400 Message-Id: <20181025141853.214051-93-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141853.214051-1-sashal@kernel.org> References: <20181025141853.214051-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jan Beulich [ Upstream commit be06998f96ecb93938ad2cce46c4289bf7cf45bc ] The combined effect of commits 6423fc3416 ("igb: do not re-init SR-IOV during probe") and ceee3450b3 ("igb: make sure SR-IOV init uses the right number of queues") causes VFs no longer getting set up, leading to NULL pointer dereferences due to the adapter's ->vf_data being NULL while ->vfs_allocated_count is non-zero. The first commit not only neglected the side effect of igb_sriov_reinit() that the second commit tried to account for, but also that of setting IGB_FLAG_HAS_MSIX, without which igb_enable_sriov() is effectively a no-op. Calling igb_{,re}set_interrupt_capability() as done here seems to address this, but I'm not sure whether this is better than sinply reverting the other two commits. Signed-off-by: Jan Beulich Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/igb/igb_main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 84049078c4f0..b73c896ed184 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -2866,6 +2866,13 @@ static void igb_probe_vfs(struct igb_adapter *adapter) if ((hw->mac.type == e1000_i210) || (hw->mac.type == e1000_i211)) return; + /* Of the below we really only want the effect of getting + * IGB_FLAG_HAS_MSIX set (if available), without which + * igb_enable_sriov() has no effect. + */ + igb_set_interrupt_capability(adapter, true); + igb_reset_interrupt_capability(adapter); + pci_sriov_set_totalvfs(pdev, 7); igb_enable_sriov(pdev, max_vfs); -- 2.17.1