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 55E51A00BE for ; Tue, 28 Apr 2020 01:28:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 280AA1D548; Tue, 28 Apr 2020 01:28:37 +0200 (CEST) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id 5DDD21D52F for ; Tue, 28 Apr 2020 01:28:34 +0200 (CEST) Received: by mail-pl1-f193.google.com with SMTP id w3so7593472plz.5 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=N9ZITYLFjOsQ/KWBzvhnB3fRFgzub/83FKZLIJHeNRel6CpW+brtrHRveiz1R1kKYs cBYDfE0HS/0nctaRuD13SBtWj3NJJZs88T66Nu+pbXKfIgpK6OXZMevXJPTzVCJpjj34 d0TWd+z1jtGk91+UF+Kc0lAZxEnNebZ/tobbuvWjHo2V5DchOW52BhIxopGb5mLfyjg9 tJUJdacByoVgOWekNsep5xT5JiGNxjDVSEpgKqU2pZoCSw1EjJRgTF3skKxnuPfKQI13 iWKqIXdH+Kz8nnDUYJL93DkDf6akOLS2hAQkE1dNsqi2nEvpGLflZkAdY7LU4ROwpw7/ LaTA== X-Gm-Message-State: AGi0Pua2MRBE+SpOy7wM7V/vxTbYP79AhFmZ9xpVTlYhbGwfB1mnnVuu OHPZW8XxAwj/njxxaPof3CxNyA== 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-stable] [PATCH 2/4] net/netvsc: fix invalid rte_free on dev_close X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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