Thread (11 messages) 11 messages, 4 authors, 2023-10-18

Re: [PATCH net-next v5 4/5] net: bridge: Set strict_start_type for br_policy

From: Nikolay Aleksandrov <razor@blackwall.org>
Date: 2023-10-17 09:33:48
Also in: bridge, linux-kselftest, lkml

On 10/16/23 16:27, Johannes Nixdorf wrote:
quoted hunk ↗ jump to hunk
Set any new attributes added to br_policy to be parsed strictly, to
prevent userspace from passing garbage.

Signed-off-by: Johannes Nixdorf <redacted>
---
  net/bridge/br_netlink.c | 2 ++
  1 file changed, 2 insertions(+)
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 0c3cf6e6dea2..5ad4abfcb7ba 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -1229,6 +1229,8 @@ 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_FDB_N_LEARNED },
  	[IFLA_BR_FORWARD_DELAY]	= { .type = NLA_U32 },
  	[IFLA_BR_HELLO_TIME]	= { .type = NLA_U32 },
  	[IFLA_BR_MAX_AGE]	= { .type = NLA_U32 },
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help