* [PATCH] net: vrf: do not allow table id 0
@ 2017-01-10 23:22 David Ahern
2017-01-11 15:04 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: David Ahern @ 2017-01-10 23:22 UTC (permalink / raw)
To: netdev; +Cc: frank.kellermann, David Ahern
Frank reported that vrf devices can be created with a table id of 0.
This breaks many of the run time table id checks and should not be
allowed. Detect this condition at create time and fail with EINVAL.
Fixes: 193125dbd8eb ("net: Introduce VRF device driver")
Reported-by: Frank Kellermann <frank.kellermann@atos.net>
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
---
drivers/net/vrf.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 0a067708aa39..454f907d419a 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -1252,6 +1252,8 @@ static int vrf_newlink(struct net *src_net, struct net_device *dev,
return -EINVAL;
vrf->tb_id = nla_get_u32(data[IFLA_VRF_TABLE]);
+ if (vrf->tb_id == RT_TABLE_UNSPEC)
+ return -EINVAL;
dev->priv_flags |= IFF_L3MDEV_MASTER;
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: vrf: do not allow table id 0
2017-01-10 23:22 [PATCH] net: vrf: do not allow table id 0 David Ahern
@ 2017-01-11 15:04 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-01-11 15:04 UTC (permalink / raw)
To: dsa; +Cc: netdev, frank.kellermann
From: David Ahern <dsa@cumulusnetworks.com>
Date: Tue, 10 Jan 2017 15:22:25 -0800
> Frank reported that vrf devices can be created with a table id of 0.
> This breaks many of the run time table id checks and should not be
> allowed. Detect this condition at create time and fail with EINVAL.
>
> Fixes: 193125dbd8eb ("net: Introduce VRF device driver")
> Reported-by: Frank Kellermann <frank.kellermann@atos.net>
> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Applied and queued up for -stable, thanks David.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-11 15:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-10 23:22 [PATCH] net: vrf: do not allow table id 0 David Ahern
2017-01-11 15:04 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.