πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #3578

Re: [PATCH net-next v2 2/7] um: vector: honor virtio net hdr conversion failures

#3578
From: Johannes Berg
Date: Thu, 15 Oct 2026 12:47
40 lines
7892 bytes
On Thu, 2026-10-15 at 08:41 -0400, Michael S. Tsirkin wrote:
> virtio_net_hdr_to_skb() refuses packets whose checksum metadata
> it cannot make sense of, but the vector raw transport ignored
> its return value: rejected packets went on into the stack with
> their metadata unvalidated.
> 
> Propagate the failure.
> 
> Assisted-by: LLM
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  arch/um/drivers/vector_transports.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/um/drivers/vector_transports.c b/arch/um/drivers/vector_transports.c
> index e1fb2a76fdff..8b7548458663 100644
> --- a/arch/um/drivers/vector_transports.c
> +++ b/arch/um/drivers/vector_transports.c
> @@ -210,7 +210,9 @@ static int raw_verify_header(
>  		return 1;
>  
>  	skb_set_network_header(skb, ETH_HLEN);
> -	virtio_net_hdr_to_skb(skb, vheader, virtio_legacy_is_little_endian());
> +	if (virtio_net_hdr_to_skb(skb, vheader,
> +			virtio_legacy_is_little_endian()) < 0)
> +		return -1;
>  	return 0;
> 

Seems it'd be simpler to just

	return virtio_net_hdr_to_skb(...);

As far as I can tell, the function only returns -EINVAL or 0 (never a
positive value), and the caller only cares about negative (error) or
positive (no checksum needed), so that'd be equivalent?

johannes
Technical Details
Message-ID: <8420ba1fe84fc7d105825026802d4ad10d44af71.camel@sipsolutions.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-346739-linux-kernel-netdev=dewy.ru
References: <cover.1792067836.git.mst@redhat.com> <6716834884238de0ab1ab313004044122aa2adbf.1792067836.git.mst@redhat.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-346739-linux-kernel-netdev=dewy.ru
From: johannes@sipsolutions.net (Johannes Berg)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 2/7] um: vector: honor virtio net hdr
 conversion failures
Date: Thu, 15 Oct 2026 14:47:01 +0200
Organization: Usenet Network
Message-ID: <8420ba1fe84fc7d105825026802d4ad10d44af71.camel@sipsolutions.net>
References: <cover.1792067836.git.mst@redhat.com>
	 <6716834884238de0ab1ab313004044122aa2adbf.1792067836.git.mst@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="2533525"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:kp1dlw0W/s6O16PzG2UgskeDxPY= sha256:nqXCLvVbVG3e4ZI5XyLklkzr9l002i8b+j3GFdyFaRQ=
	sha1:/h/qycqadqG/fnxUQRkp3L0a/fk= sha256:SoQgxBV77UzUH/QsAHg1okT0194upLlfX3ooA0ZGgyk=
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 7FC2E110300; Thu, 15 Oct 2026 16:00:44 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.75
X-Spam-Status: No, score=-0.75 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=sipsolutions.net
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 UH2G9XsS3VYy;
	Thu, 15 Oct 2026 16:00:42 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-346739-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=permerror header.from=sipsolutions.net
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 61AD71102F5; Thu, 15 Oct 2026 16:00:33 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sin.lore.kernel.org (Postfix) with ESMTP id 8C6EF34C50; Thu, 15 Oct 2026 12:47:25 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C393522693;
	Thu, 15 Oct 2026 12:47:16 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="TDpuDTk9"
X-Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16])
	(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 4F4B051812D;
	Thu, 15 Oct 2026 12:47:13 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1792068436; cv=none; b=aWx5dlfAXKGllvezlIa1tDGNyWj87qGV1vgjmZxRVNkrhq1QLE5YTrhvdL4qmesjuFjWTM9fDRAXkgMqPSTvku+QpsNJkKtkqauAGIEsHDV2TH5xxvzRXJdIkiH8reVInkiAXzY6JMs77ihCPgJMKF3ZMJU29hsODq06YsHvRQI=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1792068436; c=relaxed/simple;
	bh=2GjxL018+S0bBWJ3yt4EvK7GDpzkncbRDHcSopY91xA=;
	h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References:
	 Content-Type:MIME-Version; b=NfhOZ2LVFSZWGEHdDE9xSVdNKo4iSwot4emihlErebkh9KJ53FYECUDRtpaafLFXmwOkJb2DUwOlKNMkGfYgPLNOWZNf8szsHpdSYQbVqBFz5U3fftpPqCFroDRsK6g8zzlz/00vblG6wti8o2iXFmadmKkSa4Jqap7SsaVr24Y=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=permerror header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=TDpuDTk9; arc=none smtp.client-ip=168.119.38.16
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=permerror header.from=sipsolutions.net
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net
X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding:
	Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender
	:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To:
	Resent-Cc:Resent-Message-ID; bh=5t7ujz0LRKmYSDnSpxRV4FUu+VgcIx5vzGaUrJmUsOs=;
	t=1792068434; x=1793278034; b=TDpuDTk9Qeh0C8t/h1N/f5hzpRDVJIpwmb8hqpEzi9jZ2aP
	B96gjIXsc91vmuMw4VBkpdrMa0hbyK6Ju/KZdgt84UeE1dq0FysXcR+mXxhPsGgL6F1a0MwLG/yZc
	cg4ki63X7P5A9CKC5DJy2xRvLOakkg9VMI5vs+FnCrB/mN/U+yYss1U5DlpIB0Zhjb3TlXQ6rri5M
	4YQ5+PnlrPQXhIkpsraOPv20+pRSnZs45avKBGjag3ZHqZ2TbiNqeUD55Fo5BqNk/hbPMGlTyIhZs
	w75t2TGikbKQWTPjmNBgQC4jj+Fe5hVOzgkTpKjiM+vLAv7rTPiz1tDSRHd3AB1Q==;
X-Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__ECDSA_SECP256R1_SHA256__AES_256_GCM:256)
	(Exim 4.98.2)
	(envelope-from <johannes@sipsolutions.net>)
	id 1xHKrO-00000003auM-2yCv;
	Thu, 15 Oct 2026 14:47:03 +0200
X-Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>, Jason Wang	
 <jasowangio@gmail.com>, Eugenio PΓ©rez
 <eperezma@redhat.com>,  Xuan Zhuo <xuanzhuo@linux.alibaba.com>, Andrew Lunn
 <andrew+netdev@lunn.ch>, "David S. Miller"	 <davem@davemloft.net>, Eric
 Dumazet <edumazet@kernel.org>, Jakub Kicinski	 <kuba@kernel.org>, Paolo
 Abeni <pabeni@redhat.com>, netdev@vger.kernel.org, 
	virtualization@lists.linux.dev, Rusty Russell <rusty@rustcorp.com.au>, Max
 Krasnyansky <maxk@qualcomm.com>, Richard Weinberger <richard@nod.at>, Anton
 Ivanov	 <anton.ivanov@cambridgegreys.com>, linux-um@lists.infradead.org
X-In-Reply-To: <6716834884238de0ab1ab313004044122aa2adbf.1792067836.git.mst@redhat.com>
X-User-Agent: Evolution 3.60.2 (3.60.2-2.fc44) 
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-malware-bazaar: not-scanned