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 6592B45A48; Fri, 27 Sep 2024 22:48:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6453E4065C; Fri, 27 Sep 2024 22:48:08 +0200 (CEST) Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by mails.dpdk.org (Postfix) with ESMTP id 5D7BA40609 for ; Fri, 27 Sep 2024 22:48:02 +0200 (CEST) Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-6e7b121be30so1773353a12.1 for ; Fri, 27 Sep 2024 13:48:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727470081; x=1728074881; 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=qX5JnPmSsf+JiqhomIoZSRVblyTHeI0U9/zFsuxKGzU=; b=23T729Z1qr0cTmiqpsVZPvssHB8qOW7sloOASFwvVwvEMsJqb3srRCd0JT1dduv+yr uwqPxb1UziVeARQud2jQ/LPw1ePxni1AQRmyRot2cWZOjZa7x9YVGHc7+KWW9AhTvUj6 2EkQ+/uaL48/+L8U2WcSTyPfcPITv9klmnulOns+BSk0ybNKtEiW3VKlqmlmJDuVk3q6 dI6glJphS/MDYoYip0HeZb1ht4Oi7Z+BeSZ3NInv5doeFcw7Ad+8qyg+pc43+9dckZ0p FjuYQymuPJWDKu/k3Om8tVfb80T6BP3cpZZ224a8ukBQkbVtR5obdjbvoY2YP0VmAjaA JK3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727470081; x=1728074881; 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=qX5JnPmSsf+JiqhomIoZSRVblyTHeI0U9/zFsuxKGzU=; b=t7adIfNWJCLqNBOUgDiQq4o93wKrwI8gpAtUmpUEl7i6H0A+UxQksWbfwGroaCOlHN JYTD0i/mpGuZGc6KEgFamfhXXxR9zBHHGVTDiA6seOgDohze+CX63qYmMl7sL+t/5mEp lXN7rmTb5FYvjvf5P9gd8DZaHfXk7xUTMhszbt9Epp1ETq94NlOWsDpxlof6R3Yk0VoA pJWnoQJ9+4Y7clJT25O+ERZs64ChYNTx2CAG3oi06h8rWyQpu+yqSOjiXOtdN9jkCtCQ Dy4ByutbrhmjS8jxRvKyjtpOV3YUdC6tuSSBR+aqbb1e1iQ5hMltwA8kbEoIFZY3Fi1I nshw== X-Gm-Message-State: AOJu0YwAmrFfySQKoQDkSZkAeYz0TzAu8XRyEvoLIMpy2fory4P7gzmD acAd1JKK5jJrYib5r6MWmaI6+c9jN9G/d/XJHfYSdWFUq3luDEemR7sr4EZTk+wBmPEDWoPwkhz r X-Google-Smtp-Source: AGHT+IGyAm6wls3XOqJ1Lg5YotTiFe91RZOJnEw116asLJ6cfIFRBMk+pSAo8Uvf+XRcH+nn8avYIg== X-Received: by 2002:a05:6a20:d521:b0:1d2:bb49:63ac with SMTP id adf61e73a8af0-1d4fa7ae4b5mr6057117637.40.1727470081512; Fri, 27 Sep 2024 13:48:01 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e6db294533sm2036531a12.12.2024.09.27.13.48.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2024 13:48:01 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , jin.yu@intel.com, stable@dpdk.org, Maxime Coquelin , Chenbo Xia Subject: [PATCH 06/16] examples/vhost: fix free function mismatch Date: Fri, 27 Sep 2024 13:45:42 -0700 Message-ID: <20240927204742.546164-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240927204742.546164-1-stephen@networkplumber.org> References: <20240927204742.546164-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 pointer bdev is allocated with rte_zmalloc() and then incorrectly freed with free() which will lead pool corruption. Bugzilla ID: 1553 Fixes: c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample") Cc: jin.yu@intel.com Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- examples/vhost_blk/vhost_blk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/vhost_blk/vhost_blk.c b/examples/vhost_blk/vhost_blk.c index 03f1ac9c3f..9c9e326949 100644 --- a/examples/vhost_blk/vhost_blk.c +++ b/examples/vhost_blk/vhost_blk.c @@ -776,7 +776,7 @@ vhost_blk_bdev_construct(const char *bdev_name, bdev->data = rte_zmalloc(NULL, blk_cnt * blk_size, 0); if (!bdev->data) { fprintf(stderr, "No enough reserved huge memory for disk\n"); - free(bdev); + rte_free(bdev); return NULL; } -- 2.45.2