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 42BFA43C60 for ; Thu, 7 Mar 2024 02:32:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D082C42E7D; Thu, 7 Mar 2024 02:32:48 +0100 (CET) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mails.dpdk.org (Postfix) with ESMTP id A5D3642EC6 for ; Thu, 7 Mar 2024 02:32:47 +0100 (CET) Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-33d2b354c72so153382f8f.1 for ; Wed, 06 Mar 2024 17:32:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709775167; x=1710379967; 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=7qS3tE0p66ZRgIarrm8W+5hxaxQzx8d3lW6Ch0WN5pY=; b=jLbz5HY2voIP6yimCarLT2sqJEzs3uJ/qPtTvkmaGhcgIskNjUl7s9R5F6EhM1kurn XSvnJ92XsHy2pSKXsSY2Ua+MFFhFXDpMDw4W7j4TJ+88215XmQyr7DIe2pDf2EhNo7pO ksyukxK8TF+YmGM/BwdunbcU2OmRXeytT75Py0zSKRE9sen+vDp8Eo7u6jT7kc9Jmg96 4kWHnb5uIQuWUPmGvZFkny0lijxOPP8EmplQQwwvkgMN8OXXtPpl4sIc7vllxM5xqC4X F9/cIo3M5+nHbbZHUQU7lWRabwC9bWnEXFWK7QGs70paezoNeqhI394VmCPFYZJEs4J9 fWqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709775167; x=1710379967; 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=7qS3tE0p66ZRgIarrm8W+5hxaxQzx8d3lW6Ch0WN5pY=; b=MFKaXwmlcMa0t3rfw/OwDVAMyRL1iJ8ROEF+K2Q6xDFc1M2BWK3UYsxq3wfZ+Tgbcv D50IzguyfvMzJbLX2Vm7Q/fOYTWqepXGc5gtWaW5zFyKOheK8mhj3pyF1O4IkmejqGnv NWYNaAccLIbuyCkVj0mpLauqJPPuKCCwBqDOv8IjBrmOeE2nJbTdOZIryJ/L3aJBKnP5 bRxxiVFRoZRp3RMGyeAg/mNMqWuFjovLg8MZyqeiGBuwH5sLkakzmsdFQzJRgxUHEnt4 R448SxzESJMorbCXFL3RpulbTtM1TTxWxbXwy7JDZUx2k6Y+OkblUYyeidSCFv5ibt/V sGMg== X-Forwarded-Encrypted: i=1; AJvYcCWOuPXGtnQvNjs/UqTGg8+EDN9qZ6h9ejzlnIKOzFba8XN8ihYt+4XmZGfshclSZdoJkBNuocyUM5Ij9zfoIDk= X-Gm-Message-State: AOJu0YysGyRl4SEi3w02L2AHI+FvPvxsFrE/VYYPDbjrHca+nctURXR+ cF1KePKXbZrR/pupKzwxIr7wZxA8W/G+mUhx/aDvpzxEc2PR8Pqn X-Google-Smtp-Source: AGHT+IEvaNsVa9p8kqWEP4n4CwhzBHuASiFJjvpg46ljmwwXCQ9RRjCYzjQASAz/1N6j1gHE4Oavhg== X-Received: by 2002:adf:fecb:0:b0:33d:e6e:b5f6 with SMTP id q11-20020adffecb000000b0033d0e6eb5f6mr12189600wrs.27.1709775167345; Wed, 06 Mar 2024 17:32:47 -0800 (PST) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id b7-20020a05600003c700b0033e44b23921sm7671451wrg.24.2024.03.06.17.32.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 17:32:46 -0800 (PST) From: luca.boccassi@gmail.com To: Yunjian Wang Cc: Qi Zhang , dpdk stable Subject: patch 'net/iavf: fix memory leak on security context error' has been queued to stable release 22.11.5 Date: Thu, 7 Mar 2024 01:30:26 +0000 Message-Id: <20240307013159.1735343-9-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307013159.1735343-1-luca.boccassi@gmail.com> References: <20240307013159.1735343-1-luca.boccassi@gmail.com> 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/09/24. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/ae8369536d8bbf8594aa8fd0944f7dcb5c434ffa Thanks. Luca Boccassi --- >From ae8369536d8bbf8594aa8fd0944f7dcb5c434ffa Mon Sep 17 00:00:00 2001 From: Yunjian Wang Date: Fri, 1 Dec 2023 18:46:49 +0800 Subject: [PATCH] net/iavf: fix memory leak on security context error [ upstream commit 8758ad5f8633ce4197271d41ece0cc7f799d3d6e ] In iavf_security_ctx_create() allocated memory for the 'security_ctx', we should free it when memory malloc for the 'iavf_security_ctx' fails, otherwise it will lead to memory leak. Fixes: 6bc987ecb860 ("net/iavf: support IPsec inline crypto") Signed-off-by: Yunjian Wang Acked-by: Qi Zhang --- drivers/net/iavf/iavf_ipsec_crypto.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/iavf/iavf_ipsec_crypto.c b/drivers/net/iavf/iavf_ipsec_crypto.c index 26459088af..8da41bb68e 100644 --- a/drivers/net/iavf/iavf_ipsec_crypto.c +++ b/drivers/net/iavf/iavf_ipsec_crypto.c @@ -1485,8 +1485,11 @@ iavf_security_ctx_create(struct iavf_adapter *adapter) if (adapter->security_ctx == NULL) { adapter->security_ctx = rte_malloc("iavf_security_ctx", sizeof(struct iavf_security_ctx), 0); - if (adapter->security_ctx == NULL) + if (adapter->security_ctx == NULL) { + rte_free(adapter->vf.eth_dev->security_ctx); + adapter->vf.eth_dev->security_ctx = NULL; return -ENOMEM; + } } return 0; -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-07 01:05:35.878822472 +0000 +++ 0009-net-iavf-fix-memory-leak-on-security-context-error.patch 2024-03-07 01:05:34.642936706 +0000 @@ -1 +1 @@ -From 8758ad5f8633ce4197271d41ece0cc7f799d3d6e Mon Sep 17 00:00:00 2001 +From ae8369536d8bbf8594aa8fd0944f7dcb5c434ffa Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 8758ad5f8633ce4197271d41ece0cc7f799d3d6e ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 07a69db540..d6c0180ffd 100644 +index 26459088af..8da41bb68e 100644 @@ -24 +25 @@ -@@ -1518,8 +1518,11 @@ iavf_security_ctx_create(struct iavf_adapter *adapter) +@@ -1485,8 +1485,11 @@ iavf_security_ctx_create(struct iavf_adapter *adapter)