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 E264345A6D; Mon, 30 Sep 2024 20:47:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EBB0F40BA6; Mon, 30 Sep 2024 20:46:37 +0200 (CEST) Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by mails.dpdk.org (Postfix) with ESMTP id E9A1E40657 for ; Mon, 30 Sep 2024 20:46:23 +0200 (CEST) Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-718da0821cbso3672452b3a.0 for ; Mon, 30 Sep 2024 11:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727721983; x=1728326783; 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=mwjRu6rNeSSVd4zzQyexBxEs7wShuFIePjZiWl6EJKDzi1jLlsvR4PHh0HIoqQDV6t BBz+RCj5Kc2elZa0WU+xgmxeh7av+8I2Tb5gElu1W4KH0ldAk85zI/BEbcDHi8xXcVfe 8zCZyJ5Wk1pQqY8allnGlluRwy8uUH5jBNWL3HBtskw0JcXHMFJz+BJ9DaFOvXUcSNRX m4XY4LtpZ/ZNvPT/xTUiKyjm8lzxREdGciyDRvDD1nROxjbdWDbr82B45/52BIaK7npu OZslYnse3IT9b+41dqoBlytLxMqwU684r7uvRiuwwvQrnx2jh9THONIGCJEnkWAaB6S/ DPfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727721983; x=1728326783; 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=CgHY8JHWaDgTAgXFTHaPCA9GBIiJhOob3/1RoFpymDvejoposrYWxRZ30vhIBa1Lyh uenf7WQxMVLSTm6SESLj385Byt52eoXy6Z+XUhv3ff4VXW3w7c80LjS5Yi5ClDz3F6MG Vuya/hmCYddWozlqtkOv9/8T9XkFNSow1P90fvMc8lSlvU7EZJSh3J1yHZynTR6fS320 GL85DCIPLIrlO0cRY5l0yxiPhTCEdMSdB9hfpSmShNilU+8SrbVuhNNIFgkHBGBhAivh N9L6IhJxHVZW9rbWDgFOO+ucKimtwETarVvC9SteFST6OIKlyubnjq3fE1uiDcniy4N9 BKXg== X-Gm-Message-State: AOJu0Yy35A3NhKn7LAuIfPh+WIAxABsOKG9QOPvRL2AaC+uslL9JFmjF psakaBfJjie1uJP42GJGk45yrdGLByXpQ3yHefnXsAEnafn8uPs7/oxub+vXQkLuFOIR9fuoo0S ldoI8lg== X-Google-Smtp-Source: AGHT+IGbu7nTRckWk9m9o2S7EGOL36WAIgOX3peklz3gBpP6cElkYRXpYNqbRxtaOq+0KbeMXjATjw== X-Received: by 2002:a05:6a00:124f:b0:706:61d5:2792 with SMTP id d2e1a72fcca58-71b25f45c19mr19212101b3a.8.1727721983220; Mon, 30 Sep 2024 11:46:23 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b264bcca6sm6581895b3a.78.2024.09.30.11.46.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 11:46:22 -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 v4 15/17] baseband/la12xx: prevent use after free Date: Mon, 30 Sep 2024 11:44:09 -0700 Message-ID: <20240930184600.7092-16-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240930184600.7092-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20240930184600.7092-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 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