[Pkg-vsquare-devel] Bug#484295: [patch] vde2: vde_switch segfaults on vlan related CLI commands on AMD64

Bjørn Mork bjorn at mork.no
Wed Jun 4 12:00:34 UTC 2008


tags 484295 patch
thanks

Yuckety.  There wasn't much of any NULL pointer checking or anything in
this code.  The segfaults were caused by vlanprintelem() trying to dump
the contents of vlant[vlan].table for non-existing VLANs.  This should
of course never happen, but when it did a simple test for
vlant[vlan].table == NULL could have easily made it into an error
message instead of a segfault.

Well, I'm not going to fix all that now, given that there must be
hundreds of places to add such tests all over the place.

The main reason why everything went wrong on 64bit systems were lots of
type mismatches in bitarray.h.  Among the more serious was BAC_SET using
a signed int as temporary storage for bitarray elemens, causing
interesting effects if you happened to set bit 31, e.g. by creating VLAN
31...

There were also a number of attempts to shift 1 more than 31 bits to the
left, which doesn't really work well.

The attached patch fixes these important parts and stabilizes vde_switch
on my system.  Please consider applying it before lenny is released.

Thanks,
Bjørn

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bitarray.diff
Type: text/x-diff
Size: 2870 bytes
Desc: fixing 64bit issues in bitarray.h
Url : http://lists.alioth.debian.org/pipermail/pkg-vsquare-devel/attachments/20080604/df041d52/attachment.diff 


More information about the Pkg-vsquare-devel mailing list