🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #10641

Re: [PATCH net] niu: bounds-check phy-type and model VPD strings

#10641
From: Akshay Ubale
Date: Tue, 03 Nov 2026 21:13
21 lines
11930 bytes
Hi,

Answers to the questions about this patch:

- Discovery: manual code inspection. While reviewing unchecked strcpy()
  calls in the kernel, I found that niu_get_of_props() copies the
  "phy-type" and "model" device-tree properties into fixed-size buffers
  without checking their length. No syzbot report, production report,
  or static analysis tool was involved.

- Triggered: not triggered. This is theoretical, found by code
  inspection. No symptoms were observed. Triggering needs a property
  longer than the destination buffer, which I have not seen reported.

- Hardware: not tested on real hardware. The change was verified with a
  SPARC64 cross-build (gcc 13.3, W=1, no warnings) and a standalone test
  harness for the length-check logic.

Thanks,
Akshay Ubale
Technical Details
Message-ID: <20261103211348.39521-1-akshay.ubale001@gmail.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-355974-linux-kernel-netdev=dewy.ru
References: <179253979539.3290.9924821446681218748@kernel.org>

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-355974-linux-kernel-netdev=dewy.ru
From: akshay.ubale001@gmail.com (Akshay Ubale)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] niu: bounds-check phy-type and model VPD strings
Date: Tue,  3 Nov 2026 22:13:48 +0100
Organization: Usenet Network
Sender: akshayubale.dev@gmail.com (Akshay Ubale)
Message-ID: <20261103211348.39521-1-akshay.ubale001@gmail.com>
References: <179253979539.3290.9924821446681218748@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3262832"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:o2G2Nf4cm0zWv/J1Y1x6oD8RQ7E= sha256:sT4/pfPp8CLc8m0WCDdFqb7JBKZBAwGpFWptNkbp2Z8=
	sha1:E6PJ/rCVHbER61hwWUfdfYo+WpA= sha256:FQOxSpoCvubGamqzCHXsCznKlNklvZwsB3PaMpgBkPk=
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 EB5AA112A0E; Wed,  4 Nov 2026 00:14:15 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 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, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	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=gmail.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 giWRKXnUi-7e;
	Wed,  4 Nov 2026 00:14:13 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-355974-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id E2ED01129A0; Wed,  4 Nov 2026 00:14:03 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 527B521B24; Tue,  3 Nov 2026 21:14:00 +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=1793740439;
	b=rMnNmKYfhjzt3S12KnUs7ijb7Ca3wJmW0tz65pTXMlgEoXJR/P5PTFk+h0mHsVmoVCzY
	 +sTiHt/KnHRo7IiOYR7KfBOGz51tJCSqcuUUwcpYeiTYJMdyn13wOUO/xw6KlYR6JyUt3
	 lavttXDca4htTJcCKan1TgkPBcYInYlO3MFzN7+SweFR/BP2L8hLlHMTbZZMFr+seRXG9
	 O3ylVo1UQsGDZDge5frbbGWXOg/MHvMw/zqDsFPsSutKI0nckVlnnuOVPCfO1yGVd51ub
	 S+jtnKGSytyGZ8G3X/9oUisal0ik4aK8VvEgrVwueUCcswZtx9gcZ7fRvHU7NjG4qZw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793740439;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:Sender:From:To:Cc:Subject:Date:Message-ID:X-Mailer:
	 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=j+CzPDafxCj9fZ8Cq3DLaNwMhYmNWGXJCSroxfgm+X4=;
	b=iDgYqBmbXVxN61DpnETmJe7SEh8FQN4NdBndmvdeM6aAZRqaNJvfe4XBEVHxnn1ofcWM
	 WPziGzVj+2oMRUXojDhH1EQ6M2YYcPkqGo45O+YfF8B6Hu7g8+WpaZ5eA9eHvcwtPlT2h
	 TcDGHK33dFxxH4Y2EFz2JF87EH1nUWF3cMVFRqiwTWOKgM+9/2CWsX94/cdyXx11nE4ku
	 f9JU7K+hwEZnT3nZxeNxg2cEQxF9nBPQ1Z34PZC+1ISvtP5i+xK2xjI5b/HrMBtiwkG+L
	 9Y72R/oKWsh93tWjypyip/tOreIKscDwsx8Qc7CAMO6aLHpkViV7DD+UXwUU1u095ew==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=wTsWmL3Z;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.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 59FBC606A32F;
	Tue,  3 Nov 2026 21:13:59 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=wTsWmL3Z
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.54
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793740433;
	b=TciKzqPO6yxMslSgxvpFszGIOSxrD17QHLssjvwHgJ+Eq1CPlw3UGHXDVhe7Rcw9RuI6
	 0plA87N6nZgzvXiVvaFx2SNa98ewGZ3DEUeyTDz7e1h7NciZnyL/CFYpFxSgUhk/UPtvt
	 R3j+Im+ENx67DxJEWv6QfwmW4S5aiVHRd66psJ/+wQXduclI2mczd1f8uqav0Wdntjd5K
	 AqR+gChdhQGIRBVGEe7a4SsArX72GLbYJDKvtsE2p2mAOwGd8LqCzGeUB1y93RlX3rWkl
	 0jXnHVKsSiJC2tC4gJssITKE3wHardJLNM3X2W1PyIuAK3OLSF5F85R+HRqfzgc/vuA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793740433;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Sender:From:To:Cc:
	 Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Type:Content-Transfer-Encoding;
	bh=j+CzPDafxCj9fZ8Cq3DLaNwMhYmNWGXJCSroxfgm+X4=;
	b=vYMGi2Dyl9wBVoTsEj/d59ccJ6vc8KoirakC+P/GeZfcmHtDs4GVt/fsm19b96jUuT1b
	 XEMr9kkc6jYcU2Wn1RD8wVRn/UuyAmQ0zvEL/uwU48ArXT8kssDYvdAqk+8n1fnYAJz7m
	 uSMHjXUZI7Y+Ah1kR41xjlnR25bOnz8Goabxyp3aVYc3js1aSV2snGBHhAFNbYPu95xEq
	 lSxLvFBnBqLSBG2sAYc5KF4zUuHI3GbJmIrBcrIupwCG0mL58oC8DhpdS8LV6zlu9JyTd
	 LObXYYmqEojRvPJPmSZv0YIeiFeiQsBnc6Ws407078MQkVcIAGw0JBOTFWeYyQHsiUQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=wTsWmL3Z;
	arc=none smtp.remote-ip=209.85.128.54
X-Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2422E606A31B
	for <netdev@vger.kernel.org>; Tue,  3 Nov 2026 21:13:52 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2422E606A31B
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4a5177d78c7so47069105e9.2
        for <netdev@vger.kernel.org>; Tue, 03 Nov 2026 13:13:52 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1793740431; x=1794345231; darn=vger.kernel.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:sender:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=j+CzPDafxCj9fZ8Cq3DLaNwMhYmNWGXJCSroxfgm+X4=;
        b=wTsWmL3ZHIIOBiHw3gbuOC52/IfWm3h6XXc4PQN2CH78Q3UkowvPO5Kog2uQbB7sOq
         CWruA8GaUHCyPy1iczpY4gXbsgHDHpdoCxNHz2JbFS/1n4jzxteldQaZ3u71PlsoeQND
         PCewtlMU7XT+tlfbL30Nkv2LIUQ014c0DZu1qbyG/7zByfMapztddxKoCovFnxHAVKQZ
         LTGQ25H0i7zYbKYdIAZ+QcpMKqpBQFtRSQBL+T857cNAPal4c3mCcw9xJ8nEYGDwanyn
         Tc95G+8jQzNnXB/ikhBOB6ajViTdAczqTH1+v8m9ypBocwyuEbRVCGSegkUM43ZuEk/L
         W+XQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1793740431; x=1794345231;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:sender:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=j+CzPDafxCj9fZ8Cq3DLaNwMhY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QBSn7D526J/o/JNRLHnsMou6gPEIoHPuPjIxO89Ww9bACGPtA
	fYh3AhCTt4YYfeH+//czO9rgGHyvYX9RFzae3PCXMIyUY1MGTZ+v4Rpq/61ErCSMFtSdrlxUBwE
	=
X-Received: by 2002:a05:600c:840e:b0:4a1:813f:2a60 with SMTP id 5b1f17b1804b1-4ac17d168b1mr364511255e9.11.1793740431324;
        Tue, 03 Nov 2026 13:13:51 -0800 (PST)
X-Received: from localhost.localdomain ([2a02:8109:9d9f:2700:6d31:a289:bf62:2372])
        by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4b2ab3ea6a9sm125728205e9.15.2026.11.03.13.13.50
        (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);
        Tue, 03 Nov 2026 13:13:51 -0800 (PST)
X-Cc: netdev@vger.kernel.org,
	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>,
	Simon Horman <horms@kernel.org>,
	Breno Leitao <leitao@debian.org>,
	Kees Cook <kees@kernel.org>,
	Matheos Worku <matheos.worku@sun.com>,
	linux-kernel@vger.kernel.org,
	Akshay Ubale <akshay.ubale001@gmail.com>
X-Mailer: git-send-email 2.53.0
X-In-Reply-To: <179253979539.3290.9924821446681218748@kernel.org>
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