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 106B645A5D; Sun, 29 Sep 2024 17:42:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0BEFA406BB; Sun, 29 Sep 2024 17:41:44 +0200 (CEST) Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by mails.dpdk.org (Postfix) with ESMTP id 839874066C for ; Sun, 29 Sep 2024 17:41:32 +0200 (CEST) Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-71798a15ce5so3475167b3a.0 for ; Sun, 29 Sep 2024 08:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727624492; x=1728229292; 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=0ep41HvjWAh+oxSsTWe60ImCJp1DtVeS85WhTlAttJ0=; b=vWSv7QFOLajl6iaGS2WLw7Zjo03P2Fmp76y2V68Wa6c1of7kmQ4TTq7kL15FS6Hmor VLF4dkHVVj3fciPuWNV8VCvojvLdqN9nr95C7IJ+mNwTIy/Hi5ooCTO6DZxiL8GtthUI cwdSo1e1f009qWJ3jiSnw1cFJ+U/OKPHibq2bAvrcPzHX5c+Rt4m+QhBDX2tDiFoqlay 5+Apum4ZBQssau5QHJyUceGR8415y01AlzNAz6g2nkBn504s2VJF/C7DgjuoTcIfl5ge dVUwCbYoP4qIkTME59cmEsxe7SLBddBsgwAqLpxkAEnk6H9KeYEJj/nChpdh74B0bDEl R3XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727624492; x=1728229292; 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=0ep41HvjWAh+oxSsTWe60ImCJp1DtVeS85WhTlAttJ0=; b=mthTJCWqQJifl9YgRLJczOGnYuYsCTXDT0zKkTZzXV0awty3NMYTgHgAquFbQYrQ61 rHraLSpy1XnpLXQQ6G1vBx4SvKcnymS8dbyyZ/sW1KbudXlzBV9Oz9WZGTQmAWrLSDlb U33Y3v/fFqZ90hvj9urZLnTPnbNzjGnVxjbRVxLLAdIxylHvWX5RsF0QYVMsKP4JpEvt VVenCuuzC1hm+sLlGwpLW1KfO6NebDQLiY0aXfyqDGeFKrmAfozvTSbApZ5rZx3sj8Qr glChYwqstNsToG80tUK2XGJWOl2h62/5oIjqd2nzFyR/HQpvFfL1EJhdwcDPiRpPuOcY n8iw== X-Gm-Message-State: AOJu0Ywc4Vbt20aOFP5F8T9mSKkWE4PmQu9PNfKYsOuGh/BXgTHQS5YK bwIaqjk0i6ssPn+FSfpRFNXAAlxoSlL9nfHCV+n85UfntRpkka2vM77HZHukDawmLI18pn4QtDn p4LI= X-Google-Smtp-Source: AGHT+IGmvC0AOfaTqipkJARZZZM1qtMcNR2gcpTU01HW4ZFyz+ctujuESx91es8HKZ9B+51REavq+Q== X-Received: by 2002:a05:6a21:33a7:b0:1d4:f7e9:172a with SMTP id adf61e73a8af0-1d4f7e9178fmr14107770637.23.1727624491737; Sun, 29 Sep 2024 08:41:31 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b2649c775sm4707416b3a.29.2024.09.29.08.41.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Sep 2024 08:41:31 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , hemant.agrawal@nxp.com, stable@dpdk.org, Gagandeep Singh , Nipun Gupta , Nicolas Chautru , Akhil Goyal Subject: [PATCH v3 15/18] baseband/la12xx: prevent use after free Date: Sun, 29 Sep 2024 08:34:40 -0700 Message-ID: <20240929154107.62539-16-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240929154107.62539-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20240929154107.62539-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: hemant.agrawal@nxp.com Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- 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