From: Radek =?ISO-8859-1?Q?Vok=E1l?= Date: Fri, 07 Oct 2005 05:31:32 +0000 Subject: Re: [LARTC] buffer overflow in ip Message-Id: <1128663092.9501.1.camel@localhost.localdomain> MIME-Version: 1 Content-Type: multipart/mixed; boundary="===============1440275865==" List-Id: References: <1128605841.30878.23.camel@localhost.localdomain> In-Reply-To: <1128605841.30878.23.camel@localhost.localdomain> To: lartc@vger.kernel.org --===============1440275865== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-ZjkHcxwxy7XJaAV6sfaG" --=-ZjkHcxwxy7XJaAV6sfaG Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable This patch fixes the problem --- iproute2-ss050901/ip/iproute.c~ 2005-09-01 14:21:50.000000000 -0500 +++ iproute2-ss050901/ip/iproute.c 2005-10-06 21:30:36.000000000 -0500 @@ -216,13 +216,13 @@ int print_route(const struct sockaddr_nl memset(&via, 0, sizeof(via)); via.family =3D r->rtm_family; if (tb[RTA_GATEWAY]) - memcpy(&via.data, RTA_DATA(tb[RTA_GATEWAY]), host_len); + memcpy(&via.data, RTA_DATA(tb[RTA_GATEWAY]), host_len/8); } if (filter.rprefsrc.bitlen>0) { memset(&prefsrc, 0, sizeof(prefsrc)); prefsrc.family =3D r->rtm_family; if (tb[RTA_PREFSRC]) - memcpy(&prefsrc.data, RTA_DATA(tb[RTA_PREFSRC]), host_len); + memcpy(&prefsrc.data, RTA_DATA(tb[RTA_PREFSRC]), host_len/8); } =20 if (filter.rdst.family && inet_addr_match(&dst, &filter.rdst, filter.rdst= .bitlen)) host_len should be divided by 8, as it's units is bits, where memcpy is usi= ng bytes units. On Thu, 2005-10-06 at 15:37 +0200, Radek Vok=C3=A1l wrote: > This comse from iproute-ss050901, rebuilt on FC4 with -fortify-source > option. Seems like ip has a buffer overflow which sometimes causes a > segfault..=20 >=20 > will try to look at it tmrw, so far here's my gdb output.=20 --=20 Radek Vok=C3=A1l --=-ZjkHcxwxy7XJaAV6sfaG Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBDRgg0pPtjDwJDWJMRAiB8AKDknPUGfIQBqGy13uKCVuFgK/+jfwCcDht3 MhMCqo4vuM6bbVDTMJGe19g= =hiZO -----END PGP SIGNATURE----- --=-ZjkHcxwxy7XJaAV6sfaG-- --===============1440275865== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc --===============1440275865==--