From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DF3F5A034F for ; Wed, 11 Aug 2021 12:21:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D2A3F40042; Wed, 11 Aug 2021 12:21:47 +0200 (CEST) Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) by mails.dpdk.org (Postfix) with ESMTP id 8515240042 for ; Wed, 11 Aug 2021 12:21:47 +0200 (CEST) Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPS id 5966C3F102 for ; Wed, 11 Aug 2021 10:21:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1628677307; bh=Z/h4pa/sJE0pWqaXQ9iKssjHHH9SfmbdEmHW4NpGz0s=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=raSOJyzJvy7JRR5p0Eyw790nvv/4GRKgsbl9s9J8JMVpLa6S7IjnxcI+xCcmnqXP4 9UIpHUhvtH3KKpHZI/UNauh9ZWPcDo6UZZeIjbo1M2v3+paMIi+59mtLKbBmt9vyeS hN01bf9LML0frmub+RQBvmKcLUa4v/CwRw658IVWKav7T168gu3wjmLCxTmbQHDqNp Fk/Dlqz1zYjRTST0+9KuLjVySxhcdkJ1jWw7fcwii+8j4DK7oCr65cPVU03hkLOn1W 5eIbTm1HmqsU3e6sVCtS/t+6rWLsk0V+C1KZsWoswNECz7B7FW2GFq222DHDCdwtDF fJ5q6BYjC4wJw== Received: by mail-qv1-f71.google.com with SMTP id u11-20020ad45aab0000b029033e289c093aso981300qvg.10 for ; Wed, 11 Aug 2021 03:21:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Z/h4pa/sJE0pWqaXQ9iKssjHHH9SfmbdEmHW4NpGz0s=; b=bptXFDTAAEmdq3lIi0swI1jZ91RWOf/65qlmtOrnv8f8hfKu/iKQbu9WFpsA8AxMHf bsRL//ctT7MZVDwNVSHfOV6CHOOK/2eaLKBxyzaLICwHnKloJh1yTecw36fJdOYBbQa5 Mc9kvMu9gegexslE1XY5aPA6f19mxOLEhzaEPtX0b2lYbIil49jytHcgD9wmft0U++Yt 3MHO3QespG8sJexciOzMN8eAxHrjpZa9qlvoLBqxNYFNyjTXI3EM9Q1lIwCKUmOyuWbv rvWPEQ9/bHYbAn4umYKVCTl1T7zIt72nx4/Nu1dE0iya34v9bfTNKtxTKiopOjxuX6hj R+WQ== X-Gm-Message-State: AOAM533VVt5OEJTbZXAytTLhGeaMfXdxdto1bah1VqdkNiZOtuqi2z7S ah2NnDkIFZ/JEodzowLfTsUcV+3emGtmxVeb+0W28qTQBoeypkxO8q2m63Qzi/Xtl5BfGXspxsn Yx6t4WKuHhKYmYKmN/cc2VTczEUZ0Z3tX0DLvEMQt X-Received: by 2002:a05:622a:652:: with SMTP id a18mr10879380qtb.112.1628677306378; Wed, 11 Aug 2021 03:21:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOCj/PJaIqxziebTTKMVY/v8CazvKrJ2b/53mTAeqpL+Gfi6TzloAe0mFD6pl54Ywk9U7q9JTgEsbaH0TMlMo= X-Received: by 2002:a05:622a:652:: with SMTP id a18mr10879364qtb.112.1628677306191; Wed, 11 Aug 2021 03:21:46 -0700 (PDT) MIME-Version: 1.0 References: <20210810154022.749358-1-christian.ehrhardt@canonical.com> <20210810154022.749358-96-christian.ehrhardt@canonical.com> In-Reply-To: <20210810154022.749358-96-christian.ehrhardt@canonical.com> From: Christian Ehrhardt Date: Wed, 11 Aug 2021 12:21:20 +0200 Message-ID: To: Dapeng Yu Cc: Jasvinder Singh , dpdk stable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-stable] patch 'net/softnic: fix null dereference in arguments parsing' has been queued to stable release 19.11.10 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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" On Tue, Aug 10, 2021 at 5:45 PM wrote: > > Hi, > > FYI, your patch has been queued to stable release 19.11.10 Hi, I had to reject your other fix "net/softnic: fix memory leak in arguments parsing" which invalidates this patch as well. If you look at backports I'd ask you to have a look at backporting the couple. For now this patch has also been de-queued. > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. > It will be pushed if I get no objections before 08/12/21. So please > shout if anyone has objections. > > Also note that after the patch there's a diff of the upstream commit vs the > patch applied to the branch. This will indicate if there was any rebasing > needed to apply to the stable branch. If there were code changes for rebasing > (ie: not only metadata diffs), please double check that the rebase was > correctly done. > > Queued patches are on a temporary branch at: > https://github.com/cpaelzer/dpdk-stable-queue > > This queued commit can be viewed at: > https://github.com/cpaelzer/dpdk-stable-queue/commit/0eaed422260125d4d542168630bffe74b2462d5e > > Thanks. > > Christian Ehrhardt > > --- > From 0eaed422260125d4d542168630bffe74b2462d5e Mon Sep 17 00:00:00 2001 > From: Dapeng Yu > Date: Tue, 27 Jul 2021 16:14:59 +0800 > Subject: [PATCH] net/softnic: fix null dereference in arguments parsing > > [ upstream commit 51799b4f971982bc0757cf8a11940eb538b1af57 ] > > When there is no "firmware" in arguments, the "firmware" pointer is > null, and will be dereferenced by rte_strscpy(). > > This patch moves the code block which copies character string from > "firmware" to "p->firmware" into the "if" statements where "firmware" > argument exists and it is duplicated successfully. > > Coverity issue: 372136 > Fixes: d8f852f5f369 ("net/softnic: fix memory leak in arguments parsing") > > Signed-off-by: Dapeng Yu > Acked-by: Jasvinder Singh > --- > drivers/net/softnic/rte_eth_softnic.c | 20 +++++++++++--------- > 1 file changed, 11 insertions(+), 9 deletions(-) > > diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c > index f4858255ce..5a6947615a 100644 > --- a/drivers/net/softnic/rte_eth_softnic.c > +++ b/drivers/net/softnic/rte_eth_softnic.c > @@ -479,17 +479,19 @@ pmd_parse_args(struct pmd_params *p, const char *params) > &get_string, &firmware); > if (ret < 0) > goto out_free; > - } > - if (rte_strscpy(p->firmware, firmware, > - sizeof(p->firmware)) < 0) { > - PMD_LOG(WARNING, > - "\"%s\": firmware path should be shorter than %zu", > - firmware, sizeof(p->firmware)); > + > + if (rte_strscpy(p->firmware, firmware, > + sizeof(p->firmware)) < 0) { > + PMD_LOG(WARNING, > + "\"%s\": " > + "firmware path should be shorter than %zu", > + firmware, sizeof(p->firmware)); > + free(firmware); > + ret = -EINVAL; > + goto out_free; > + } > free(firmware); > - ret = -EINVAL; > - goto out_free; > } > - free(firmware); > /* Connection listening port (optional) */ > if (rte_kvargs_count(kvlist, PMD_PARAM_CONN_PORT) == 1) { > ret = rte_kvargs_process(kvlist, PMD_PARAM_CONN_PORT, > -- > 2.32.0 > > --- > Diff of the applied patch vs upstream commit (please double-check if non-empty: > --- > --- - 2021-08-10 15:11:16.702153440 +0200 > +++ 0096-net-softnic-fix-null-dereference-in-arguments-parsin.patch 2021-08-10 15:11:13.130638908 +0200 > @@ -1 +1 @@ > -From 51799b4f971982bc0757cf8a11940eb538b1af57 Mon Sep 17 00:00:00 2001 > +From 0eaed422260125d4d542168630bffe74b2462d5e Mon Sep 17 00:00:00 2001 > @@ -5,0 +6,2 @@ > +[ upstream commit 51799b4f971982bc0757cf8a11940eb538b1af57 ] > + > @@ -15 +16,0 @@ > -Cc: stable@dpdk.org > @@ -24 +25 @@ > -index 0aa7147b13..b3b55b9035 100644 > +index f4858255ce..5a6947615a 100644 -- Christian Ehrhardt Staff Engineer, Ubuntu Server Canonical Ltd