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 1A9DA45A9D for ; Wed, 2 Oct 2024 17:44:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA17A40689; Wed, 2 Oct 2024 17:44:51 +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 A57F940652 for ; Wed, 2 Oct 2024 17:44:46 +0200 (CEST) Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-71b0d9535c0so4837903b3a.2 for ; Wed, 02 Oct 2024 08:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727883886; x=1728488686; 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=tvq5E5KXslKNmPC408QbgP3MTNkCviUF5WUYmeRxPkg=; b=Sfc3ZSRRfNk49RmmdddFQjTucS/wRZkbgUMPPPbsfSdDtnwR3xguZoc2ulWA0+yiF/ UxnBtLNvkozv2NK1mR8xObySiT5Y8GcsgQJzlSXyxUcqpg03lZmI0RGld8XGqfkWwJ9I ts4R/Ld727RV+1c5M+gP1hop2qmCdnnucNzBtOfvUU+Zq5AUjMe5YbkXUq3dqI8hc4Rh a1OlQhQ2uQmADBUJ5ZkwIkWVL+5Kq4ilL0fBDSy325RvBJDfWz2VcRn0RZMWfE3OQX15 TDBmkaWRWl9pY5IuRProbn3/slZbeGHQoT6fqFXqQZGDgscvCyO2vGhRqt1y2dkTxQ6e k1Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727883886; x=1728488686; 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=tvq5E5KXslKNmPC408QbgP3MTNkCviUF5WUYmeRxPkg=; b=gdcx49OTYbDyByAMbzYiWqQtzJ2uJNA9aZ24zshkMltF8C5anLz7DvHouB8tQ4YkHR vNal12Wdxc2a3PykNh9q0IpC5gywxl51RATKvxeKXvjSJxjQInTyLd0Uw5ah4jHqcZxW HV2Q2RQNdsaTnn5JEoIX4WubNUEeIDXWeVx0H2+7qNkHYSiF0Jt36cTs5sTlKj16lTy6 UBahVP0yZ6u0QiwM2XjF23kQ7YIGpJNGBaHddYqDwojjtJLCmQwd2JASlPbSbinJxtDV +NrFD1jNDZUDwL7chi5efaLwvZZZX79fy2F7mSNy7jNsOfyDoKDofoaU//CW04MvgcnC 1UIA== X-Forwarded-Encrypted: i=1; AJvYcCVzDn5Mg3rvvSBWwdrNbTkFNGFZ16UUaryckD9pkHdHCbPxPJ/hiySd/9IhFKj9sCxCIvEVTM4=@dpdk.org X-Gm-Message-State: AOJu0Yxg/Y7ugGjZjvR5yRTMkRZ3pSINKOb1g+Xp5dRha9Oy/JpGPrWO a1jLKOEMi4QSthwSScRRbgAQxHWRNk70tsWLkYzwVA4Nf/LbPqDj/1nm78kDwvE= X-Google-Smtp-Source: AGHT+IFfqXYxOeGB1xqipRKVVjQexp99zh5eddNHjmHGBthwqvCOotSJx1ryX2EbVAyJOC0aOYoV7g== X-Received: by 2002:a05:6a00:399a:b0:718:d94b:4b with SMTP id d2e1a72fcca58-71dc5c4df18mr5335445b3a.6.1727883885865; Wed, 02 Oct 2024 08:44:45 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e6db2927c7sm10247363a12.1.2024.10.02.08.44.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 08:44:45 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org, Wei Zhao Subject: [PATCH v6 08/17] net/e1000: fix use-after-free Date: Wed, 2 Oct 2024 08:42:52 -0700 Message-ID: <20241002154429.64357-9-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241002154429.64357-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20241002154429.64357-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 The driver cleanup code was freeing the filter object then dereferencing it. Bugzilla ID: 1550 Fixes: 6a4d050e2855 ("net/igb: flush all the filter") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/net/e1000/igb_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index 095be27b08..973d0d2407 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -3907,11 +3907,11 @@ igb_delete_2tuple_filter(struct rte_eth_dev *dev, filter_info->twotuple_mask &= ~(1 << filter->index); TAILQ_REMOVE(&filter_info->twotuple_list, filter, entries); - rte_free(filter); E1000_WRITE_REG(hw, E1000_TTQF(filter->index), E1000_TTQF_DISABLE_MASK); E1000_WRITE_REG(hw, E1000_IMIR(filter->index), 0); E1000_WRITE_REG(hw, E1000_IMIREXT(filter->index), 0); + rte_free(filter); return 0; } @@ -4348,7 +4348,6 @@ igb_delete_5tuple_filter_82576(struct rte_eth_dev *dev, filter_info->fivetuple_mask &= ~(1 << filter->index); TAILQ_REMOVE(&filter_info->fivetuple_list, filter, entries); - rte_free(filter); E1000_WRITE_REG(hw, E1000_FTQF(filter->index), E1000_FTQF_VF_BP | E1000_FTQF_MASK); @@ -4357,6 +4356,7 @@ igb_delete_5tuple_filter_82576(struct rte_eth_dev *dev, E1000_WRITE_REG(hw, E1000_SPQF(filter->index), 0); E1000_WRITE_REG(hw, E1000_IMIR(filter->index), 0); E1000_WRITE_REG(hw, E1000_IMIREXT(filter->index), 0); + rte_free(filter); return 0; } -- 2.45.2