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 0BAF345A9D for ; Wed, 2 Oct 2024 17:45:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D5B1240B94; Wed, 2 Oct 2024 17:45:01 +0200 (CEST) Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) by mails.dpdk.org (Postfix) with ESMTP id 144FE4069F for ; Wed, 2 Oct 2024 17:44:53 +0200 (CEST) Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-3e2886ea751so6524b6e.0 for ; Wed, 02 Oct 2024 08:44:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727883892; x=1728488692; 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=WXddzwtEQL02rob0mr0tmhoEzvwy87AcLZJO3w/huzU=; b=SqlpeHE+9TKy3/guluNcA8ET5AObyIGLm4fXpuwuLbFeGTFKv+InVX6Rr6TM1WAN5y JMa50JmTwLKzQwCGLP8L5J+PbAo10rv+aMuOUWT8g5RfgZpIBeeZt1Ymb4E6KKPSDufl yKZxLtDKw31mEodELmA/MBpbzMlrGIo8fBgzOQRbUuXYTWV+h+vKnSUPCwt0Lx06nfjp Jff3dc/vNwazCn28XswJlhUr4bTP/r8SJCco1XbeOXwATAm8zX30YkbPFE+YnbiBjhmY EKZSBUfWzPce2Zb2jV/dzybXiDXN3mFvBl7QV91mG9jB+PlssLK3rQTD0Y3JjuQ/Tv// n2Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727883892; x=1728488692; 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=WXddzwtEQL02rob0mr0tmhoEzvwy87AcLZJO3w/huzU=; b=eSa5Zksch2dKiPe95vh6hki7fqfJLCOsecAicUcoEkIuZgd5t0TgiaCChYSZrZUz5m KgyqiLquXfdTgD2bveBW6b5Z7/jhzIQwlOPnAZrds9/imdEMDd6WfX8+YL5JLimLE2UT Brjgco/ue5xq9TN01KAVL8kd8hyHj4/k6A5le7H3jh5Ew5fG0dJ8ezcg0y6UbF41C9iL 6CvhfrAfRQ0qytEu6j70FN0M3+BQXCMBf/p5wR1L+D22ObeR6vw13/PA89q93vmz8BTZ tlzh57DbjDZkqnM7D2wEwBdkLzE5l5PqOe1OjgkKfewdXCXJ5bK6mOyssW9t42FFqIie GeAg== X-Forwarded-Encrypted: i=1; AJvYcCVRxRyC63J0vbh5yAGnICRLNXk25XZTW5rEv255gHW9WnsdPoHZ/qIWVH6n1Ju7BNxJBE91CLU=@dpdk.org X-Gm-Message-State: AOJu0Yyhii0qcDZXBlyqbV/u7suXYnE9cqyvKOiYh+DtZn+zOWR7KNbg 6FbcuRZuKOA9pIc7hjH+TfVzJBbTX/zRI7dZphqq7Yqo9wMOxL8BwmJfnanQc0k= X-Google-Smtp-Source: AGHT+IGpLOpJIiHEP/nLlx55jVFsM+tM6fiIdVcGO2uIZ+6BgpxCVkoX4kpWDHKkhe061fKJTad6LA== X-Received: by 2002:a05:6808:2013:b0:3e2:8c58:6025 with SMTP id 5614622812f47-3e3b418d0d9mr2301927b6e.43.1727883892344; Wed, 02 Oct 2024 08:44:52 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e6db2927c7sm10247363a12.1.2024.10.02.08.44.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 08:44:51 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org, Hemant Agrawal , Gagandeep Singh , Nicolas Chautru , Nipun Gupta , Akhil Goyal Subject: [PATCH v6 15/17] baseband/la12xx: prevent use after free Date: Wed, 2 Oct 2024 08:42:59 -0700 Message-ID: <20241002154429.64357-16-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241002154429.64357-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20241002154429.64357-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 1a56e73abd..cad6f9490e 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