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 7113DA046B for ; Mon, 19 Aug 2019 10:28:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9BCB21B203; Mon, 19 Aug 2019 10:28:13 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id B064B2BF1 for ; Mon, 19 Aug 2019 10:28:11 +0200 (CEST) Received: from mail-ua1-f72.google.com (mail-ua1-f72.google.com [209.85.222.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 045522A09BA for ; Mon, 19 Aug 2019 08:28:11 +0000 (UTC) Received: by mail-ua1-f72.google.com with SMTP id h45so322591uae.9 for ; Mon, 19 Aug 2019 01:28:10 -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=yonFtThiwHvZhHI7sjaNkVlKkQIxP+q3aJx1WRn9qKc=; b=QVwLZU8Kckl4UBzIlM5SllF4fVQeAMhZ1d9zgSuRvZPv1Puc+GXZiUbKl1Up3wdeC0 gBQLilNcz02McE2GFRBVV2X3BixyUU63eBL+V++Uwx4CKjPNSjgra9aGxS06jYTc1VY5 RQocTs00jaNz28p4Lz/2HOlzt7l5PmW2BEYkZ8ro8SuqNdwaFHY24aONQIN5MelvLpZN KxbStSAwL+mLosRKiJdY83TItpjA27oCPTfvmtDmvdYSrdHoXWcJmpxAETaCB17awxX4 WL9nNV3XRVbmTUAAsGtlE91ebRjurDgOgIEwk67j+EJ6CDMbo1jRS4PzQsIvLOG+4U+x VZ6w== X-Gm-Message-State: APjAAAVluC/yF7S47UIAKw3K9wLsFcRKkz38eSf199lSW9mBKzYi+/n1 G0+0ze2zPqFpHMGatfrCc3VIeL9yJzZn2jKqY7sGMxM0UiV2M5wuG1H5DkRuxzcEDZXMUfpK6P/ JfpADUtlaL+xIELQKnnM= X-Received: by 2002:a1f:5185:: with SMTP id f127mr7489936vkb.52.1566203290233; Mon, 19 Aug 2019 01:28:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzk01ECD/fjnLLSP7CIvkshkDpMW+xudtJ4jeW31jEVXOWJE8LrDLvtTAGqJXxioTh3KPQvjX6ST+YYW5Q+JuQ= X-Received: by 2002:a1f:5185:: with SMTP id f127mr7489929vkb.52.1566203289939; Mon, 19 Aug 2019 01:28:09 -0700 (PDT) MIME-Version: 1.0 References: <1566110854-2669-1-git-send-email-arnon@qwilt.com> In-Reply-To: <1566110854-2669-1-git-send-email-arnon@qwilt.com> From: David Marchand Date: Mon, 19 Aug 2019 10:27:59 +0200 Message-ID: To: Arnon Warshavsky Cc: dev , "Mcnamara, John" Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] eal: unmap undesired address upon config reattach failure 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" On Sun, Aug 18, 2019 at 8:47 AM Arnon Warshavsky wrote: > > Have rte_eal_config_reattach clean up the mapped address > which is a valid address but not the one intended. > > Coverity issue: 343439 Fixes: 4e8854ae89fa ("eal: do not panic on shared memory init") Since the issue was hidden before that. > Signed-off-by: Arnon Warshavsky FreeBSD has the same issue since: b149a7064261 ("eal/freebsd: add config reattach in secondary process") > --- > lib/librte_eal/linux/eal/eal.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c > index 946222c..fac69b9 100644 > --- a/lib/librte_eal/linux/eal/eal.c > +++ b/lib/librte_eal/linux/eal/eal.c > @@ -438,6 +438,7 @@ enum rte_iova_mode > RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config at [%p], got [%p]" > " - please use '--base-virtaddr' option\n", > rte_mem_cfg_addr, mem_config); > + munmap(mem_config, sizeof(struct rte_mem_config)); > return -1; > } > RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config! error %i (%s)\n", > -- > 1.8.3.1 > Thanks. Reviewed-by: David Marchand -- David Marchand