Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: macb: Validate the value of base_time properly

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@gmail.com>
Reviewed-by: Vineeth Karumanchi <vineeth.karumanchi@amd.com>
Link: https://patch.msgid.link/20250901162923.627765-1-chandramohan.explore@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Chandra Mohan Sundar and committed by
Jakub Kicinski
3586018d e2cf2d5b

+1 -1
+1 -1
drivers/net/ethernet/cadence/macb_main.c
··· 4104 4104 return -EINVAL; 4105 4105 } 4106 4106 4107 - if (start_time < 0) { 4107 + if (conf->base_time < 0) { 4108 4108 netdev_err(ndev, "Invalid base_time: must be 0 or positive, got %lld\n", 4109 4109 conf->base_time); 4110 4110 return -ERANGE;