Article View: linux.kernel.netdev
Article #5811Re: [PATCH net] niu: bounds-check phy-type and model VPD strings
From: Jakub Kicinski
Date: Wed, 21 Oct 2026 01:10
Date: Wed, 21 Oct 2026 01:10
19 lines
8567 bytes
8567 bytes
On Wed, 21 Oct 2026 01:30:07 +0200 Akshay Ubale wrote:
> niu_get_of_props() copies the "phy-type" and "model" device-tree
> properties into fixed-size np->vpd buffers with strcpy(), which does
> not check the property length.
>
> Use the length reported by of_get_property() to reject values that do
> not fit, and copy with strscpy() so the destination is always
> NUL-terminated.
>
> Fixes: a3138df9f20e ("[NIU]: Add Sun Neptune ethernet driver.")
> Fixes: f9af857489cc ("niu: Determine the # of ports from the card's VPD data")
> Signed-off-by: Akshay Ubale <akshay.ubale001@gmail.com>
Please don't sent us low value patches like this during the merge window
When / if you repost make sure you add to the commit message the reply
to the questions asked by the sinfo bot.
--
pw-bot: cr
Technical Details
Message-ID:
<20261020181053.08b47324@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349681-linux-kernel-netdev=dewy.ruReferences:
<20261020233007.71945-1-akshay.ubale001@gmail.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-349681-linux-kernel-netdev=dewy.ru From: kuba@kernel.org (Jakub Kicinski) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net] niu: bounds-check phy-type and model VPD strings Date: Tue, 20 Oct 2026 18:10:53 -0700 Organization: Usenet Network Message-ID: <20261020181053.08b47324@kernel.org> References: <20261020233007.71945-1-akshay.ubale001@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="4008611"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:pg+KSoFMtcXex51jTU/uCIOIi1k= sha256:06/i+o6zMEVQUbUS2LuWQ6x0AuRIK3rEY04ZEVPZevw= sha1:ue/0kZvZz61hhBCQLuWIzDB8m44= sha256:BFlTp1dB1mlrF5H6yB+DrvlRmZz+OWH2IDgOMdWscH4= 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 9E28B110EC6; Wed, 21 Oct 2026 04:11:15 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.729 X-Spam-Status: No, score=-3.729 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.329, 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 iWT9m3aUjVnJ; Wed, 21 Oct 2026 04:11: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-349681-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 22232110E98; Wed, 21 Oct 2026 04:11:01 +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 CDC3D2D63E; Wed, 21 Oct 2026 01:10: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=1792545055; b=HGXm28wiFVQ50Dbmhsv7kjA7xLgLf+a05a/ztHmbILuNuKzueSctIdGiH3xtKMSlk0WV QF7C0LY9uusAlirwuOP1Xt4yxYa7HLLB3cj0ml7CqjvoJRIFPqfiGOysDYGT8pvqsLNOe 3FEWxfWyA4D5ZMZJBku58W/ktnmdrfjPnbCYFYf7wo+9VB7kYKkYDENPPwb5qSzUMS1Zy jLZ27gXnNKFfmfyZ/hO/0dqi6rVKd5IRKo1u211IF+5MsJLYKoOBI7FKVvtJ6CsQt59K0 fHk1+R8LwPwoV8PAALZB64GH/QSEM3acPZHiFEfcDNaavB4pIcVAQckXiJzghCHOv1Q== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792545055; 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=GUJ0w581DHaViS11vjCILvwAHZsNvv+sf1oGp3ltphU=; b=ElzIg8yF4/5FzW5voYB0nXQg2WrU36TRMJT3yGEoeXvHWiuvJjY9gPPonLRzYCi50/2Z pZkPv723hI5x2AiC56nLzLJzTazZwXwmkieMtnXzaplSbEi9FjEtBLRXbOoP+Mi0mcp28 cR+ADBZgYTuKMjT2yGw8TKEkbYFgu5DY3opf1FXRw7natO0EKirWuc6Iw0J154Ws0vsYb Ow8joopVlDhlA2R4yOYBKuIi0K65fgMDz+2MLgIQU8SskKSDXxjM15siXbLwujroN0pGq hEvScpbjByslXNL1NkkoP380usS2Vy1h0QDaQow+JaawmHLvIq38k1Wr/0MYUjxJHng== 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=L6YWbMEe; 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 843B8606A321; Wed, 21 Oct 2026 01:10:55 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=L6YWbMEe 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=1792545054; b=f5UGDh6vAHc0sOiYTmUcbNkoEvABZkJFLxxyMtu3VfjYovx1WGjng+UfZToKM+WV+/Bp 774GBgobW6Bu0xwrei6DTE+vMu/4x+PrJe8I3X31O7T67P4ga6oNLP4Ok6Y9Iz0rLG1eZ dMRAfHxlCfrkX/97HQYGN1PYQ4sdtu5GTsJZPZfsJmAzW7OFd3TdJ0WH174IRunduFqEZ leprspvNsfQuFDa7LZBSKIHVAx8Zp6UFzYwaQ7P6RZeUwN+GN6fByw/gGZ82z2VkE/4Lx 3G036uwVZhBkw4tWBYNvGdTUjxiRnsSPTrq3KJih5WtBJNez6lVTYM2yKvm+iHGrXEg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792545054; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=GUJ0w581DHaViS11vjCILvwAHZsNvv+sf1oGp3ltphU=; b=2CYpCO7HQqrrv6cX0pTc/FvmSgT8b6GQOlx6hJGtdE8BvvteivHSFajwvK4h2tfZ0xKP uncRodMjFAvCutWgHoSSsSxl8J5j1KjBYKT8LCzrmKE0ZD2nOJxeVT91dwQIMQgpaeHMr s8gwRWTcUi5HsLonep/cpfEpuEmn7GN1yATXIqGPM1D9xvhJ0KluIXlBw5ZF06Fu1bSnP ctDhv0FcynAfouD4Uk18sgsHydXn7AO4vypHnky3j+AV6JFsGdhEC92AXN0vCJDu8VLUr QVEZoj++eK8jmUKIYpOEh5KoEiCuP1Wa32lFf4jeI/yoQTW4POQfwvQ3qLw6rmy5m8A== 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=L6YWbMEe; 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 67C83606A319; Wed, 21 Oct 2026 01:10:54 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8B231F000CC; Wed, 21 Oct 2026 01:10:53 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792545054; bh=GUJ0w581DHaViS11vjCILvwAHZsNvv+sf1oGp3ltphU=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=L6YWbMEeowJaGpH9HOT3634uZAhui6LdlVInDVrpAGU10ANvbarCz58LaFrmqdCDF 9GTjkQM44g0p/jOZ/wstTkgmlMUaeu841FY7pJYPQp8dkkhA5TS0OgUg0BF3IuuKV9 tCBARXBSkNMHV8sQsKhr56H/wIPWqlyXnOU+3o0yX66x6EPibqEvXbV8efmFRcS3US RPx1jYRfX7i/u9v8DbaYZveknAJLDFx63PORwWDPxCNHL9MKSXAtWmVJHIcZvw7VtN bYZIpPcmkZSVthTpBoDKFAaFC07D88X7yblWWpGDz9gw4BrbnWxX3V1K3tlSTee9B9 fj5sO9I/6bvzw== X-Cc: netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@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 X-In-Reply-To: <20261020233007.71945-1-akshay.ubale001@gmail.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