🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #14125

Re: [PATCH net] tools: ynl: preserve non-ASCII string attribute bytes

#14125
From: Jakub Kicinski
Date: Tue, 10 Nov 2026 18:58
19 lines
8228 bytes
On Tue, 10 Nov 2026 03:39:22 +0000 Jingjing Xu wrote:
> Netlink strings are not restricted to ASCII. 

Not sure where you got that idea.

> A valid non-ASCII interface
> name makes a getlink dump fail with UnicodeDecodeError, and encoding
> such a name for a rename request raises UnicodeEncodeError.
> 
> Use UTF-8 with surrogateescape for both directions. This preserves ASCII
> behavior, handles UTF-8 names and round-trips raw non-UTF-8 bytes that
> Linux also permits in interface names. Do not replace invalid bytes and
> lose the original name.
> 
> Discovered by Codex-assisted code inspection

So you made up a problem and then decided to fix it?
Please don't waste our time :/
Technical Details
Message-ID: <20261110105845.0c9faffb@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360548-linux-kernel-netdev=dewy.ru
References: <20261110033922.49297-1-xujingjing@cmss.chinamobile.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360548-linux-kernel-netdev=dewy.ru
From: kuba@kernel.org (Jakub Kicinski)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] tools: ynl: preserve non-ASCII string attribute
 bytes
Date: Tue, 10 Nov 2026 10:58:45 -0800
Organization: Usenet Network
Message-ID: <20261110105845.0c9faffb@kernel.org>
References: <20261110033922.49297-1-xujingjing@cmss.chinamobile.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="680434"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:jCap7FsdPi9F9sNNWwTQbUSZ4QU= sha256:C4ga7SlEcQ+3+LSUmWrS+bLYdyn12EkMNbx184ynSO8=
	sha1:CLkLBo4Q9hEV3k/LpzIACuJc2dM= sha256:7hOMesMpWc0rKzulz9SIg6kjJVeuGlYBgzC0bRYQ1dI=
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 EB0E4113CD7; Tue, 10 Nov 2026 22:12:16 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	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 (2048-bit key)
	header.d=kernel.org
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 AJ81VpvY17Q5;
	Tue, 10 Nov 2026 22:12:12 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-360548-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 64CF9113CBD; Tue, 10 Nov 2026 22:12:02 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 564E31416F6; Tue, 10 Nov 2026 18:58:50 +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=1794337127;
	b=ko1XhBq9OVx6ENnD5mtOGzP4eTRhKnHRIEmiaZa1Idl/z6fj2VGGTnaCRY1v2yhtrkqC
	 EE4NGpR529OUgPF9O4K97DBAq6xSHi/XgUfW7lob7Q5XaauQ2rvHij+oc3VB/FsUx9sow
	 SdHhTjSfV8A/0gTl1v4WkFVgnZEbuI2z+xiUPzoPg6kolQxonptgQQbrGwZ3drMj4WLpn
	 vhRKpEXkGR0Wlvf313801cvc/KxXDUYYpeVwiABVjYtRc1a/cJTaf/zwBqR9nz2sk7cB1
	 nb2473NJv2o4p7tceWqsVnpG6qnD3XrNLYTp24yMtfEgXSrf8CRXODt4ZfuSZSaET7w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794337127;
	h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc:
	 Subject:Message-ID:In-Reply-To:References:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding;
	bh=wx8uTcdzrb700GDPSg9JhUtReSu8EnQ0VW6OhePS7rQ=;
	b=z6NoivmLBAmzJ4S0+vA1gQQMnbhJKYQIAapmOEvnu36pq84YcKpjq17TqGuPjDflqwZ8
	 J2RHtLHbMSGIDSCtIQGEQIplacCO5mqHcEbAhho9+1r136/qRZn2nvRJQZIropQeMKQcW
	 rEir5Y9ZrdxazydD4OBKmKk7InlFG/ruZkAfRt6uIatD8jnELDPgD2y3uSEfs+Wk9T5Tq
	 pMMr/wffHgQ7xWjGgr1lMbog4jAWM3tQEz2rlts7Mw6OMoRhRhgFupubKMLCjTVmYXBO0
	 KKawb1xQWshMQnUyFlqwFRu1/Bqm2dENdrWosXZ2XaPlHe0K1DBcYEDOWN3MngtRzHg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bPSf6Hc1;
	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 75FEB606A332;
	Tue, 10 Nov 2026 18:58:47 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bPSf6Hc1
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794337126;
	b=RNgrDh1KRDjaK74jrR+5LXooj4UxCu68fevlhqhUto2xIBmuh1m193uV0gmdF9CntccX
	 nBXsdyVDuUm10XpU73Ie2ComfRf8iTOiYKW/EV88nzggWuCKO+0CqULUqF7YmhxbrOIt+
	 gM1URW3x196zTmqwrNFgHfHgL3fSIMFMozoi1er3WQgeDCowahvQduR+gCZPxjNwvzh95
	 QN3AbGm8lN+wEcpeQBNpRADi5Zeb4jsUT+YsFXBHDneBL4xcEMnMCMKle7hoBLJxzaKmm
	 /cWv44rLg7ZQWtmtJ+cQ2hCmHNA9yf6oy7MOEi/V2pAm4Y7Uq09CcKPEZX9lJ7MnTPg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794337126;
	h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID:
	 In-Reply-To:References:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=wx8uTcdzrb700GDPSg9JhUtReSu8EnQ0VW6OhePS7rQ=;
	b=ITuP18TsqSNMrMGio/BgmpHjGW1j89fqnC/AEaQQk6d5U1J3EPn7V/TTGNxrtpDBHfHn
	 qDmmKu/rX8WZVA1LhrtiNl/hh0RSKELCD4wO/2i9++orIK5UCjuzd7fBHGQ3h8h0dpGRc
	 8qmqIqdxJkYFcxJPo3lfimv06OIUMT9t3LxONDNOxJrGo1ijhCncVDn4HXgOW+MtUt1SL
	 XIhOybIA3i09slYzPZv4JbdPwo5G8KtXEXYlQTRM7hF2Tq8Xn6QKvxoVEOUoSL+GEMJha
	 j5O9XWo9ffKGyDpYBCKdMounOGQjmmS/x0mdHghHEIR0XnL1hit0rFSaLutmaam2paA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bPSf6Hc1;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DBF2606A31C
	for <netdev@vger.kernel.org>; Tue, 10 Nov 2026 18:58:46 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEB8A1F008A1;
	Tue, 10 Nov 2026 18:58:45 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794337125;
	bh=wx8uTcdzrb700GDPSg9JhUtReSu8EnQ0VW6OhePS7rQ=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References;
	b=bPSf6Hc11fbNFrGyQb/bK5w1grwZuF7iEuIjtbOEJTO920jx+bK/w9iOxxK5nv3iB
	 cwR+S87d6IMni4aKFQp+PShNw4TJwhJbi27TODthbbPY/mqdDX0+Cjagy+pva1IEgW
	 IMGLGsIgXJ+FRylkCYQtQpASlN+LYtAwUa/qeJJx+jXxC/JseMhZqih/1ZAOSuFAwI
	 6mvZj/UhUOrpMBGaZ7cgdabMM6lNF3I+NNwzik2nr1O99btcwqV32EwjNI1T/Jraob
	 ent4wrBNKx7S30S4mMZRZV2jMqGAHatkD4ACXJ8/A7QobCJ6kisOox5xUe+FIcRwNh
	 X1cQtI1v9Zhcw==
X-Cc: donald.hunter@gmail.com, netdev@vger.kernel.org
X-In-Reply-To: <20261110033922.49297-1-xujingjing@cmss.chinamobile.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