🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #8258

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

#8258
From: Hamza Mahfooz
Date: Wed, 28 Oct 2026 14:20
58 lines
10376 bytes
On Tue, Oct 27, 2026 at 09:47:22AM -0700, Erni Sri Satya Vennela wrote:
> 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.
> 

If you have reproduced this, I would strongly suggest that you
Cc: stable this patch.

> 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: <auIEkCP0B7X0TGqe@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352880-linux-kernel-netdev=dewy.ru
References: <20261027164722.3393397-1-ernis@linux.microsoft.com>

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-352880-linux-kernel-netdev=dewy.ru
From: hamzamahfooz@linux.microsoft.com (Hamza Mahfooz)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] hv_netvsc: Stop PPI parsing on invalid metadata
Date: Wed, 28 Oct 2026 10:20:00 -0400
Organization: Usenet Network
Message-ID: <auIEkCP0B7X0TGqe@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
References: <20261027164722.3393397-1-ernis@linux.microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="1787070"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:LiYgcdGczSC8xYccXoOv6kMGERE= sha256:PKWeEMAya9bvIZZjRINey9U6Opu0ukLU+yUGqMGxMlE=
	sha1:YlbCNuzCzWtzxqyhmVNZ3GTVuls= sha256:/QSSC3Vw9RTMjfvMC8B78U7u/XwDxqDK/CIEi2sW6Yw=
Content-Disposition: inline
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 4451C125C36; Wed, 28 Oct 2026 17:24:38 +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 ViT1d3yC5mGa;
	Wed, 28 Oct 2026 17:24:35 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-352880-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 96FEB125C33; Wed, 28 Oct 2026 17:24:27 +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 72A92602070; Wed, 28 Oct 2026 14:20:45 +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=1793197226;
	b=5i92xhnitz0cDCfWTqvQJmr5CBGHvOI9A/sxUStkDiWLdxCMV211ZCPoyBC3VlI0lZlF
	 Bu/xAcNKnC7GzMtH8AJl1e/0tT53VOFAyytahMgtJluYwSAklm1XKuLrU8i+VTEaLCmuC
	 ktS0CA4STdPhzgwUAVZl93goiE6R4Sz7N9Bm8/XaliFOljw4JO5t4kQ2YCs1ump+rRB66
	 /hSWKXfYDnpU8SUyJTpAc7nXUPe23v1ZuIdH++eJsZXr95coTmOvOr2dbQRi90rRJmfQ0
	 /A6jFMR9UH5uaKF22Nu5JUirDtgK7GvjxWBtaupByL+7doZ5DDWT9Fvh2tg9UHQ5kBw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793197226;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Filter:
	 DKIM-Signature:Date:From:To:Cc:Subject:Message-ID:References:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Disposition:In-Reply-To;
	bh=vpckeDuo02tS2aORCz9pEfJ8ExYYLYf+aGcqhM3+F4c=;
	b=c+pc1AAMl7dRu4IB+TlJfX+SCNZ6BeDIPk7LhjaQ3zb5YCDw+l+gh27IpCwxHgHMY60W
	 9+AJLE1uKDfSjX4jnkq5uzFH0xHOrtgF4288zbFtukBmk5RSggx10wMU0UqtwFWjKjqSE
	 nAG+DxKvYVQEXTQPlorunNBYxYjjqB4ARmQSWjMMCPaW321soqba2L+TW+9oMeZs8o/+o
	 MXMM2Ttj81Gvazw0vMxLZ5haEPcSb667AAbrtCZDbFUb73ExKq/qY4fDfv2xycKmsxuEl
	 Bxa9Haf+YB6kPYCKEbA6ETpTXMyOsBEESLGLDPM2VauXf7dfUBqKDGRV3ujllSN7vEg==
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=giGxvbkD;
	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 41820606A327;
	Wed, 28 Oct 2026 14:20:26 +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=giGxvbkD
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=1793197217;
	b=Oz8vNK5DTK7zPHHFcmsWK4Qab0aiqyXZ4kjBRiUpOL8f4jLNsMnUt6hE+/olGJb8QNSl
	 FjO86LyeJs0UP0w9qCX42U1Yj1QkE5vOf+A5G7fytyduOTJr7xqQXLs5QScSs7L7mvnRS
	 QCFQa+dN5Xwv4drkTBIl8g35ZEAc3o8OS3v9PFS6argROQ/v8vvfDvQZopYdN6tiega+0
	 iESian+DJEpsCjggd4ki3HSqc4Ow+N0HOOoR4QZUeS1abuLtQshiWaArVYtRsXfdrkFet
	 eIFLebbOhq1kE64yWB+jKcjceNjjPaTufFaYlY8yUehpylrsXpwMz0YgNfR2IFS+rAg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793197217;
	h=DMARC-Filter:Received:DKIM-Filter:DKIM-Signature:Date:From:To:Cc:
	 Subject:Message-ID:References:MIME-Version:Content-Type:
	 Content-Disposition:In-Reply-To;
	bh=vpckeDuo02tS2aORCz9pEfJ8ExYYLYf+aGcqhM3+F4c=;
	b=E78KA1LRDeK6o6edAWN3d/kiZASFiwaKCIx8rh9+jEF6R9VgaR1hF9/S3TA14rS4pYzy
	 AKZvG1KhP+/RzBniOl4ZMPgXYYFxB9KrBKkXCOAyQy0JICCPHmuulh35nQUsdBG+NPAU9
	 9WMZtNj5OsHwfJ1WqoxcYhKITlkQy0dg3YsAVLtiJW3vBrPMGsH9wSO7QwDIIaaTJnknG
	 2Dzz5D0YD9iawCjXISTz3+UYzFIiQ5W4T00R59WNaEOur6Xm9Uway16KuHa1O8CVG1KiC
	 JOE6h7esTLx+/wMPMeKaOiiaXdbmvbmLUCkUMVf92wV5WaLnCOhq+6mA+qpTqtRv5tA==
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=giGxvbkD;
	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 53A2E606A31C;
	Wed, 28 Oct 2026 14:20:17 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 53A2E606A31C
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 1216)
	id 546FC20B7167; Wed, 28 Oct 2026 07:20:00 -0700 (PDT)
X-DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 546FC20B7167
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
	s=default; t=1793197200;
	bh=vpckeDuo02tS2aORCz9pEfJ8ExYYLYf+aGcqhM3+F4c=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=giGxvbkDdKG+hizSabjt1yv8td2qasyDNF1QGUxt0E+/sGoOgdfTevhN6T0qanQTM
	 KiOQcUmxrukoAx+tKzt9z3J8kIazyQ1mhSTQQLMMS3nVJlObBrMV7PCBS9K+VF9AvL
	 npIVZJvmkrFe5GSmugvjZPdiTjspsK48b5FLb7Hw=
X-Cc: haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, pabeni@redhat.com, lkmlabelt@gmail.com,
	parri.andrea@gmail.com, linux-hyperv@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Wei Liu <liuwe@microsoft.com>
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
X-In-Reply-To: <20261027164722.3393397-1-ernis@linux.microsoft.com>