Go to file
Doug VanLeuven a05df8fd27 zebra: kernel_socket: fix overflow in RTA_ADDR & RTA_ATTR
In zebra/kernel_socket.c, copying sockaddr from *_msghdr:

There are really 2 different lengths that need to be determined.
  1) the length required to point to the next sockaddr in the mesg
     buffer which might include any required padding and
  2) the actual length of the sockaddr data that needs to be copied
     into the destination field.
They may or may not be the same value.

Sizeof sockaddr_in6 is 28, which to pad for alignment purposes on 32
bit systems with a long of 4 bytes is evenly divided and requires
no padding. On 64 bit systems, with a long of 8 it is padded with 4
extra bytes.So the current RTA_* macros are copying 32 bytes into a 28
byte field on 64 bitsystems, where the field overflow did not occur
on the 32 bit systems.

Since using sa_len required the use of an #ifdef which couldn't be used
directly inside a #define, it made sense to move the copy into the
function to allow typdef checking throughout and eliminate the hack
to suppress compiler warnings.

Fixed declaration of cp in ifm_read after compiler noticed type mismatch.

Tested on 64bit OS X 10.7, FreeBSD 9.0 amd64 & i386 (32bit)
using gcc & clang

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-11-05 11:12:08 -05:00
babeld *: use array_size() helper macro 2012-10-25 10:15:59 -07:00
bgpd bgpd: CVE-2012-1820, DoS in bgp_capability_orf() 2012-11-01 23:07:15 -07:00
doc doc: update installation instructions 2012-11-03 11:21:31 -07:00
guile build: allow configure and build in a separate directory 2012-06-25 19:03:23 +02:00
init build: delete .cvsignore files 2011-12-13 14:27:01 +04:00
isisd *: use array_size() helper macro 2012-10-25 10:15:59 -07:00
lib lib: treat OSX as BSD for IP_HDRINCL (BZ#739) 2012-11-01 22:58:36 -07:00
m4 build: delete .cvsignore files 2011-12-13 14:27:01 +04:00
ospf6d *: use array_size() helper macro 2012-10-25 10:15:59 -07:00
ospfclient build: correct libtool parameter used within Makefiles 2012-09-25 05:56:00 +02:00
ospfd *: use array_size() helper macro 2012-10-25 10:15:59 -07: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 redhat: add systemd service files 2012-05-01 17:51:26 +02:00
ripd *: use array_size() helper macro 2012-10-25 10:15:59 -07:00
ripngd *: use array_size() helper macro 2012-10-25 10:15:59 -07:00
solaris build: delete .cvsignore files 2011-12-13 14:27:01 +04:00
tests tests: fix missing array_size() include 2012-11-03 09:13:23 -07:00
tools tools: use standard interpreter path in all Perl scripts 2012-04-30 16:13:47 +02:00
vtysh *: use array_size() helper macro 2012-10-25 10:15:59 -07:00
watchquagga *: use array_size() helper macro 2012-10-25 10:15:59 -07:00
zebra zebra: kernel_socket: fix overflow in RTA_ADDR & RTA_ATTR 2012-11-05 11:12:08 -05:00
.gitignore build: ignore mkinstalldirs and texinfo.tex 2010-04-28 20:57:44 -04:00
AUTHORS Initial revision 2002-12-13 20:15:29 +00:00
bootstrap.sh autoreconf -i 2007-02-06 19:28:28 +00:00
ChangeLog [trivia] Make 'make dist' happy about ChangeLog expunge 2008-08-23 08:36:42 +01:00
configure.ac build: compile tests/ by default 2012-11-03 09:51:21 -07:00
COPYING Initial revision 2002-12-13 20:15:29 +00:00
COPYING.LIB Initial revision 2002-12-13 20:15:29 +00: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 delete CVS keywords 2011-09-27 21:34:26 +04:00
Makefile.am build: compile tests/ by default 2012-11-03 09:51:21 -07:00
NEWS release: 0.99.21 2012-05-01 21:43:53 +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 [TODO] Note MED functionality we should implement 2006-03-30 14:36:23 +00: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.