* [PATCH iproute2] rt_names: do not write past the end of the name tables
@ 2026-11-24 5:55 Dave Seddon
2026-11-25 0:51 ` Stephen Hemminger
2026-11-27 16:10 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Dave Seddon @ 2026-11-24 5:55 UTC (permalink / raw)
To: netdev; +Cc: Dave Seddon, Stephen Hemminger, David Ahern
rtnl_tab_initialize() accepts id == size, so an id of 256 in rt_protos,
rt_scopes, rt_realms, rt_dsfield or rt_addrprotos writes one entry past
the 256-entry table. Use >=.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Dave Seddon <dave.seddon.ca@gmail.com>
---
lib/rt_names.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/rt_names.c b/lib/rt_names.c
index 3dba9642..97f520ff 100644
--- a/lib/rt_names.c
+++ b/lib/rt_names.c
@@ -115,7 +115,7 @@ static int rtnl_tab_initialize(const char *file, char **tab, int size)
fclose(fp);
return -EINVAL;
}
- if (id < 0 || id > size)
+ if (id < 0 || id >= size)
continue;
tab[id] = strdup(namebuf);
--
2.56.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH iproute2] rt_names: do not write past the end of the name tables
2026-11-24 5:55 [PATCH iproute2] rt_names: do not write past the end of the name tables Dave Seddon
@ 2026-11-25 0:51 ` Stephen Hemminger
2026-11-27 16:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2026-11-25 0:51 UTC (permalink / raw)
To: Dave Seddon; +Cc: netdev, David Ahern
On Mon, 23 Nov 2026 21:55:49 -0800
Dave Seddon <dave.seddon.ca@gmail.com> wrote:
> rtnl_tab_initialize() accepts id == size, so an id of 256 in rt_protos,
> rt_scopes, rt_realms, rt_dsfield or rt_addrprotos writes one entry past
> the 256-entry table. Use >=.
>
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Dave Seddon <dave.seddon.ca@gmail.com>
> ---
Iproute2 follows kernel conventions
and the kernel maintainers decided to drop use of Assisted-by.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH iproute2] rt_names: do not write past the end of the name tables
2026-11-24 5:55 [PATCH iproute2] rt_names: do not write past the end of the name tables Dave Seddon
2026-11-25 0:51 ` Stephen Hemminger
@ 2026-11-27 16:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-11-27 16:10 UTC (permalink / raw)
To: dave seddon; +Cc: netdev, stephen, dsahern
Hello:
This patch was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber.org>:
On Mon, 23 Nov 2026 21:55:49 -0800 you wrote:
> rtnl_tab_initialize() accepts id == size, so an id of 256 in rt_protos,
> rt_scopes, rt_realms, rt_dsfield or rt_addrprotos writes one entry past
> the 256-entry table. Use >=.
>
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Dave Seddon <dave.seddon.ca@gmail.com>
>
> [...]
Here is the summary with links:
- [iproute2] rt_names: do not write past the end of the name tables
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=22f67c8b7332
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] 3+ messages in thread
end of thread, other threads:[~2026-11-27 16:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 5:55 [PATCH iproute2] rt_names: do not write past the end of the name tables Dave Seddon
2026-11-25 0:51 ` Stephen Hemminger
2026-11-27 16:10 ` 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.