Re: [PATCH net] niu: bounds-check phy-type and model VPD strings
From: Jakub Kicinski
Date: Tue Oct 20 2026 - 21:11:15 EST
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@xxxxxxxxx>
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