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 E1B2D45A7E; Tue, 1 Oct 2024 18:38:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D71440A6C; Tue, 1 Oct 2024 18:37:33 +0200 (CEST) Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by mails.dpdk.org (Postfix) with ESMTP id 7342A40665 for ; Tue, 1 Oct 2024 18:37:26 +0200 (CEST) Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-718d606726cso4126730b3a.3 for ; Tue, 01 Oct 2024 09:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727800645; x=1728405445; 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=WGSNFHMRhKITOMF5GgzbIVjnpE9RyJXiu2lXPy9ZHbcJ1ZUIzDK8M+EkGShMslq1GE zsHM5xtJ8+d1rHi/1rjyV2cK6crddhUN6cxjuuaxhMBNoWJo+qqpsq2rbaWhaGguv2+r O64VKTIHvAfsso5pEyo+ACr/fx4spQyBbDnwLs3R8L+0LPzr/DuwEAa0DCU3Cd/c6pdP 0G6dKFv+iWpg4beHL6ISFqClUk+4FmFODVXXOVz7SjN0AhXoDmoqe5Q5HxyZ7Er9i7r4 fsgVuYnWIRG5dSy4rI8IkZWwfT1RFZnkSVNA5vLbtQoI70ocwFOTSvhPmHKGxjXB7EOK 20IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727800645; x=1728405445; 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=WWptADQ5t2zzKReFsn2axm0+zYFxIyd8UKhdsGD9mDIUSi3cSaZndbcwvfTTMjNzaw S5tM83Ow5/aCIEn+ImwLHJgOC2ozCtv8wUV7XYEPS/Vu51l8ryHMrcR4a2BgT608w4vt 5hhIQ+TV5G05eWSUESX7BojPhcZU5aHJRZeLsd7wlnNoORYKB8phfwuNXQ0YOmaEMf0/ ic7KLZLqRBwwm7E/rBL8xqWolrPEab9eesOHRvcCEak6fCrbqlxSNNdnO+3rb9jmE+v5 JdtlhKckaWMVf0jh5wDa26P15QIBzxwImf1ojIcYEy2QOstNlrQnqE4k8q1SbpjL0pgx 8HJQ== X-Gm-Message-State: AOJu0YyLVnODgQrqpxglDzCBiJGKbV1pzxb4Lq/F21N0OjAe2jAtwZnL 8y1XSXQkh3kC10a+OYHNqvm6MJdldN09j9rwRIskBsLW6FplqkGNO3aed8mMvMnJn25eufMQdUx mTUQ= X-Google-Smtp-Source: AGHT+IFFysCJ9t2CLNvuTeSZJ0Vrr6J5Z0ybncXzcnybUuE6KakWIszlgY3B76V5pgivFDqtu9pO+w== X-Received: by 2002:a05:6a00:139d:b0:718:9625:cca0 with SMTP id d2e1a72fcca58-71dc5c64169mr413290b3a.7.1727800645669; Tue, 01 Oct 2024 09:37: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-71b26518818sm8213565b3a.129.2024.10.01.09.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 09:37:25 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org, Wei Zhao Subject: [PATCH v5 08/17] net/e1000: fix use-after-free Date: Tue, 1 Oct 2024 09:35:31 -0700 Message-ID: <20241001163708.355128-9-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: 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: 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