* [PATCH] net: dsa: sja1105: fix buffer overflow in sja1105_setup_devlink_regions()
@ 2022-08-17 0:38 Rustam Subkhankulov
2022-08-18 5:20 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Rustam Subkhankulov @ 2022-08-17 0:38 UTC (permalink / raw)
To: Vladimir Oltean
Cc: Rustam Subkhankulov, Andrew Lunn, Vivien Didelot,
Florian Fainelli, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, linux-kernel, netdev, Alexey Khoroshilov,
ldv-project
If an error occurs in dsa_devlink_region_create(), then 'priv->regions'
array will be accessed by negative index '-1'.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Rustam Subkhankulov <subkhankulov@ispras.ru>
Fixes: bf425b82059e ("net: dsa: sja1105: expose static config as devlink region")
---
drivers/net/dsa/sja1105/sja1105_devlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/sja1105/sja1105_devlink.c b/drivers/net/dsa/sja1105/sja1105_devlink.c
index 0569ff066634..10c6fea1227f 100644
--- a/drivers/net/dsa/sja1105/sja1105_devlink.c
+++ b/drivers/net/dsa/sja1105/sja1105_devlink.c
@@ -93,7 +93,7 @@ static int sja1105_setup_devlink_regions(struct dsa_switch *ds)
region = dsa_devlink_region_create(ds, ops, 1, size);
if (IS_ERR(region)) {
- while (i-- >= 0)
+ while (--i >= 0)
dsa_devlink_region_destroy(priv->regions[i]);
return PTR_ERR(region);
}
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: dsa: sja1105: fix buffer overflow in sja1105_setup_devlink_regions()
2022-08-17 0:38 [PATCH] net: dsa: sja1105: fix buffer overflow in sja1105_setup_devlink_regions() Rustam Subkhankulov
@ 2022-08-18 5:20 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-08-18 5:20 UTC (permalink / raw)
To: Rustam Subkhankulov
Cc: olteanv, andrew, vivien.didelot, f.fainelli, davem, edumazet,
kuba, pabeni, linux-kernel, netdev, khoroshilov, ldv-project
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 17 Aug 2022 03:38:45 +0300 you wrote:
> If an error occurs in dsa_devlink_region_create(), then 'priv->regions'
> array will be accessed by negative index '-1'.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Rustam Subkhankulov <subkhankulov@ispras.ru>
> Fixes: bf425b82059e ("net: dsa: sja1105: expose static config as devlink region")
>
> [...]
Here is the summary with links:
- net: dsa: sja1105: fix buffer overflow in sja1105_setup_devlink_regions()
https://git.kernel.org/netdev/net/c/fd8e899cdb5e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-18 5:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-17 0:38 [PATCH] net: dsa: sja1105: fix buffer overflow in sja1105_setup_devlink_regions() Rustam Subkhankulov
2022-08-18 5:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).