From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 97E1D4EA386; Fri, 15 May 2026 18:24:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778869473; cv=none; b=PwqjafD9zmk/JmmDfT0PF0S628aQycwvdaT/c7LCg0ZPDHPKtzXjCHc74TT1E3mZJJca3S6ym9vj3VXoI6HSHhWJfP4n0cUIylG1VHxqFkKDvDnNmuorUCpzX9l3m5k86V25SmRG9V3j2swDJ08GpONmy82l3cw9BBpr3crQNmM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778869473; c=relaxed/simple; bh=n93B0EQvRQzH8ivNP8oMeiHNCjU70FZlZ7GsFkzV+0Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Y4ieMZlIdfwBSpQwd/w0R25FLdymRG/zyY9HVxwFleTaRM2oFqqoQe68gnMm+igpmEQbnzHg/0S8fB9IxTcLJShW9BmEBe1Q5TlsJiyY0SOGEnAagUceXweEaKLTNqZ3JSwaa0ebRvftCM8chNYg5Z2zRK4906JRLafZZXnXIhI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=MfIxSbtj; arc=none smtp.client-ip=198.175.65.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MfIxSbtj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1778869471; x=1810405471; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=n93B0EQvRQzH8ivNP8oMeiHNCjU70FZlZ7GsFkzV+0Y=; b=MfIxSbtj9s2FrVax23dlLtidWDxENKWrOvr2G1ZGVM3BWz0fz9rFfXfx 3BFufAkPJC5ayXtTl2cZ5pEbY3fsHe7vKdt7zRhNqXW56Bb+ejxevpTq0 MYfZHXEHANcIIPGYr2458GAgPXe0mz7S+6qPk4zywXI2NEHoDAstCAK+s dQTR3G81+Z+5B9WOc2QK++Uy55nUJMTpZk6A5gi80e2+uYmQr85FkmDKM h5hsJBZhxuI4bFWt6BvMAIIoaRe/g6fYvP8VFwTKk2gJhecM7TC8/bvAc L5p+oAoMySKbyaWEnz6BwimNhpT/qTB0N9emF941R+YYNL/lMD6VmJztl Q==; X-CSE-ConnectionGUID: G8hZ6A3IQWmHC7g2hSSkDg== X-CSE-MsgGUID: icVNxpKDQsGrwwmXD8livQ== X-IronPort-AV: E=McAfee;i="6800,10657,11787"; a="83701168" X-IronPort-AV: E=Sophos;i="6.23,236,1770624000"; d="scan'208";a="83701168" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2026 11:24:27 -0700 X-CSE-ConnectionGUID: /p0hKtiKQXWyHlSkLWcT3g== X-CSE-MsgGUID: MfVRPAsnRNe+9Q/qSRJLYw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,236,1770624000"; d="scan'208";a="238647454" Received: from anguy11-upstream.jf.intel.com ([10.166.9.133]) by orviesa008.jf.intel.com with ESMTP; 15 May 2026 11:24:27 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, andrew+netdev@lunn.ch, netdev@vger.kernel.org Cc: Michael Bommarito , anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, stable@vger.kernel.org, Simon Horman , Rafal Romanowski Subject: [PATCH net 07/10] ixgbevf: fix use-after-free in VEPA multicast source pruning Date: Fri, 15 May 2026 11:24:14 -0700 Message-ID: <20260515182419.1597859-8-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20260515182419.1597859-1-anthony.l.nguyen@intel.com> References: <20260515182419.1597859-1-anthony.l.nguyen@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Michael Bommarito ixgbevf_clean_rx_irq() prunes frames whose source MAC matches the VF's own address (VEPA multicast workaround) by freeing the skb and continuing to the next descriptor: dev_kfree_skb_irq(skb); continue; The skb pointer is declared outside the while loop and persists across iterations. Because the continue skips the "skb = NULL" reset at the bottom of the loop, the next iteration enters the "else if (skb)" path and calls ixgbevf_add_rx_frag() on the freed skb, dereferencing skb_shinfo(skb)->nr_frags - a use-after-free in NAPI softirq context. The sibling driver iavf already handles this correctly by nulling the pointer before continuing. Apply the same pattern here. I do not have ixgbevf hardware; the bug was found by static analysis (scan_drop_continue_loops.py + semgrep drop_continue_in_loop, multi-tool corroboration with the highest score in the scan). The UAF was confirmed under KASAN by loading a test module that reproduces the exact code pattern (alloc skb, kfree_skb, then read skb_shinfo(skb)->nr_frags): BUG: KASAN: slab-use-after-free in ixgbevf_uaf_test_init+0x100/0x1000 Read of size 8 at addr 000000006163ae78 by task insmod/30 freed 208-byte region [000000006163adc0, 000000006163ae90) QEMU emulates igb (82576) but not ixgbe (82599), and the igbvf VF driver does not include the VEPA source pruning path, so a full end-to-end reproduction with emulated hardware was not possible. Fixes: bad17234ba70 ("ixgbevf: Change receive model to use double buffered page based receives") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-4-6 Assisted-by: Codex:gpt-5-4 Signed-off-by: Michael Bommarito Reviewed-by: Simon Horman Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 42f89a179a3f..4ba3be961ab6 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c @@ -1221,6 +1221,7 @@ static int ixgbevf_clean_rx_irq(struct ixgbevf_q_vector *q_vector, ether_addr_equal(rx_ring->netdev->dev_addr, eth_hdr(skb)->h_source)) { dev_kfree_skb_irq(skb); + skb = NULL; continue; } -- 2.47.1