Skip to contentSkip to conversation

: Add missing link netlink attribute policy definitions

RTNL Applied Thomas Graf 2 participants 2 messages Feb 20, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

IFLA_LINK is no longer a write-only attribute on the kernel side and must thus be validated. Same goes for the newly introduced IFLA_LINKINFO.

Fixes undefined behaviour if either of the attributes are not well formed.

net/core/rtnetlink.c +2 -0
Index: net-2.6.26/net/core/rtnetlink.c
===================================================================
@@ -693,10 +693,12 @@
 	[IFLA_BROADCAST]	= { .type = NLA_BINARY, .len = MAX_ADDR_LEN },
 	[IFLA_MAP]		= { .len = sizeof(struct rtnl_link_ifmap) },
 	[IFLA_MTU]		= { .type = NLA_U32 },
+	[IFLA_LINK]		= { .type = NLA_U32 },
 	[IFLA_TXQLEN]		= { .type = NLA_U32 },
 	[IFLA_WEIGHT]		= { .type = NLA_U32 },
 	[IFLA_OPERSTATE]	= { .type = NLA_U8 },
 	[IFLA_LINKMODE]		= { .type = NLA_U8 },
+	[IFLA_LINKINFO]		= { .type = NLA_NESTED },
 	[IFLA_NET_NS_PID]	= { .type = NLA_U32 },
 };