Subject: Re: [PATCH net 1/2] net: dsa: realtek: fix out-of-bounds access

From: Jakub Kicinski <[email-masked]>
Date: Thu, 16 Mar 2023 21:07:36 -0700

On Wed, 15 Mar 2023 14:09:15 +0100 Ahmad Fatoum wrote:
> -	priv = devm_kzalloc(&mdiodev->dev, sizeof(*priv), GFP_KERNEL);
> +	priv = devm_kzalloc(&mdiodev->dev, sizeof(*priv) + var->chip_data_sz, GFP_KERNEL);

size_add() ?
Otherwise some static checker is going to soon send us a patch saying
this can overflow. Let's save ourselves the hassle.