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 003AF45AE3; Tue, 8 Oct 2024 18:50:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE08A410D4; Tue, 8 Oct 2024 18:49:15 +0200 (CEST) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mails.dpdk.org (Postfix) with ESMTP id 3EA26402BB for ; Tue, 8 Oct 2024 18:49:05 +0200 (CEST) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-20b90ab6c19so62510035ad.0 for ; Tue, 08 Oct 2024 09:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728406144; x=1729010944; 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=CeP4jlg/nwoX9BqyloYvigRPb4ZdUkxrz0ArQrEvutk=; b=BAja5yhlq/zf/Vrj1al2wOzbV9jR4D/DeZ7sNzh8xWVuNDWuaW0tCvMzrRVY+GGesD LLmKF9EWxYw2wwYETi/2ougNpWiOhLDEq17nLtEWSwgLeagntLACGdWZ8bNXcD41TqPL znFJZD3v0NuAshOAIfmgEccLtVItin0tKeZoyCij+qo2HbtkobGBrETypC0mL2iIUWpr 1AWqlTRHOWv8dKuXKtUPvhvsP/8g316guiiKrVScYDmiyY1Vht58M3os6Q6x9Z45dSIR xXJCeCOrjavZi1/Hw9XILEF9zpEvzgE8ygTurFyODKN8FphNRCMjXgymucUpp36L3pv4 GQyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728406144; x=1729010944; 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=CeP4jlg/nwoX9BqyloYvigRPb4ZdUkxrz0ArQrEvutk=; b=ecTOg9+k+NeesAK0RplYx231SQwYQeEbdNet7Obfr8iVOI21F7ySvGJ5Rp4YdZ5zez H+YDQKvD8KJsGhcjIy/GorC+2E7MsDwVI5C3hM4gd5iIBwPOiLpYy0s/huQ1ya7tFP9a z+rV6booD1Vt5UxPgw2zgZKeEquUZo2cfMowk5224qUVrtgB0RMVEM9rUPSc7TivhU4q a2EARt69gFbOlF7x/eqGv4zTGyA4pB0u1Bm9WzCC6hV4ShfguP7QlhPk/ByTnZCX78Wg 7pogmnjwoAmnTxKYWHZL1cnPmT6SIjRzpr2UcDDRE4b0GRoQ2npGD6MzqaKunJ2ocEWq V4Vg== X-Gm-Message-State: AOJu0YxKots6NevkiUzDhWdNCcrT1HUpE7+FJocswYBJouJVsOHBqeT0 USHRBCVByhkPknGMrFibtpxWxOwnjWkxJbalqXAM/W4Na4B72NdZKHnWh6bMfgk2aATwTbUTWg8 MSUjsoA== X-Google-Smtp-Source: AGHT+IHlUkiKK5b+88zLSIUfzfSfzllfIwuzJ+Vu/+eWGO0KrDKAlbfhxMmAX5xk9dD4w5ujwLr02g== X-Received: by 2002:a17:902:e743:b0:20c:565f:69f3 with SMTP id d9443c01a7336-20c565f6b7bmr31950545ad.13.1728406144440; Tue, 08 Oct 2024 09:49:04 -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.49.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 09:49:04 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , arkadiuszx.kusztal@intel.com, Kai Ji , Ciara Power Subject: [PATCH v9 13/17] common/qat: fix use after free Date: Tue, 8 Oct 2024 09:47:17 -0700 Message-ID: <20241008164842.139045-14-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: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Checking return value of rte_memzone_free() is pointless and if it failed then it was because the pointer was null. Fixes: 7b1374b1e6e7 ("common/qat: limit configuration to primary process") Cc: arkadiuszx.kusztal@intel.com Signed-off-by: Stephen Hemminger --- drivers/common/qat/qat_device.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/common/qat/qat_device.c b/drivers/common/qat/qat_device.c index 4a972a83bd..bca88fd9bd 100644 --- a/drivers/common/qat/qat_device.c +++ b/drivers/common/qat/qat_device.c @@ -390,11 +390,7 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev) return qat_dev; error: rte_free(qat_dev->command_line); - if (rte_memzone_free(qat_dev_mz)) { - QAT_LOG(DEBUG, - "QAT internal error! Trying to free already allocated memzone: %s", - qat_dev_mz->name); - } + rte_memzone_free(qat_dev_mz); return NULL; } -- 2.45.2