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 E03D145AE2 for ; Tue, 8 Oct 2024 17:43:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D38B40E4A; Tue, 8 Oct 2024 17:43:36 +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 E6A0140E19 for ; Tue, 8 Oct 2024 17:43:25 +0200 (CEST) Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-71dfccba177so2164964b3a.0 for ; Tue, 08 Oct 2024 08:43:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728402205; x=1729007005; 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=KiCmi4zmz86nTUudAOnY67M0hc+4wJo3hDS6PQwlDzs=; b=yBDqkjyng5dYO18wWSIaLi2B9kaaPjIuyJYCNh5MoNBL53wzy9sZN4uospkJejRP3M ACGD8oNefyLbRt+hQs9ESIEPoDFC/azSU5CsZwJFU2y4ackeoNJCmiIvRv3cEkvTKb6s RzoxgSTTGwcijtcc//JgsD6iMETQKiRBckEoM31WD02SIdsux0dbcRSqB4IV4D3nOVvQ r98iLN4VBpPMqk+ESWDbjI00F64mFYKJclkXcrmwl6ohvpLAo54UDPSlvFrDZbDckiji fsWNRP2KGvUyeWsW67Zj7w1mNi8kWgATAyWR2BsJX89d5oD5DZKBKb4gHRGAk/opbJcf JViw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728402205; x=1729007005; 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=KiCmi4zmz86nTUudAOnY67M0hc+4wJo3hDS6PQwlDzs=; b=HDTuhiAgOtR5aZwPTPEPljoFOgPKae2kejUZ4JZ/aKoCHy204l9pwbNCztQVTwMaWp 7LEXw2z6No7dxGepZ1Pt1xdxKQGHJS5WUkdsziHQgququQuiSFVdQoxkYIXWNLW7a92E DhkYrSFR5DTTE4sioGI8/1ZUsQjBE34bKfc2PVmJyTwZWpYkyUkiBGcdYzqDfl9JfNal vHT6kYFmjZAMTw4vGbVaoaVu0yf0wCJGyjgpnBnYoTSPiNVHUBSC+VChvKSe52wky/Dq MweJQ0/VXQHNjXf+hF0pywWit9cM1H8dZD9oWn/yzf5GsCFQglb/cNfnttqB8H1CGZJg GkNg== X-Forwarded-Encrypted: i=1; AJvYcCUvDrY0/Lo7vejH3OSjr3/zQ4GyvAIHQampaAanSMgulyGRvvY8tJKFNjHLGjMglZxY9lBSb8c=@dpdk.org X-Gm-Message-State: AOJu0YyJUdo42yd3RcdCk3YTk/UHrz85fcgIotZg5fEjgBs9Dd4EIkTS yml+ROkuenXSgXOaDeNX+rIQY5tn3wOg45Xtkj8wbYPvNk+H+8uiqmsRVxo/Hg4= X-Google-Smtp-Source: AGHT+IG5RAq3mfv3ZCdRCfk1ttYOlrCFkrBhM84CRBDUgICV4zGDAXXqwaTNZCCgcP7kJgXcPC5txA== X-Received: by 2002:aa7:88c6:0:b0:71d:f459:6df3 with SMTP id d2e1a72fcca58-71e1b6c7504mr933311b3a.10.1728402205035; Tue, 08 Oct 2024 08:43:25 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71df0ccf01dsm6293527b3a.70.2024.10.08.08.43.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 08:43:24 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org, Hemant Agrawal , Gagandeep Singh , Nipun Gupta , Akhil Goyal , Nicolas Chautru Subject: [PATCH v8 15/17] baseband/la12xx: prevent use after free Date: Tue, 8 Oct 2024 08:41:45 -0700 Message-ID: <20241008154301.66192-16-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241008154301.66192-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20241008154301.66192-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 af4b4f1e9a..2432cdf884 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