From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 1E4A545AE3
	for <public@inbox.dpdk.org>; Tue,  8 Oct 2024 18:49:08 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 84CDA40DF6;
	Tue,  8 Oct 2024 18:49:05 +0200 (CEST)
Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com
 [209.85.214.178])
 by mails.dpdk.org (Postfix) with ESMTP id 1A74640BA2
 for <stable@dpdk.org>; Tue,  8 Oct 2024 18:48:59 +0200 (CEST)
Received: by mail-pl1-f178.google.com with SMTP id
 d9443c01a7336-20b7a4336easo43417705ad.3
 for <stable@dpdk.org>; Tue, 08 Oct 2024 09:48:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728406138;
 x=1729010938; darn=dpdk.org; 
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=OCC/7pypcVANnAzLwv1ykHuWe7RDnUwbh8hT6nfkbJU=;
 b=cSfE8zTlDkEESZ/fKatu3bBtloQvUuNsWMn+KGquh/TKYyVA8+GsIKKVoGOO6aTDFd
 Ca44wmzQ01D/bi2P80OHYjaBLgJkySAZbgWRo2TWwsC7cUbP0chPaDaq0RSG0DDaBZcT
 3xNj5yt5aFEio8Pt1D8yelZppT7HOwOOr3/T26Ij6e+W4NylSZu6U3qVbX8B+Ea0cyJ6
 BmKKC+Bzkx/OG3fMnFTwoBDkQ5si0KXugW4CTyfiiG18+vn8v9G3X/VjI08L7whv8cZ5
 HV6WkhQp2282IGKGbqaxWReuDiHwD1FbBQlMNPZR73hYkA5jPDVyY1tv80+KMu0jLtXB
 AXJA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1728406138; x=1729010938;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=OCC/7pypcVANnAzLwv1ykHuWe7RDnUwbh8hT6nfkbJU=;
 b=II/T1NKF9qiekCaMDITz3sdkg8coOAYD2+L7KWXNnoJkkjmSwvCFAGsAgT9Ycu7Gax
 51Qov8LQs2BCx6xX07He+4pmgfRf4K18Pbn3periQBLXn8Ny41Rx+4hlTOI167Qj3Mbj
 /z4EFeFVvMAA0H4osTVjOu+Up7HuFHxUmzFllGMQBfME8MNWCc4fTZrNTrzMvwXiOM89
 eaqBFRxQGHBpCJF/oTOUiixM1Z4PNMN3rCKmR4WUkrUPhw9fzO3f4s1lX3HiNjufFEc5
 Q4yDFy+oE+N4gpFiG2OOf5nylv1CsJ4o6v/uvFK2vpWKWNTMOQg0knMYBuUC1uNJxn2T
 gOIQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCWSbZf0JUPVJNnZVnQNqXVbSaf8hXLivvbrQpcuX3wkZKcx/LYER52/P8KXy2bjTnbWihfmhOE=@dpdk.org
X-Gm-Message-State: AOJu0YySo1BW2WD564D4AW+24JNRkKRXs1dp7vqUv+fhybLzrvp7udzX
 JlPh77XlcJF1HdlQYeKcOHP+hGy8i9T8x7opMxnwZfyTYKR00LPr0kC6i0i9gQs=
X-Google-Smtp-Source: AGHT+IGezT9LzxFqDyqA4cNPJ8iWYGy9IEbDmVupgNMAjsk8zHwAFe/eXJB2DQMvP3/JVHuK840RKw==
X-Received: by 2002:a17:902:ecca:b0:20c:5fd7:d71 with SMTP id
 d9443c01a7336-20c5fd70e4cmr8593825ad.22.1728406138217; 
 Tue, 08 Oct 2024 09:48:58 -0700 (PDT)
Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-20c54056bd9sm13832965ad.85.2024.10.08.09.48.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 08 Oct 2024 09:48:57 -0700 (PDT)
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>, rbhansali@marvell.com,
 stable@dpdk.org, Nithin Dabilpuram <ndabilpuram@marvell.com>,
 Kiran Kumar K <kirankumark@marvell.com>,
 Sunil Kumar Kori <skori@marvell.com>, Satha Rao <skoteshwar@marvell.com>,
 Harman Kalra <hkalra@marvell.com>
Subject: [PATCH v9 06/17] net/cnxk: fix use-after-free
Date: Tue,  8 Oct 2024 09:47:10 -0700
Message-ID: <20241008164842.139045-7-stephen@networkplumber.org>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20241008164842.139045-1-stephen@networkplumber.org>
References: <20240927204742.546164-1-stephen@networkplumber.org>
 <20241008164842.139045-1-stephen@networkplumber.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org

The driver would refer to the mempool object after it was freed.

Bugzilla ID: 1554
Fixes: 7ea187184a51 ("common/cnxk: support 1-N pool-aura per NIX LF")
Cc: rbhansali@marvell.com
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/cnxk/cnxk_ethdev_sec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/cnxk/cnxk_ethdev_sec.c b/drivers/net/cnxk/cnxk_ethdev_sec.c
index 6f5319e534..e428d2115d 100644
--- a/drivers/net/cnxk/cnxk_ethdev_sec.c
+++ b/drivers/net/cnxk/cnxk_ethdev_sec.c
@@ -136,8 +136,8 @@ cnxk_nix_inl_custom_meta_pool_cb(uintptr_t pmpool, uintptr_t *mpool, const char
 			return -EINVAL;
 		}
 
-		rte_mempool_free(hp);
 		plt_free(hp->pool_config);
+		rte_mempool_free(hp);
 
 		*aura_handle = 0;
 		*mpool = 0;
-- 
2.45.2