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 63C3D45A9F for ; Wed, 2 Oct 2024 20:40:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2952440A77; Wed, 2 Oct 2024 20:39:54 +0200 (CEST) Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by mails.dpdk.org (Postfix) with ESMTP id 0761C40674 for ; Wed, 2 Oct 2024 20:39:42 +0200 (CEST) Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-7d7a9200947so39675a12.3 for ; Wed, 02 Oct 2024 11:39:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727894381; x=1728499181; 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=jxEITxuFQcT1ndcItkIl4cIk6Vc0Cl2ZR9GH0cuMeHt5Pud5EiQZFVRhFwDLH37F1Q GdGVtPikoB0QVpRuzawOm86pDbprycmfawnYKtokMsMEjKo90oQk2lf9tx/VgkpWBm0l kGl2bTHhtQ8QIaFXoXIlThYs02KWDc9M9MEc4Z97muoi2yZBnWmoKdv957cW8IaRZgLb m+fa4Yw2P2qF0744aoouVhAxDWTcUiPsHzmO0sQSUoWTLjL/xQ36XuJaHFQDkwPXCNSj yEBDSp4JQ1EI12ee8n2XaxmRfxE4oV1WRuuGHVCzyruzOQTo+Egez45vSsctXQpzOm7A /UAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727894381; x=1728499181; 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=D7QvEFSteqlPraRdWh+4Hhr47V+9TwX0wOKVVNBmzBuY6rfA6D7pSNFpqjiORCyqt9 8pCcXj4AZ1YbhFFbj3W7ajLe7h2gXC4rMNuyJsbN1iJkjE5dwSzayCBdOV72wS3vZcre JnzVqTwmkYZU9nTKEz/hC4Br2W+Vox+PKObUomRtPjgDTAKEnH+VBlzb2oH1bCKv9sh3 D1weIaluSlZoBSuWDSj2GrkYVadfgsFmpIoTfXYH/RcCbpWr2DCGOJTk/epbKvofMKK3 5tPazbcoTEqT0TVZ6eFXMKVh5Mk3qEtlXygsAg6BhJK2Siv2F07/oyE7GbofK2BupPpG 5Xyg== X-Forwarded-Encrypted: i=1; AJvYcCWqW9HbVt/V8EU20xWcVdZ1vvc0H4oqUM9td+dt89zwZ60uxBa3kBXhKJDSYMPC0r3z7JvPeBg=@dpdk.org X-Gm-Message-State: AOJu0Yx6xy9G+eyp6Z1HktNxPzh09wfqiUhcObT+IDc2O10ipTQhHtU8 RonnUD35IySAfDLDVbdIioufwbh9WrdWINFpd4tsPGMeVemJA0jaqOZIPOf3q0Y= X-Google-Smtp-Source: AGHT+IG4e5rOcZSrPe1+jJevIhaLreLHAynwOB5FJpIh+rmQigXzdfQ3IJeMSVyaHJ/1KDJUlqSISQ== X-Received: by 2002:a05:6a21:3a4a:b0:1d5:10c1:49c1 with SMTP id adf61e73a8af0-1d5db1a992cmr6187928637.9.1727894381225; Wed, 02 Oct 2024 11:39:41 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b2649b0bdsm10104362b3a.34.2024.10.02.11.39.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 11:39:40 -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 v7 15/16] baseband/la12xx: prevent use after free Date: Wed, 2 Oct 2024 11:37:53 -0700 Message-ID: <20241002183918.161656-16-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241002183918.161656-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20241002183918.161656-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