From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2C23CA00BE; Tue, 28 Apr 2020 01:28:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4BBD11D54C; Tue, 28 Apr 2020 01:28:38 +0200 (CEST) Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by dpdk.org (Postfix) with ESMTP id E99211D52F for ; Tue, 28 Apr 2020 01:28:34 +0200 (CEST) Received: by mail-pj1-f68.google.com with SMTP id ms17so302845pjb.0 for ; Mon, 27 Apr 2020 16:28:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sOHvfQKXCdE14EJdc9Vp1Bb5Jl1FLm+suh/wl6HVMbU=; b=ZJFoRsSrKWxGj11eg86+qUh7NlH/xV/Hgz6SKwG+xVJIt6TwwBSDEMGKeLbR9WWnKu 5Z6nUb90muJp7onhAnmpBmw8fM+QqN0zaVwSyZXw/BkpDvwHEiwUES2TlaHCtyxWD/M9 slHhTav1zt6qrhEAhNKWYum2OjmJN9AzoSS9GewuE1Y6COC/z3i1KySHbZXqHJlsHJrx 5wOez9FOQ0i2MK3YKSan9GhcI3bP3hjCcr5OobrW1TNWH00p1nPYfoNHx0E7eX9terPd tBUu76F+aD7JGb59yQhIh3ZbB2zLI1eS8CUi8c/L7v6zCpMePQ8hVeHrRrDFYSlSWo6o Fu5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sOHvfQKXCdE14EJdc9Vp1Bb5Jl1FLm+suh/wl6HVMbU=; b=IU4eAoAQg9UMqOD0dIRRKMZWNs+Xgvl1VAO1T1EcRjXAXGQJgeUhba7oJNooIkD8gs M/UnJt2JYlREbko/F7FqQSbN7SjjxJ+BMf0jNrtPvzE4ibgPa29wt0btJhy3Q8zQa06h BK+NDyMv1jQZUqbv5mTtlgcy3ccv0/48/p2vr9lIlv5rEjqCHaHJcsN9842g3f25vesY 3r/pgijHQQfAvJ30CaLH09zthK3wP/16+mA/bsTA+8J69VrGW3aeO6NhCpmiI1MdbaV2 K1V+DmHr0CqwegRtkUpbPH1VfqQ18/xYGc4oB9SrzOZK+xC0D9HF0zTzwPm6+aTkr/DX 6uXg== X-Gm-Message-State: AGi0PuaLETgwLEJWIS1BLAElgad+uvudh8mVP5ksioZupmAH/jqR3AP6 Om7wmgFDXrwCMxunJcSBK0orevRrTVg= X-Google-Smtp-Source: APiQypLq2zC+JVP3cCHa6ssjS1oAwEitEP1r7TndvRi73KTwXnF6W9F07dDxte1ajMabkWrqQ2DqGQ== X-Received: by 2002:a17:90b:1104:: with SMTP id gi4mr1394730pjb.115.1588030113375; Mon, 27 Apr 2020 16:28:33 -0700 (PDT) Received: from hermes.corp.microsoft.com (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id z28sm13797586pfr.3.2020.04.27.16.28.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 16:28:32 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org Date: Mon, 27 Apr 2020 16:28:20 -0700 Message-Id: <20200427232822.21695-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200427232822.21695-1-stephen@networkplumber.org> References: <20200427232822.21695-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/4] net/netvsc: fix invalid rte_free on dev_close X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The netvsc PMD is putting the mac address in private data. Unless dev->data->mac_addrs is NULL'd rte_ethdev_close will try and free the address array. Causing the following scary error. EAL: Invalid memory This is a simpler alternative to the fix already merged in 20.05-rc1 Fixes: f8279f47dd89 ("net/netvsc: fix crash in secondary process") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/net/netvsc/hn_ethdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index 05f1a25a1abc..96480f930a46 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -849,6 +849,9 @@ hn_dev_close(struct rte_eth_dev *dev) hn_vf_close(dev); hn_dev_free_queues(dev); + + /* mac_addrs must not be freed alone because part of dev_private */ + dev->data->mac_addrs = NULL; } static const struct eth_dev_ops hn_eth_dev_ops = { -- 2.20.1