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 C0A4545AE3; Tue, 8 Oct 2024 18:51:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 93F5841133; Tue, 8 Oct 2024 18:49:18 +0200 (CEST) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mails.dpdk.org (Postfix) with ESMTP id 3E78840E68 for ; Tue, 8 Oct 2024 18:49:07 +0200 (CEST) Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-20b9b35c7c3so61464785ad.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=uuIBxtCpmmxAX1loEd7PFhv9ilqL0ZnTgc8o7ppVXF3e6f/SB7Ou1EIrsXcAlCrf7o nvwKseiwB/J/oij7gtMTCNluSaFVxM1AvI4RElcF3tb0imtHBGzp0pznE9/Ogm4X58ri hE1KM0lgtw0O0OdSczkppkbbhlI/R6/f9L0PcD4ufgIc4gVxHQHixKd9qOFtscpdpVQl +yWMivsqszgA+KY7/0+YS43jEJcqpF6TmoQqR6yZGJxnfxVzajGzXit3ohoZOpHI/IJX IjG4O4laQlYrjhgVuXt8A9TLW0yEzAHXbT9lPynqWHIGRir2A3AH5azSOKumV1e401OX 5Uhw== X-Gm-Message-State: AOJu0YwGgQ1bZG29XaNvs3UyG8fBYG7qOii628i8y3tgcwChuK6D1Lt0 +Ozh0DT8hQIZjYCWkveYcs3BBoPK5qqqmk7JtEB9w2Q1OyGDPjPQtCNZrqYmBciQ3iOuze4N7vx 5LwgeKA== 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: 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 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