Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8612238ybi; Thu, 6 Jun 2019 15:52:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqz86eW01szAgNuhiKTLBFuB/1RC46bFDft/HTuZuiN4Bng5XQB9YBKL08Gk6mx7pf+xf0v3 X-Received: by 2002:a65:518d:: with SMTP id h13mr170860pgq.186.1559861578691; Thu, 06 Jun 2019 15:52:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559861578; cv=none; d=google.com; s=arc-20160816; b=zpb76j1ULQ7iUtKhcM1mgsOt0fKod/wTIuGbOCL/dgND8Qng6jbRR118JAKLeDFsPY esYmS3Rmyz/oyKplp3LsMBvAve5mVs9viV9VSIXMhFg2xjJuaeR6nOgDBmC0VinLPbKW IqxYWPELiJbh87OftalpKThW79DQ9E3jeNsmFL/7aTdwE8vej5VJup1qYObLIOT173qq k59PhXVn24hOpiB0H2UkwoMmc+AwS/AXb9VzA9MxV8wXxJ4SvhG1AF5pm8WiZx9EZH1O GZzrEa1S8D4yg7pX5NJ4TUVNFoQW6oaah/P80yOWyzazTuHBSqMKy2DxGZAd5TPx42BR Eu7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=0mKcd9JDpaqkBbeFapI3fjbNYZFF/Dwmmx0vxB+WOXI=; b=aZnN22ke4Z19CI65qpN6ACHukWtdJYMAYOw39igHsaH92sNXxn/lYkF70AdO42RtN9 /mRBT4rXWfunnvfF5U8BUeR1C2jyZSSoeN42DArdrd5XM4r6B2UBIcDCKzpk16U7tN9F 3b/xBTY+A3Ya2rCrZQvd3lPGEAonKcjU2gXAS2eQ83pPyYJdOiSbqWeVwKoCDHNsRnZ/ Tgs+C8mnxcKUlrqIbKHLmGNb1LHdPDCZPzXtjmJqdn1u03EX1JVPl5LZXTcbhl3JB3N3 B2RrWpu+OLsAyY9jTo8hTS5skSQKJl4YRBoVsuyfCgv5nUAkVsY1wESZzY0LXOcSH0v/ E2ZQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q187si199007pfq.74.2019.06.06.15.52.42; Thu, 06 Jun 2019 15:52:58 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727358AbfFFWvU (ORCPT + 99 others); Thu, 6 Jun 2019 18:51:20 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:33386 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726352AbfFFWvU (ORCPT ); Thu, 6 Jun 2019 18:51:20 -0400 Received: from mail-it1-f199.google.com ([209.85.166.199]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hZ1E6-0000YY-1j for linux-kernel@vger.kernel.org; Thu, 06 Jun 2019 22:51:18 +0000 Received: by mail-it1-f199.google.com with SMTP id l124so259660itg.6 for ; Thu, 06 Jun 2019 15:51:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=0mKcd9JDpaqkBbeFapI3fjbNYZFF/Dwmmx0vxB+WOXI=; b=G3NC/swajW3o73vwKKti89gYhXLeH3FvwgWeF4i0/eY7Lgh5TapVvXkb9bu+wHjpLN Ns1SGDcejtDhWYYYizN50OE/ZPITAVeUtFPHx/2vQCwUMYe9dw9m8k3r5jJGjjELVGWy UWDmNSSEi5chYzbqXzIlXDKxm2sLHAufxH0zYq2wBLe9/4td0I+4/3/6sDQmdigbew45 Jj6ScUWS/Mp7nZSLcaq0Z7pOX6lN7lfC2XixUutpmBq/tTKcTliVZdXbPL7HkkTJRWMs yj37Fy8UeDPl30P5OWFhR5jDdmJ0IBe9SXRLy31pB9IrEOBLvT4TQpPTz5MIJQKu4olO DIxg== X-Gm-Message-State: APjAAAVS/VA4pFctcayh/ARUKcVSrBxq/1SxHLxthXnkgXzSxAOEQTK2 HDNolTqMEytjLQ2td5gcXN5xlnyL5QYBhXYQxEyaPuRhnucNAg2x+ibfD14icUImzXyXGTOGDGp HG/x4oYenAZ/6CWVwfnserNu50Q/PfB4eDVpLMEDhfg== X-Received: by 2002:a5d:8c81:: with SMTP id g1mr30443058ion.239.1559861476516; Thu, 06 Jun 2019 15:51:16 -0700 (PDT) X-Received: by 2002:a5d:8c81:: with SMTP id g1mr30443035ion.239.1559861476133; Thu, 06 Jun 2019 15:51:16 -0700 (PDT) Received: from xps13.canonical.com (c-71-56-235-36.hsd1.co.comcast.net. [71.56.235.36]) by smtp.gmail.com with ESMTPSA id g21sm62859ita.43.2019.06.06.15.51.15 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 06 Jun 2019 15:51:15 -0700 (PDT) Date: Thu, 6 Jun 2019 16:51:14 -0600 From: dann frazier To: Jeff Kirsher , "David S. Miller" , Shannon Nelson Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ixgbe: Avoid NULL pointer dereference with VF on non-IPsec hw Message-ID: <20190606225114.GA31678@xps13.dannf> References: <20190522232258.10353-1-dann.frazier@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190522232258.10353-1-dann.frazier@canonical.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hey David, Jeff - is it possible to get this queued up as a fix for 5.2? -dann On Wed, May 22, 2019 at 05:22:58PM -0600, dann frazier wrote: > An ipsec structure will not be allocated if the hardware does not support > offload. Fixes the following Oops: > > [ 191.045452] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 > [ 191.054232] Mem abort info: > [ 191.057014] ESR = 0x96000004 > [ 191.060057] Exception class = DABT (current EL), IL = 32 bits > [ 191.065963] SET = 0, FnV = 0 > [ 191.069004] EA = 0, S1PTW = 0 > [ 191.072132] Data abort info: > [ 191.074999] ISV = 0, ISS = 0x00000004 > [ 191.078822] CM = 0, WnR = 0 > [ 191.081780] user pgtable: 4k pages, 48-bit VAs, pgdp = 0000000043d9e467 > [ 191.088382] [0000000000000000] pgd=0000000000000000 > [ 191.093252] Internal error: Oops: 96000004 [#1] SMP > [ 191.098119] Modules linked in: vhost_net vhost tap vfio_pci vfio_virqfd vfio_iommu_type1 vfio xt_CHECKSUM iptable_mangle ipt_MASQUERADE iptable_nat nf_nat_ipv4 nf_nat xt_conntrack nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ipt_REJECT nf_reject_ipv4 xt_tcpudp bridge stp llc ebtable_filter devlink ebtables ip6table_filter ip6_tables iptable_filter bpfilter ipmi_ssif nls_iso8859_1 input_leds joydev ipmi_si hns_roce_hw_v2 ipmi_devintf hns_roce ipmi_msghandler cppc_cpufreq sch_fq_codel ib_iser rdma_cm iw_cm ib_cm ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi ip_tables x_tables autofs4 ses enclosure btrfs zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor hid_generic usbhid hid raid6_pq libcrc32c raid1 raid0 multipath linear ixgbevf hibmc_drm ttm > [ 191.168607] drm_kms_helper aes_ce_blk aes_ce_cipher syscopyarea crct10dif_ce sysfillrect ghash_ce qla2xxx sysimgblt sha2_ce sha256_arm64 hisi_sas_v3_hw fb_sys_fops sha1_ce uas nvme_fc mpt3sas ixgbe drm hisi_sas_main nvme_fabrics usb_storage hclge scsi_transport_fc ahci libsas hnae3 raid_class libahci xfrm_algo scsi_transport_sas mdio aes_neon_bs aes_neon_blk crypto_simd cryptd aes_arm64 > [ 191.202952] CPU: 94 PID: 0 Comm: swapper/94 Not tainted 4.19.0-rc1+ #11 > [ 191.209553] Hardware name: Huawei D06 /D06, BIOS Hisilicon D06 UEFI RC0 - V1.20.01 04/26/2019 > [ 191.218064] pstate: 20400089 (nzCv daIf +PAN -UAO) > [ 191.222873] pc : ixgbe_ipsec_vf_clear+0x60/0xd0 [ixgbe] > [ 191.228093] lr : ixgbe_msg_task+0x2d0/0x1088 [ixgbe] > [ 191.233044] sp : ffff000009b3bcd0 > [ 191.236346] x29: ffff000009b3bcd0 x28: 0000000000000000 > [ 191.241647] x27: ffff000009628000 x26: 0000000000000000 > [ 191.246946] x25: ffff803f652d7600 x24: 0000000000000004 > [ 191.252246] x23: ffff803f6a718900 x22: 0000000000000000 > [ 191.257546] x21: 0000000000000000 x20: 0000000000000000 > [ 191.262845] x19: 0000000000000000 x18: 0000000000000000 > [ 191.268144] x17: 0000000000000000 x16: 0000000000000000 > [ 191.273443] x15: 0000000000000000 x14: 0000000100000026 > [ 191.278742] x13: 0000000100000025 x12: ffff8a5f7fbe0df0 > [ 191.284042] x11: 000000010000000b x10: 0000000000000040 > [ 191.289341] x9 : 0000000000001100 x8 : ffff803f6a824fd8 > [ 191.294640] x7 : ffff803f6a825098 x6 : 0000000000000001 > [ 191.299939] x5 : ffff000000f0ffc0 x4 : 0000000000000000 > [ 191.305238] x3 : ffff000028c00000 x2 : ffff803f652d7600 > [ 191.310538] x1 : 0000000000000000 x0 : ffff000000f205f0 > [ 191.315838] Process swapper/94 (pid: 0, stack limit = 0x00000000addfed5a) > [ 191.322613] Call trace: > [ 191.325055] ixgbe_ipsec_vf_clear+0x60/0xd0 [ixgbe] > [ 191.329927] ixgbe_msg_task+0x2d0/0x1088 [ixgbe] > [ 191.334536] ixgbe_msix_other+0x274/0x330 [ixgbe] > [ 191.339233] __handle_irq_event_percpu+0x78/0x270 > [ 191.343924] handle_irq_event_percpu+0x40/0x98 > [ 191.348355] handle_irq_event+0x50/0xa8 > [ 191.352180] handle_fasteoi_irq+0xbc/0x148 > [ 191.356263] generic_handle_irq+0x34/0x50 > [ 191.360259] __handle_domain_irq+0x68/0xc0 > [ 191.364343] gic_handle_irq+0x84/0x180 > [ 191.368079] el1_irq+0xe8/0x180 > [ 191.371208] arch_cpu_idle+0x30/0x1a8 > [ 191.374860] do_idle+0x1dc/0x2a0 > [ 191.378077] cpu_startup_entry+0x2c/0x30 > [ 191.381988] secondary_start_kernel+0x150/0x1e0 > [ 191.386506] Code: 6b15003f 54000320 f1404a9f 54000060 (79400260) > > Fixes: eda0333ac2930 ("ixgbe: add VF IPsec management") > Signed-off-by: dann frazier > --- > drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c > index ff85ce5791a36..31629fc7e820f 100644 > --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c > +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c > @@ -842,6 +842,9 @@ void ixgbe_ipsec_vf_clear(struct ixgbe_adapter *adapter, u32 vf) > struct ixgbe_ipsec *ipsec = adapter->ipsec; > int i; > > + if (!ipsec) > + return; > + > /* search rx sa table */ > for (i = 0; i < IXGBE_IPSEC_MAX_SA_COUNT && ipsec->num_rx_sa; i++) { > if (!ipsec->rx_tbl[i].used)