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 8954645AE2; Tue, 8 Oct 2024 17:45:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3AEBE410DC; Tue, 8 Oct 2024 17:43:36 +0200 (CEST) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by mails.dpdk.org (Postfix) with ESMTP id EC29C40E2C for ; Tue, 8 Oct 2024 17:43:25 +0200 (CEST) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-718e9c8bd83so4307055b3a.1 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=FN/pS3rrqwn1WpUz8prin2gF+r5th11R1S3Azi4k4IEwG6q1WB+R6ppdAPdbUdzLNf /A55iGNk26lGelFPwxF7/6fnHmS1MCtu3Vxyz01dIDsVJ/LaSz7wQWbu9odGnvesCGo8 fftxh6KNE1ZnHEHuHpoTFRMkOrAqogg6EL34vkaTV/Xiv7QWMVR+PRr/zgVBnKS2hQmy vLx89DBzAhs/+idVN37nhA8Mek3sPzuhcf0aEw64MJDdGC2osNqafl6BMshDXDJRfvMi Gw9La5+Ib9WdcbB7ixi5wceww0CbAGDeV10sJrmeLvvhg/M/ZVKWxnQBOLwn8eJkYVi4 Q2Yg== X-Gm-Message-State: AOJu0YxD7rcmzIUrMOVeL2q3KFKscGymIEsb7wcOR6GjBQY3kNxQcyjt QbBe4eG8b5lex09MGhfwM5UrTeNsf8IIAbZeypS4s+k3oK3dWhHqdNjAJ++CVpvJjSSA5Au0SRd o7nKyRQ== 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: 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 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