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 BC35B45A50; Sat, 28 Sep 2024 18:48:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1BDED40609; Sat, 28 Sep 2024 18:48:33 +0200 (CEST) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 385FF402C0 for ; Sat, 28 Sep 2024 18:48:28 +0200 (CEST) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-206b9455460so23378495ad.0 for ; Sat, 28 Sep 2024 09:48:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727542107; x=1728146907; 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=2cYQdgVy1X6dw8VoCeBFzYfkLKZs2l4/Y2IfDXVHMDQ=; b=YpcnRospNaaffb+44wv6HDwkzywzXPD7GBVPuM7xS+0KOwtYzQb5RAgYt0gGpjfxSj y3+I9vnedkdjopYqd103mAMNAr//VAR19CZFLMH27qz9wcq6CTgiQ6XqmPeflghm7sV+ CToqozzxb+72O+BmE5vAXeCxc905yJqbrkZp54wHqmEBnVlQAML1hVKOR2PVKbCELgPe qNoSZWD4vmHuRCLjPN+UJ15Q5tNuuhbC1BrAbQNiiXZSM8pPSEcwapu+bkAffaktvE4h s3Nw8gXStcbTUppqoGsjqyB6iaBPh0c4z9zsdCmfxa5PEvv8JmRj8PgJiDMelJ876JvV su1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727542107; x=1728146907; 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=2cYQdgVy1X6dw8VoCeBFzYfkLKZs2l4/Y2IfDXVHMDQ=; b=NWSr20I8PPWjL0umqQpgoID8NUmKNhRUsEyU2HP8UY/Z7Y5rxyuMvkrBxO1+N3MRCa nzmhYNH3pp+C7vf0aft7ZYcb43DcTY65OtLudXV6bHtlauW4KtfetxsL7kZe4vsSCDlc 1nxpdPAB0ffTIPpqM5ef2X9V6nNW5gdOByL/4VbsUIK/Kb8QaAXL/J+K3M34AfFnQqsd H/3BVYaTSZva9+jFvmT43qpe4ZEU+BUabO7LfAyuQ1JCq5XJPOACOwzZDLWo3yrlYT2K 6ROzpqHX9xv1t5PZ8CKKbR2mgbTaNwX5W/kktV8dOSm4syaPJl+fr0UH0QErojxc49ZK v3pA== X-Gm-Message-State: AOJu0YyLTDTb5Xs6AGKINOkiL3HMkeDE1w8mBgojAHKbSzS/jwz3gRF5 VrqXdyxOWDhGZtkTUxYEs/3gDVouKqU4kyB40thpeRw1m6hShdtKnFWF45pHveoPNspFMYIkmKZ E X-Google-Smtp-Source: AGHT+IE4zKJNatoMiIzh13bFx3/nAF5ftr68QkqPK4mHJIVYaH4ZKMtKzHIaOACNMqij5MZ1Qe+Gng== X-Received: by 2002:a17:902:e5c4:b0:205:4d27:616e with SMTP id d9443c01a7336-20b3668bdcamr108375575ad.22.1727542107416; Sat, 28 Sep 2024 09:48:27 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e47c7dsm28854015ad.216.2024.09.28.09.48.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Sep 2024 09:48:27 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , vikas.gupta@broadcom.com, stable@dpdk.org, Ajit Khaparde , Raveendra Padasalagi , Akhil Goyal Subject: [PATCH v2 03/16] cryptodev/bcmfs: fix mis-matched free Date: Sat, 28 Sep 2024 09:47:11 -0700 Message-ID: <20240928164814.861933-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240928164814.861933-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20240928164814.861933-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 The device structure is allocated with rte_malloc() and then incorrectly freed with free(). This will lead to corrupt malloc pool. Bugzilla ID: 1552 Fixes: c8e79da7c676 ("crypto/bcmfs: introduce BCMFS driver") Cc: vikas.gupta@broadcom.com Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/crypto/bcmfs/bcmfs_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/bcmfs/bcmfs_device.c b/drivers/crypto/bcmfs/bcmfs_device.c index ada7ba342c..46522970d5 100644 --- a/drivers/crypto/bcmfs/bcmfs_device.c +++ b/drivers/crypto/bcmfs/bcmfs_device.c @@ -139,7 +139,7 @@ fsdev_allocate_one_dev(struct rte_vdev_device *vdev, return fsdev; cleanup: - free(fsdev); + rte_free(fsdev); return NULL; } @@ -163,7 +163,7 @@ fsdev_release(struct bcmfs_device *fsdev) return; TAILQ_REMOVE(&fsdev_list, fsdev, next); - free(fsdev); + rte_free(fsdev); } static int -- 2.45.2