]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: pse-pd: Fix out of bound for loop
authorKory Maincent <kory.maincent@bootlin.com>
Tue, 15 Oct 2024 13:02:54 +0000 (15:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Nov 2024 01:02:35 +0000 (02:02 +0100)
commit50ea68146d82f34b3ad80d8290ef8222136dedd7
treebe27c9b836c7a1636fa9dbcafb44e2092ace3957
parentd0d7939543a1b3bb93af9a18d258a774daf8f162
net: pse-pd: Fix out of bound for loop

[ Upstream commit f2767a41959e60763949c73ee180e40c686e807e ]

Adjust the loop limit to prevent out-of-bounds access when iterating over
PI structures. The loop should not reach the index pcdev->nr_lines since
we allocate exactly pcdev->nr_lines number of PI structures. This fix
ensures proper bounds are maintained during iterations.

Fixes: 9be9567a7c59 ("net: pse-pd: Add support for PSE PIs")
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
Message-ID: <20241015130255.125508-1-kory.maincent@bootlin.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/pse-pd/pse_core.c