Skip to content

Commit 70e05a9

Browse files
David Aherngregkh
authored andcommitted
net: vrf: do not allow table id 0
[ Upstream commit 24c63bbc18e25d5d8439422aa5fd2d66390b88eb ] 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: 193125d ("net: Introduce VRF device driver") Reported-by: Frank Kellermann <frank.kellermann@atos.net> Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c177d49 commit 70e05a9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/net/vrf.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,8 @@ static int vrf_newlink(struct net *src_net, struct net_device *dev,
925925
return -EINVAL;
926926

927927
vrf->tb_id = nla_get_u32(data[IFLA_VRF_TABLE]);
928+
if (vrf->tb_id == RT_TABLE_UNSPEC)
929+
return -EINVAL;
928930

929931
dev->priv_flags |= IFF_L3MDEV_MASTER;
930932

0 commit comments

Comments
 (0)