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 E623B45A7E for ; Tue, 1 Oct 2024 18:37:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A407F40E03; Tue, 1 Oct 2024 18:37:42 +0200 (CEST) Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by mails.dpdk.org (Postfix) with ESMTP id B4BA940A67 for ; Tue, 1 Oct 2024 18:37:32 +0200 (CEST) Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-718d91eef2eso4048105b3a.1 for ; Tue, 01 Oct 2024 09:37:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727800652; x=1728405452; 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=gT5VkqBaheReVecWvemG7L4Q6kwXlZ/qRIgDXsPTQ8T+cOZtE471jjs/PmAnXjQnRN fnJEQLAd4+5Kq/9VXFnHp0Rt0swqYzIarf5U2vdvwJ32JHdDeJ8AZ9fZxpfYb78oSi5q mDYo1Pj+7C0yQ6XQrNl0a6oJb9PL65gXX3qox2HzwnXMiKHpCnhRrNOPKQpP9NZyQpq2 5lRUQROSlR0W80gi632mCgMIlQGQ0W1eN4QFe4lwVnpw5N+Xt1gW4120MKpkjNciy/t1 bgPd4aVI/SCXbfhbw+LJovYZTllHe4PfSFuJ6T8UwlWcKOcfMZXQBgF1vXMKaddfwGXj ELAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727800652; x=1728405452; 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=vrkSgKtus217FeUsMx6pcIlrEsKhtnWrbqW+Kfs2WFRlfyYNTEq4++Y7dUJhXRix4K o2MivryToGyCOZccudpNHbekiFmu/L5+ccQpW9qUrb08rD0Epz/+Uqfahiq1ZHzP2Cn1 tbGG+Lz8ICMBjTJozs4iCd5R8kHhbJkObWbUUD+uTKQB1Kv0YYKADSmGAiBiitkpF4EO 9YMUygFq+m5bOI98n490JygJrhp0Gr4Bl+kehFUN6OPQlH/2Tdef//xQKm26h8SYYUHe Kck0Gw0XDslHD+IdyvtxYXuazLy68iuNR+CrfV4BO/RHGqN73hDUbpG5a62mcg+V+hHa G6bQ== X-Forwarded-Encrypted: i=1; AJvYcCXzMhz8HBwjZCP4rbiW0+jr28qfmH3WSqrpP15anLNW3EaHQmYxaT+EMyEaZZ91b1z0VxfPcG8=@dpdk.org X-Gm-Message-State: AOJu0Yy0kNZofmyLMu7OrSnU8qVCvM8rbHOqI7dHBNwxHs32dcpmigck lZy8NsMZ0JGtyQpLwqAwI8LaU9/tA1KDFB56v6pg6g1e9lvI0dN146qtpEZ/J2U7RsORFXIhwU/ FNwo= X-Google-Smtp-Source: AGHT+IG54vfegHUylDAAhpyL2HgGBiybx2varWSjoZTPK2VDEfOPnb6w/IcdjHRZh5M1YxHlxwHbaA== X-Received: by 2002:a05:6a00:2e90:b0:714:228d:e9f2 with SMTP id d2e1a72fcca58-71dc5fbc9aemr309315b3a.3.1727800651950; Tue, 01 Oct 2024 09:37: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-71b26518818sm8213565b3a.129.2024.10.01.09.37.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 09:37:31 -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 v5 15/17] baseband/la12xx: prevent use after free Date: Tue, 1 Oct 2024 09:35:38 -0700 Message-ID: <20241001163708.355128-16-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241001163708.355128-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20241001163708.355128-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