]> git.ipfire.org Git - thirdparty/linux.git/commit
netlink: add one debug check in nla_nest_end()
authorEric Dumazet <edumazet@google.com>
Tue, 12 May 2026 15:52:44 +0000 (15:52 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 14 May 2026 23:49:26 +0000 (16:49 -0700)
commitff205bf8c55451f95300bceed9779b647205a850
tree466266c1be1485c962f572b081764203a73f373b
parent878492af7d503f4b093ea903173500be00e9cbe7
netlink: add one debug check in nla_nest_end()

Add a DEBUG_NET_WARN_ON_ONCE(diff > U16_MAX)
to warn if the kernel sends corrupted nested attribute
to user space.

Offenders can be converted to nla_nest_end_safe().

Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260512155244.4137851-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/netlink.h