[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1968814b-3f1e-436b-8ecd-e885be324ba6@amd.com>
Date: Tue, 2 Sep 2025 14:21:58 +0530
From: "Karumanchi, Vineeth" <vineeth@....com>
To: Chandra Mohan Sundar <chandramohan.explore@...il.com>,
nicolas.ferre@...rochip.com, claudiu.beznea@...on.dev,
andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, netdev@...r.kernel.org, shuah@...nel.org
Cc: linux-kernel-mentees@...ts.linux.dev
Subject: Re: [PATCH net-next] net: macb: Validate the value of base_time
properly
On 9/1/2025 9:59 PM, Chandra Mohan Sundar wrote:
> In macb_taprio_setup_replace(), the value of start_time is being
> compared against zero which would never be true since start_time
> is an unsigned value. Due to this there is a chance that an
> incorrect config base time value can be used for computation.
>
> Fix by checking the value of conf->base_time directly.
> This issue was reported by static coverity analyzer.
>
> Fixes: 89934dbf169e3 ("net: macb: Add TAPRIO traffic scheduling support")
> Signed-off-by: Chandra Mohan Sundar <chandramohan.explore@...il.com>
Reviewed-by: Vineeth Karumanchi <vineeth.karumanchi@....com>
> ---
> drivers/net/ethernet/cadence/macb_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 290d67da704d..e9b262a0223f 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -4104,7 +4104,7 @@ static int macb_taprio_setup_replace(struct net_device *ndev,
> return -EINVAL;
> }
>
> - if (start_time < 0) {
> + if (conf->base_time < 0) {
> netdev_err(ndev, "Invalid base_time: must be 0 or positive, got %lld\n",
> conf->base_time);
> return -ERANGE;
--
🙏 Vineeth
Powered by blists - more mailing lists