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 C710F45AE3 for ; Tue, 8 Oct 2024 18:49:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7D3AC40E54; Tue, 8 Oct 2024 18:49:08 +0200 (CEST) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by mails.dpdk.org (Postfix) with ESMTP id 85EAF40DD6 for ; Tue, 8 Oct 2024 18:49:00 +0200 (CEST) Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-7db238d07b3so4933061a12.2 for ; Tue, 08 Oct 2024 09:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728406140; x=1729010940; 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=Plgy9PDqajvquXkog4RVCkn7bnNeKWLvrtxzK7ec50g=; b=NlbOIIbu/r36kx4T4l9uAJJ4symZ0ixwyeUtATVVJM8FzUuUnQiyhxHfyNVWHg0HuM TbrL/1zeemx5cH/EayPDDue9MMoYZUVP8E2/GL9NDY8ZYLbKa8WhwVeckbqvRWDc702q GnMQia3NNfKcaV4NOeF42UZ97PwCrKVGm453kaSovaA6nikDh9ScNmckEDnHnTT9TE4q uRctGpT0MkKjqeGvw3c+0l3JMUu77WLUVyUkv/kwMsnanX1v9zQkA0HJB/mBkxEZbciq E20ecmmf/WyVaN4dGme7deVNu9gY0XtrFm4J5OAIWRJQWpTIqw+ltsz5Xj/W31iirHEM exSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728406140; x=1729010940; 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=Plgy9PDqajvquXkog4RVCkn7bnNeKWLvrtxzK7ec50g=; b=M5lsEXygA6+99hwiAyVXR2om5CcWQrGbx+H1AOgRDRxL7Xydt1ZCkj94n4oMTbYMxa HmR00VwWUtMmtYsy8jIrWiF8YSePut+Wq0m5Sry53C0YLJrtulf4VZtppLO6K/AH8FNy awmOL6uNonxX6jxwYn7ZevdWS1G5r+gFWocnp8IzW4AGS5dnZ4jH98kq0wfDpdOCy3+e hfTJFKJ8Bv1IRW/MsmRoX++lNQ5Q3ZpmQNgtiWrr3LqFUd3yKfQtLtJ9cD06yLKkI5pf TLMwJHCLomT1vfUM+rs49TB0XKzY9+5AxJp55aTn6D6JMnElNBZYi8okmhMi4lkZxHZR BrPw== X-Forwarded-Encrypted: i=1; AJvYcCVfenzIU2kWe7eSVtrpVCPB3FrPGDqPK4+hGJFU/B/iZ4gkaOqVQ4KMiVfYAKZvyeInT1PsaS4=@dpdk.org X-Gm-Message-State: AOJu0YzvUi91VS1kQ1lzsSLd6wNI03Uuey1ZJYohoYOrxAjQqJxZ+14b 2of5nl6oZcdG7C+CZlVkiNU1MvCfTQGAi/e6No0kxyE8iGvnG9X7rJZYxmXt/gQ= X-Google-Smtp-Source: AGHT+IEfy9zmaqHrh7yQqVy+4OqvVmNIVEAnTHQKUqOResDbk4DsShHVthR8GeCZSxqsB+5gVOMPMw== X-Received: by 2002:a17:902:f70f:b0:20b:71dc:48ab with SMTP id d9443c01a7336-20bfe39d8b3mr249734305ad.40.1728406139831; Tue, 08 Oct 2024 09:48:59 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c54056bd9sm13832965ad.85.2024.10.08.09.48.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 09:48:59 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org, Wei Zhao Subject: [PATCH v9 08/17] net/e1000: fix use-after-free Date: Tue, 8 Oct 2024 09:47:12 -0700 Message-ID: <20241008164842.139045-9-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241008164842.139045-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20241008164842.139045-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 1e0a483d4a..d3a9181874 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