Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by Dave Seddon
Mon, 09 Nov 2026 23:23
[PATCH iproute2] libnetlink: zero padding in addattr_l()
Author: Dave Seddon
Date: Mon, 09 Nov 2026 23:23
Date: Mon, 09 Nov 2026 23:23
28 lines
11369 bytes
11369 bytes
addattr_l() leaves up to three alignment bytes unchanged. Zero them in the helper so padding does not depend on the caller's buffer contents, matching addraw_l() and rta_addattr_l(). Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Dave Seddon <dave.seddon.ca@gmail.com> --- Follow-up offered in the rta_addattr_l() v2 notes: https://lore.kernel.org/netdev/20261109164116.2637408-1-dave.seddon.ca@gmail.com/ lib/libnetlink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libnetlink.c b/lib/libnetlink.c index c4a8e694..23fbf5f1 100644 --- a/lib/libnetlink.c +++ b/lib/libnetlink.c @@ -1414,6 +1414,7 @@ int addattr_l(struct nlmsghdr *n, int maxlen, int type, const void *data, rta->rta_len = len; if (alen) memcpy(RTA_DATA(rta), data, alen); + memset((void *)rta + len, 0, RTA_ALIGN(len) - len); n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(len); return 0; } -- 2.56.0
Re: [PATCH iproute2] libnetlink: zero padding in addattr_l()
Author: patchwork-bot+netdevbpf
Date: Tue, 17 Nov 2026 21:00
Date: Tue, 17 Nov 2026 21:00
24 lines
8523 bytes
8523 bytes
Hello:
This patch was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber.org>:
On Mon, 9 Nov 2026 15:23:54 -0800 you wrote:
> addattr_l() leaves up to three alignment bytes unchanged. Zero them in
> the helper so padding does not depend on the caller's buffer contents,
> matching addraw_l() and rta_addattr_l().
>
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Dave Seddon <dave.seddon.ca@gmail.com>
>
> [...]
Here is the summary with links:
- [iproute2] libnetlink: zero padding in addattr_l()
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=104413f986e9
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads