net: mctp: ensure our nlmsg responses are initialised
Jeremy Kerr
maintainerPATCH 1/1 net: mctp: ensure our nlmsg responses are initialised
Syed Faraz Abrar (@farazsth98) from Zellic, and Pumpkin (@u1f383) from DEVCORE Research Team working with Trend Micro Zero Day Initiative report that a RTM_GETNEIGH will return uninitalised data in the pad bytes of the ndmsg data.
Ensure we're initialising the netlink data to zero, in the link, addr and neigh response messages.
--- net/mctp/device.c | 1 + net/mctp/neigh.c | 1 + net/mctp/route.c | 1 + 3 files changed, 3 insertions(+)
net/mctp/device.c +1 -0
@@ -70,6 +70,7 @@ static int mctp_fill_addrinfo(struct sk_buff *skb,return -EMSGSIZE ; hdr =nlmsg_data (nlh); +memset (hdr,0 ,sizeof (*hdr)); hdr->ifa_family =AF_MCTP ; hdr->ifa_prefixlen =0 ; hdr->ifa_flags =0 ;
net/mctp/neigh.c +1 -0
@@ -218,6 +218,7 @@ static int mctp_fill_neigh(struct sk_buff *skb, u32 portid, u32 seq, int event,return -EMSGSIZE ; hdr =nlmsg_data (nlh); +memset (hdr,0 ,sizeof (*hdr)); hdr->ndm_family =AF_MCTP ; hdr->ndm_ifindex = dev->ifindex; hdr->ndm_state =0 ;// TODO other state bits?
net/mctp/route.c +1 -0
@@ -1643,6 +1643,7 @@ static int mctp_fill_rtinfo(struct sk_buff *skb, struct mctp_route *rt,return -EMSGSIZE ; hdr =nlmsg_data (nlh); +memset (hdr,0 ,sizeof (*hdr)); hdr->rtm_family =AF_MCTP ;/* we use the _len fields as a number of EIDs, rather than
---
base-commit: 05f7e89ab9731565d8a62e3b5d1ec206485eeb0b
change-id: 20251205-dev-mctp-nlmsg-69dbefa5df7f
Best regards,
Signature · 1 line
Jeremy Kerr <[email protected]>
Quoted 5 lines · Jeremy Kerr
Syed Faraz Abrar (@farazsth98) from Zellic, and Pumpkin (@u1f383) from DEVCORE Research Team working with Trend Micro Zero Day Initiative report that a
RTM_GETNEIGHwill return uninitalised data in the pad bytes of the ndmsg data.
Quoted 7 lines
Ensure we're initialising the netlink data to zero, in the link, addr and neigh response messages.
Fixes 831119f88781 ("mctp: Add neighbour netlink interface")Fixes 06d2f4c583a7 ("mctp: Add netlink route management")Fixes 583be982d934 ("mctp: Add device handling and netlink interface")Signed-off-by Jeremy Kerr <[email protected]>
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Mon, 09 Feb 2026 15:27:33 +0800 you wrote:
Syed Faraz Abrar (@farazsth98) from Zellic, and Pumpkin (@u1f383) from DEVCORE Research Team working with Trend Micro Zero Day Initiative report that a
RTM_GETNEIGHwill return uninitalised data in the pad bytes of the ndmsg data.Ensure we're initialising the netlink data to zero, in the link, addr and neigh response messages.
[...]
Here is the summary with links:
- [net] net: mctp: ensure our nlmsg responses are initialised
https://git.kernel.org/netdev/net/c/a6a9bc544b67
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html