* [PATCH net-next] ptp: ocp: off by in in ptp_ocp_tod_gnss_name()
@ 2022-03-07 14:13 Dan Carpenter
2022-03-07 14:16 ` Richard Cochran
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2022-03-07 14:13 UTC (permalink / raw)
To: Richard Cochran, Vadim Fedorenko
Cc: Jonathan Lemon, David S. Miller, netdev, kernel-janitors
The > ARRAY_SIZE() needs to be >= ARRAY_SIZE() to prevent an out of
bounds access.
Fixes: 9f492c4cb235 ("ptp: ocp: add TOD debug information")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/ptp/ptp_ocp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index 608d1a0eb141..300de2ff5657 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -914,7 +914,7 @@ ptp_ocp_tod_gnss_name(int idx)
"ALL", "COMBINED", "GPS", "GLONASS", "GALILEO", "BEIDOU",
"Unknown"
};
- if (idx > ARRAY_SIZE(gnss_name))
+ if (idx >= ARRAY_SIZE(gnss_name))
idx = ARRAY_SIZE(gnss_name) - 1;
return gnss_name[idx];
}
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] ptp: ocp: off by in in ptp_ocp_tod_gnss_name()
2022-03-07 14:13 [PATCH net-next] ptp: ocp: off by in in ptp_ocp_tod_gnss_name() Dan Carpenter
@ 2022-03-07 14:16 ` Richard Cochran
2022-03-07 17:07 ` Jonathan Lemon
2022-03-07 23:30 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Richard Cochran @ 2022-03-07 14:16 UTC (permalink / raw)
To: Dan Carpenter
Cc: Vadim Fedorenko, Jonathan Lemon, David S. Miller, netdev,
kernel-janitors
On Mon, Mar 07, 2022 at 05:13:18PM +0300, Dan Carpenter wrote:
> The > ARRAY_SIZE() needs to be >= ARRAY_SIZE() to prevent an out of
> bounds access.
>
> Fixes: 9f492c4cb235 ("ptp: ocp: add TOD debug information")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] ptp: ocp: off by in in ptp_ocp_tod_gnss_name()
2022-03-07 14:13 [PATCH net-next] ptp: ocp: off by in in ptp_ocp_tod_gnss_name() Dan Carpenter
2022-03-07 14:16 ` Richard Cochran
@ 2022-03-07 17:07 ` Jonathan Lemon
2022-03-07 23:30 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Jonathan Lemon @ 2022-03-07 17:07 UTC (permalink / raw)
To: Dan Carpenter
Cc: Richard Cochran, Vadim Fedorenko, David S. Miller, netdev,
kernel-janitors
On Mon, Mar 07, 2022 at 05:13:18PM +0300, Dan Carpenter wrote:
> The > ARRAY_SIZE() needs to be >= ARRAY_SIZE() to prevent an out of
> bounds access.
>
> Fixes: 9f492c4cb235 ("ptp: ocp: add TOD debug information")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jonathan Lemon <jonathan.lemon@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] ptp: ocp: off by in in ptp_ocp_tod_gnss_name()
2022-03-07 14:13 [PATCH net-next] ptp: ocp: off by in in ptp_ocp_tod_gnss_name() Dan Carpenter
2022-03-07 14:16 ` Richard Cochran
2022-03-07 17:07 ` Jonathan Lemon
@ 2022-03-07 23:30 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-03-07 23:30 UTC (permalink / raw)
To: Dan Carpenter
Cc: richardcochran, vadfed, jonathan.lemon, davem, netdev, kernel-janitors
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 7 Mar 2022 17:13:18 +0300 you wrote:
> The > ARRAY_SIZE() needs to be >= ARRAY_SIZE() to prevent an out of
> bounds access.
>
> Fixes: 9f492c4cb235 ("ptp: ocp: add TOD debug information")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/ptp/ptp_ocp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [net-next] ptp: ocp: off by in in ptp_ocp_tod_gnss_name()
https://git.kernel.org/netdev/net-next/c/72f00505f2d2
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] 4+ messages in thread
end of thread, other threads:[~2022-03-07 23:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-07 14:13 [PATCH net-next] ptp: ocp: off by in in ptp_ocp_tod_gnss_name() Dan Carpenter
2022-03-07 14:16 ` Richard Cochran
2022-03-07 17:07 ` Jonathan Lemon
2022-03-07 23:30 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.