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 0B55645A50; Sat, 28 Sep 2024 18:49:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B8A740687; Sat, 28 Sep 2024 18:48:42 +0200 (CEST) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mails.dpdk.org (Postfix) with ESMTP id 02B904060F for ; Sat, 28 Sep 2024 18:48:33 +0200 (CEST) Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-20afdad26f5so40141515ad.1 for ; Sat, 28 Sep 2024 09:48:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727542113; x=1728146913; 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=z4ivJFh4i+sS5Kt3NFIojkEwQfvp829B9cFV3HoaYyY=; b=bS1HAk9gro+uNyidhFeILTuLtL2q7syw1LShbSg4BFfZGLEvde46tR+TkBOGSVQ95o eZb5eZvr3Rezh+IVkwNXBAUyiuS+djvTUo/du3Qo6jBHgznq/OnjFUOvr1pYALYgE8JK bmTEMqPAoozihu6Zq7Wg/mePgHPXZqz8YNwgWZqV6cytp7wbrgtemxYXcVvDzlFwrlYq NH4nXOr/9Q9z6Sqtofp4DrdpRvG2HZ5GKHoaG6az6VowdCAy0H0KL+6sfzIKulNKKJ3T 35Gfsygc7hnMmUK8PxgSeToeM7qOA0hDzdJ9aPecxwZC9p5WXVtAgQZpqkRKuP+70+A9 OL5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727542113; x=1728146913; 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=z4ivJFh4i+sS5Kt3NFIojkEwQfvp829B9cFV3HoaYyY=; b=CInqAeu+gmeXhLdSqSt/LXtgKFqiApE56PMU3acLe7x0L5ZAqgd0sc4rsuH2K8OzZV 85dOQGJftMfDvcPXHmQ9Wczt4yK0thBy0YKnNBDUdAW3kEPe+v7UjpG+4RetTsteR57W ItFkIJU2fJlfJs5rpiMGh5wyafmeXGB/OcrMw87Y6sQawvY2tdOQQDByU1siEnVoNveG ykwnEfnm1e9OdOHMdino+DGYLGl1HVvSVHYIHaX4mbt2nHGpkJYdrbTqK/jj+v9NNm8z ZzXkOkjGe/6+mfSnRw81Zbj6nNxw64adQSLsVLovW49qEQNy06ai+SP4fWjwQvleKNLy 9lNA== X-Gm-Message-State: AOJu0YwC28h19asvDNcskts6GG24h58P2NBCwwRs/cQWWlM2dU6vjCHo PlDodWL1nLpUvpSjD3bZS+QwkiTyPfJMgvSrShbhPXIFLlJEUuXi8yvVFgb8/Ezs3EUNpjeEnoW s X-Google-Smtp-Source: AGHT+IEIDE0c/bxLw3KL+h2WWVMhGUKH2x3vGX4DXtU5zvSYMq4hbtrHR+Kvy6CC26YthJpr4VTk7w== X-Received: by 2002:a17:902:f688:b0:207:15d0:8b0a with SMTP id d9443c01a7336-20b367d5b27mr119197275ad.10.1727542113191; Sat, 28 Sep 2024 09:48:33 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e47c7dsm28854015ad.216.2024.09.28.09.48.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Sep 2024 09:48:32 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , wei.zhao1@intel.com, stable@dpdk.org Subject: [PATCH v2 09/16] net/e1000: fix use-after-free Date: Sat, 28 Sep 2024 09:47:17 -0700 Message-ID: <20240928164814.861933-10-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240928164814.861933-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20240928164814.861933-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 The driver cleanup code was freeing the filter object then dereferencing it. Bugzilla ID: 1550 Fixes: 6a4d050e2855 ("net/igb: flush all the filter") Cc: wei.zhao1@intel.com 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