Go to file
John Glotzer 4c005e3f65 bgpd: memmove needed in community_del_val
In bgpd/bgp_community_del_val memcpy is used for potentially overlapping
regions which is *not* safe. It may "work" in some cases but is not
guaranteed to work in all cases. The case that I saw fail was on an
x86_64 architecture with the number of bytes being moved/copied equal to
8.

The way the code is written the uint32_t pointers will always differ by
1, which is equivalent to a memcpy/memmove of regions that are 4 bytes
away from one another. So the code failed while copying an 8 byte region
to an address that is 4 bytes lower i.e. overlapping regions.

Interestingly, the same architecture had no problems with a 12 byte
copy.

When the code failed the communities were [200,300,400] and a call was
made to delete the 200 community. The result of this was an array that
looked like [400,400] which was uniquified to [400]. Of course the
expected result should have been [300, 400].

One additional point - in our production environment memmove would not
*link* without including <string.h> but in an isolated quagga git repo
this #include does not seem to be required and I see memmove is used in
vtysh.c without this #include either.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2014-08-18 01:52:26 +02:00
babeld lib/command.c: rewrite command matching/parsing 2014-04-01 20:21:41 +02:00
bgpd bgpd: memmove needed in community_del_val 2014-08-18 01:52:26 +02:00
doc *: nuke ^L (page feed) 2014-06-04 06:58:02 +02:00
fpm fpm: Add public header for Forwarding Plane Manager 2012-11-30 21:41:17 +01:00
init build: delete .cvsignore files 2011-12-13 14:27:01 +04:00
isisd *: fix detection and usage of sys/cdefs.h 2014-08-18 01:50:19 +02:00
lib *: fix detection and usage of sys/cdefs.h 2014-08-18 01:50:19 +02:00
m4 build: fix "pragma weak" mixups 2013-02-09 03:00:12 +01:00
ospf6d *: nuke ^L (page feed) 2014-06-04 06:58:02 +02:00
ospfclient *: nuke ^L (page feed) 2014-06-04 06:58:02 +02:00
ospfd *: nuke ^L (page feed) 2014-06-04 06:58:02 +02:00
pkgsrc build: delete .cvsignore files 2011-12-13 14:27:01 +04:00
ports build: delete .cvsignore files 2011-12-13 14:27:01 +04:00
redhat build: update quagga.spec.in 2013-02-23 19:43:18 +01:00
ripd *: nuke ^L (page feed) 2014-06-04 06:58:02 +02:00
ripngd *: nuke ^L (page feed) 2014-06-04 06:58:02 +02:00
solaris build: delete .cvsignore files 2011-12-13 14:27:01 +04:00
tests tests/bgpd: don't hardcode error number (fix f57000c) 2014-08-18 01:49:17 +02:00
tools tools: use standard interpreter path in all Perl scripts 2012-04-30 16:13:47 +02:00
vtysh vtysh: fix build against readline 6.3 2014-05-27 19:55:11 +02:00
watchquagga *: use array_size() helper macro 2012-10-25 10:15:59 -07:00
zebra zebra: fix struct msghdr initializers 2014-08-18 01:50:23 +02:00
.gitignore testzebra: pragma weak: detect systems with weak alias and provide alternative 2013-01-11 21:50:06 +01:00
AUTHORS Initial revision 2002-12-13 20:15:29 +00:00
bootstrap.sh autoreconf -i 2007-02-06 19:28:28 +00:00
buildtest.sh tests: add DejaGNU framework 2013-04-14 16:01:05 +02:00
ChangeLog [trivia] Make 'make dist' happy about ChangeLog expunge 2008-08-23 08:36:42 +01:00
configure.ac build: do not assume glibc on linux 2014-08-18 01:50:26 +02:00
COPYING *: nuke ^L (page feed) 2014-06-04 06:58:02 +02:00
COPYING.LIB *: nuke ^L (page feed) 2014-06-04 06:58:02 +02:00
HACKING.pending HACKING.pending: Add Quagga-RE details 2012-03-02 11:56:38 +00:00
HACKING.tex HACKING.tex: Change to a LaTeX version of HACKING 2012-03-08 16:14:13 +00:00
INSTALL.quagga.txt build: improve backtrace support/detection 2014-04-01 17:20:44 +02:00
Makefile.am build: remove now-useless --{en, dis}able-tests 2014-04-01 17:23:21 +02:00
NEWS doc: update NEWS for 0.99.23 changes 2014-06-24 07:12:01 +02:00
README 2004-11-12 Paul Jakma <paul@dishone.st> 2004-11-12 10:30:21 +00:00
README.NetBSD Omit --opaque-lsa from build (now default). 2011-06-28 15:05:05 -04:00
REPORTING-BUGS Update for git and emphasize asking for good reports. 2010-05-05 07:51:26 -04:00
SERVICES 2607/tcp is already used by ospfapi. 2003-12-23 10:42:45 +00:00
stamp-h.in Initial revision 2002-12-13 20:15:29 +00:00
TODO doc: update TODO for ospf6d work & bgp multipath 2013-04-16 11:56:11 +02:00
update-autotools * README.NetBSD: use update-autotools instead of autoreconf 2007-02-02 16:52:38 +00:00

Quagga is free software that manages various IPv4 and IPv6 routing
protocols.

Currently Quagga supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1,
RIPv2, and RIPng as well as very early support for IS-IS.
  
See the file INSTALL.quagga.txt for building and installation instructions.
  
See the file REPORTING-BUGS to report bugs.
  
Quagga is free software. See the file COPYING for copying conditions.