Skip to content

vde_switch crashes if vlan # 0 is removed #23

@guenther-brunthaler

Description

@guenther-brunthaler

In older versions of vde2 the following switch startup configuration worked like a charm:

vlan/create 1 # isolated w/o real network access
vlan/create 2 # access to local samba server
vlan/create 3 # bridged to hypervisor
port/setvlan 1 1
port/setvlan 2 3
port/create 3
port/setvlan 3 2
vlan/remove 0

In other words, I set up 3 new VLANs and then removed the default VLAN # 0.

I did this because this default VLAN seemed to be special in that it was exempt from VLAN filtering and could therefore see all the traffic. I considered that a security risk and therefore deleted the VLAN.

However, current versions of vde_switch crash when adding new ports after VLAN # 0 has been removed.

Core dump analysis shows the crash happens in line 170 of file src/vde_switch/port.c where the expression

ba_set(vlant[0].table,i)

is evaluated with vlant[0].table containing a null pointer.

Suggested course of action: Either the code should check whether vlant[0].table contains a null pointer and then avoid dereferencing it, or removal of VLAN # 0 should be forbidden because then there will not be a null pointer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions