🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #7984

[PATCH net] hv_netvsc: Stop PPI parsing on invalid metadata

#7984
From: Erni Sri Satya Vennela
Date: Tue, 27 Oct 2026 16:47
52 lines
9608 bytes
rndis_get_ppi() uses continue when a per-packet information entry has an
invalid size or offset, or cannot hold the requested metadata. However,
the remaining length and entry pointer are only updated at the bottom
of the loop. Each error path therefore retries the same invalid entry
indefinitely, repeatedly logging the error and preventing receive
processing from completing.

Return NULL on these validation failures instead of continuing. This
terminates the lookup when malformed metadata is encountered while
preserving the existing behavior for valid entries.

Fixes: 44144185951a ("hv_netvsc: Add validation for untrusted Hyper-V values")
Signed-off-by: Erni Sri Satya Vennela <ernis@linux.microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: Wei Liu <liuwe@microsoft.com>
---
 drivers/net/hyperv/rndis_filter.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index 9b6c44979b4e..2c30abf9faf8 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -401,12 +401,12 @@ static inline void *rndis_get_ppi(struct net_device *ndev,
 		/* Validate ppi_offset and ppi_size */
 		if (ppi->size > len) {
 			netdev_err(ndev, "Invalid ppi size: %u\n", ppi->size);
-			continue;
+			return NULL;
 		}
 
 		if (ppi->ppi_offset >= ppi->size) {
 			netdev_err(ndev, "Invalid ppi_offset: %u\n", ppi->ppi_offset);
-			continue;
+			return NULL;
 		}
 
 		if (ppi->type == type && ppi->internal == internal) {
@@ -414,7 +414,7 @@ static inline void *rndis_get_ppi(struct net_device *ndev,
 			if (ppi->size - ppi->ppi_offset < ppi_size) {
 				netdev_err(ndev, "Invalid ppi: size %u ppi_offset %u\n",
 					   ppi->size, ppi->ppi_offset);
-				continue;
+				return NULL;
 			}
 			return (void *)((ulong)ppi + ppi->ppi_offset);
 		}

base-commit: f71ff7d406523748bfb8236830c7eaa6a308aaa1
-- 
2.34.1
Technical Details
Message-ID: <20261027164722.3393397-1-ernis@linux.microsoft.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352552-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352552-linux-kernel-netdev=dewy.ru
From: ernis@linux.microsoft.com (Erni Sri Satya Vennela)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net] hv_netvsc: Stop PPI parsing on invalid metadata
Date: Tue, 27 Oct 2026 09:47:22 -0700
Organization: Usenet Network
Message-ID: <20261027164722.3393397-1-ernis@linux.microsoft.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1584808"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:+r7z9oUTXlu7yu//wu2oQ9R5pXw= sha256:l6Rw0l4c9PMSbwQRGTUjcAxVCSonRq3cWBMzIW4iONk=
	sha1:5Ui7KiaRAw13tr1ULxdpA6Et2xc= sha256:ACH0G9qAD4K6tpXqfZ8pS81JZOZOzBlFTlq604tO2Gc=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id E2B2F125C0E; Tue, 27 Oct 2026 19:50:48 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.15
X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=linux.microsoft.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id etoXt_3diDPP;
	Tue, 27 Oct 2026 19:50:46 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-352552-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 2206F125C06; Tue, 27 Oct 2026 19:50:38 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id E722C601A1F; Tue, 27 Oct 2026 16:47:55 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793119669;
	b=2o+jnVEmvcuPHK12wvZN6AFpeBRwQ+LWbhgbt7zqWoCxhEnE/+FOM9yHbnTIQekVBqxf
	 mABV8t5aoYNLmp6UfdSBWKNpjY1RF9nMAyQLA8OTKlUwWMLSJ5RLMz9e4EnpkqhidGVf6
	 dJ8291p6iV0PphH4do+5IWLHT2XVudqzD2O2zTRn+/0bWDKCIrwMu84KtUoodUWCdNQ/v
	 QIXTEBU1BfevwTahBwEUntzXQx4GZcoIFnDINcN6dBFEsnyN9ptxP5TmP9RU+rkWPqz3k
	 v/O0LZrahYdk19qguQXhLR0lOeJr2Mm7tsX/1RiFMGvj5eZpFxFqgmuoV62UjR4phfA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793119669;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Filter:
	 DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=m/2Ts66a5u4FX+7zqnc7Voow1WkE+bXtztEL+Nbsbm8=;
	b=P62dGdfACXCtmzBmRx2ll5SdosvAyeRog6dL3XZ2WdXNbiB2/k566swfHxPYFcRvkU2s
	 cuS3UysQyW4FcUchQYFdu5IrH2hrQX1bwnjnAq0LpJzkCQS5VRNkKb7Nfnj0AvmMWn7+u
	 4VFvBVWl/BrRM47y03VVVy+ydcoFQi0wKppU8zJxxnru0W5OV51ZUmcG7Mo+32IOtulNi
	 B61xlrgTCHH58mwi+KtEJmK9/bUOrthczzE//t1yNGFeZpPUdaUe8lEzodbGb6nOUKHXX
	 NoSz37bGtGWjrQ4BhXsoyPvfOHnIbXpBOH77VO5q9hjIy+8r/HlYEZvSgfhz9n8AtkQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b=Gi4tZAQv;
	dmarc=pass header.from=linux.microsoft.com;
	spf=pass smtp.mailfrom=linux.microsoft.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 28A9B606A321;
	Tue, 27 Oct 2026 16:47:49 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b=Gi4tZAQv
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=13.77.154.182
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793119663;
	b=yGS2pbZ/cLf6LbYcPE972jZIovw2Kg5J6pgWeyrKXV/CUjSUEV0dmGukKjvB7R3pFrvT
	 W9DdhY3GRnmCI445fe6y2vVuUeNmt3ScQjBv9R7bPAme7D3CVm+iUD2Cn8og2JhwUe52Z
	 8ivqSoz7LIcAObkHlzvZj/K+yJYi6iCbCpk0lFX4ivTvJKCzfPEygur5ewLcYW7zqofuX
	 3EUoEA7D3FOSW5ciLUMmLKb+mm6pH1R7LuXvUSZ0Mtq6MMif2DZo3n4Ej/tH120qlDIBT
	 ukexsKgs/mIMRnCz7xxJGE65T1nzxgKXD2bmT0pn5rU2k77sb18xGDWyZLaR/r3dd7w==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793119663;
	h=DMARC-Filter:Received:DKIM-Filter:DKIM-Signature:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding;
	bh=m/2Ts66a5u4FX+7zqnc7Voow1WkE+bXtztEL+Nbsbm8=;
	b=L+wtcsrws4niz4LVKsQhK+mG7/XrZrVeHrutW448ysdHQDzsVucbOogo0UKw3IccaGdm
	 VsHdb3j/a7ZRe2mYKwUq+uic16wMCeu1JO/7qVEZFyGMk0hhupP+7BrQBZruNKUb3S3fK
	 UTwFULBrXtrKTCQgaA8B3+Zg6XERqK938lJocmZXwsS1lOSZYlrR8rwT7IRMDp+3CthlC
	 svKhQrOaW6pgCYVbrIlVOUgiQX6DUGxokRcaKJXb/4hdMexFv+OS9BWOu1vpsZnpiKsH1
	 lzFT+DLnI7PdMprXM0lgSJTKhQXLF6otGy+ChAH7xDuSRS/1qayxGZVRJKparwBIzAg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linux.microsoft.com;
	spf=pass smtp.mailfrom=linux.microsoft.com;
	dkim=pass header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b=Gi4tZAQv;
	arc=none smtp.remote-ip=13.77.154.182
X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id D5CC8606A31A;
	Tue, 27 Oct 2026 16:47:42 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D5CC8606A31A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com
X-Received: by linux.microsoft.com (Postfix, from userid 1173)
	id 973C320B7166; Tue, 27 Oct 2026 09:47:31 -0700 (PDT)
X-DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 973C320B7166
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
	s=default; t=1793119651;
	bh=m/2Ts66a5u4FX+7zqnc7Voow1WkE+bXtztEL+Nbsbm8=;
	h=From:To:Cc:Subject:Date:From;
	b=Gi4tZAQvosiqU8lFHJR/9opedZiDwPQe28RMz3rx/liA/YCiaJdgd0kVh3Pv+p8WX
	 PTd+l1u/HCDo6xAXr6UwT4bEDij6MRkqJQ8Y6dvm/J4gtwZYy8NuRaDSkfCTVUkSNM
	 0pX/psfTi+ox78h5+wEFBpWHZkPHrp6Uq9Lv3UHs=
X-Cc: Erni Sri Satya Vennela <ernis@linux.microsoft.com>,
	Wei Liu <liuwe@microsoft.com>
X-Mailer: git-send-email 2.43.7
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list