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 AD2C245AE3 for ; Tue, 8 Oct 2024 18:49:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B9E041104; Tue, 8 Oct 2024 18:49:18 +0200 (CEST) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTP id 3CEB840E64 for ; Tue, 8 Oct 2024 18:49:07 +0200 (CEST) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-20b9b35c7c3so61464795ad.3 for ; Tue, 08 Oct 2024 09:49:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728406146; x=1729010946; 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=KiCmi4zmz86nTUudAOnY67M0hc+4wJo3hDS6PQwlDzs=; b=VoAoFQdoJTEtFBlJQ+d9kX8EhOif+A3cJsCoHu8FVjxLkYdJlmbqmVm3kAXNhlLXPX F7W8abi1cj9RxHVtMeabJjT79vKmVIThPmG2xRnFKNDts7iooLjICdUqMf5r1TRyjKI7 zsivpn6f7eGvcD4357yLZC1dlIbGzvyryMUmqzdYQNKhoGdi1f6vqR0k3Asq3gzSbJ6q nfSKxc7RnLN0gmiwVi+k5dtq6T34nZDt36xw6Laeg9XkSz6+KTBw78LBAAeYn1tlzd/J xIB/gPzlE+xQdsVKnOXyVIObiCk6xc7xL4OEfLcQsdiWGvVaVo5mCI9I5BOJgIokfY1l lKeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728406146; x=1729010946; 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=KiCmi4zmz86nTUudAOnY67M0hc+4wJo3hDS6PQwlDzs=; b=b+Lv0pUtA5HE8zJ7HHFQ1rfNhbOTzc9KyitauGkRUgrQqY7jokEAVK0xcp1xMgvRm4 ZPVP4rsA0+8MQweD10gmYdy3khV6VMRztPCDiHR4Ac32VcNxjYi4Y+EmcEfeWR006WRi rH17R1Kfv3sSnX8zxG3EU0KlXEc3FIjRd7D5Z1Gho5LDMTPy0esL88mcKnPv2CA/PdY0 fd7/WcsFQpyzsSPv5KPllEWexpdcR7J4HbXrrXhaxYwpemysnuYt9OCuYZrPjfb8SCRL Rs98EKzsNHa8YBKqOLeS3E56Gb0JwNCZfycEvBFoQ7Uinq76l9JluoTj8nKNt5BaArNf XHUQ== X-Forwarded-Encrypted: i=1; AJvYcCUilrp1agTRAlhbjBCKAYk7BSbM0Ilmm9F3cMDaGXmSv8mZ9AUp8AiZpPaLTYkIIPoNPcMe8iY=@dpdk.org X-Gm-Message-State: AOJu0Yw4jLRvWyQZj9kdbgm4vXzaWW020LYWk74rciR0sJJzRtO9K2U1 CdbPVbJn3mERMsRalCvhWIPZrijyiW0pDrXlX27Zq2l1PNSOHuGVEUf2SrYEg4vfHlV+DROkJxR VdszpMQ== X-Google-Smtp-Source: AGHT+IHDnSlJmiNpVIsBPSWk6U7HQPn2boZYKMQHzYldTkgXoyhJJVUcQwBdjz8vdh93ZRoyLj+LjQ== X-Received: by 2002:a17:902:f64c:b0:20b:982e:73f5 with SMTP id d9443c01a7336-20bfdf6b4d7mr258542795ad.3.1728406146498; Tue, 08 Oct 2024 09:49:06 -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.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 09:49:06 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org, Hemant Agrawal , Gagandeep Singh , Akhil Goyal , Nipun Gupta , Nicolas Chautru Subject: [PATCH v9 15/17] baseband/la12xx: prevent use after free Date: Tue, 8 Oct 2024 09:47:19 -0700 Message-ID: <20241008164842.139045-16-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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org It is possible that the info pointer (hp) could get freed twice. Fix by nulling after free. In function 'setup_la12xx_dev', inlined from 'la12xx_bbdev_create' at ../drivers/baseband/la12xx/bbdev_la12xx.c:1029:8, inlined from 'la12xx_bbdev_probe' at ../drivers/baseband/la12xx/bbdev_la12xx.c:1075:9: ../drivers/baseband/la12xx/bbdev_la12xx.c:901:9: error: pointer 'hp_info' may be used after 'rte_free' [-Werror=use-after-free] 901 | rte_free(hp); | ^~~~~~~~~~~~ ../drivers/baseband/la12xx/bbdev_la12xx.c:791:17: note: call to 'rte_free' here 791 | rte_free(hp); | ^~~~~~~~~~~~ Fixes: 24d0ba22546e ("baseband/la12xx: add queue and modem config") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger Reviewed-by: Hemant Agrawal --- drivers/baseband/la12xx/bbdev_la12xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index af4b4f1e9a..2432cdf884 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -789,6 +789,7 @@ setup_la12xx_dev(struct rte_bbdev *dev) ipc_priv->hugepg_start.size = hp->len; rte_free(hp); + hp = NULL; } dev_ipc = open_ipc_dev(priv->modem_id); -- 2.45.2