diff mbox series

[net-next,v3,2/6] net: bridge: Set strict_start_type for br_policy

Message ID 20230905-fdb_limit-v3-2-7597cd500a82@avm.de (mailing list archive)
State New
Headers show
Series bridge: Add a limit on learned FDB entries | expand

Commit Message

Johannes Nixdorf Sept. 5, 2023, 11:47 a.m. UTC
Set any new attributes added to br_policy to be parsed strictly, to
prevent userspace from passing garbage.

Signed-off-by: Johannes Nixdorf <jnixdorf-oss@avm.de>
---
 net/bridge/br_netlink.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 05c5863d2e20..1dc4e1bce740 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -1217,6 +1217,7 @@  static size_t br_port_get_slave_size(const struct net_device *brdev,
 }
 
 static const struct nla_policy br_policy[IFLA_BR_MAX + 1] = {
+	[IFLA_BR_UNSPEC]	= { .strict_start_type = IFLA_BR_MCAST_QUERIER_STATE + 1 },
 	[IFLA_BR_FORWARD_DELAY]	= { .type = NLA_U32 },
 	[IFLA_BR_HELLO_TIME]	= { .type = NLA_U32 },
 	[IFLA_BR_MAX_AGE]	= { .type = NLA_U32 },