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 DBFFC45A5D for ; Sun, 29 Sep 2024 17:41:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 52B4540A72; Sun, 29 Sep 2024 17:41:45 +0200 (CEST) Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by mails.dpdk.org (Postfix) with ESMTP id 88C334066D for ; Sun, 29 Sep 2024 17:41:32 +0200 (CEST) Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-71798a15ce5so3475165b3a.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=SKJ7qqH3PuwKLFGctKY0bY+UtFb24lkHn8TFXF2716NuuWDys/DdD/ZRgiBoHaHFMU NtOaK8MkJ/+Zxi8F+JY7BLlrKgDSkpxrAw0LgbOuvvpoOj2si7QpRw52kfFMPnJcPXIP PTexS2n+qeez3wHfKuDTOzD12Vvyt9O/y6UQEHG/CXrz3XHZDgRskqn7ljLUtka71c9B GvHJVtriMPRiCq6fY/laWPBS6koUzasHgP7Cwh+L4xzzJkAwhPXPSi0fsdmV6EmM9brT oL+nvR4mpCnFCINcyEVKq/uXCmEdrLHIepneMoTN320ooIITLJvZhjf4BF3uJGgZM96b sBrQ== X-Forwarded-Encrypted: i=1; AJvYcCWGxUL0e2O3nwo5U+dTKk9BylexBcv+Ied4K8zghATxSJKYVCs3/4Yg+aVlQ+Az5oLXJWUIueE=@dpdk.org X-Gm-Message-State: AOJu0YxhLEma7YiwgPRQNoFxV6ZaAexQYHSvGWaP2pQaqHtmkKYgypNH RzH6870UHZJ+WvBRCRPe05LNmEYy4IhOWK+ETcLzu55NSWQowi8ApRiXxUUXM84= 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: 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: 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