Date: Mon, 10 May 2004 17:36:42 +0200 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: "Christian S.J. Peron" <csjp@FreeBSD.org> Cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/net rtsock.c Message-ID: <20040510153642.GE24376@darkness.comp.waw.pl> In-Reply-To: <200405101507.i4AF7N6L010886@repoman.freebsd.org> References: <200405101507.i4AF7N6L010886@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--+FEWvIKKURwZl3fO Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 10, 2004 at 08:07:23AM -0700, Christian S.J. Peron wrote: +> Modified files: +> sys/net rtsock.c=20 +> Log: +> Zero the un-used portions of the struct sockaddr data before sending +> it back to userspace, so it does not break bind(2) on raw sockets in j= ails. +> =20 +> Currently some processes, like traceroute(8) construct a routing reque= st +> to determine its source address based on the destination. This sockaddr +> data is fed directly to bind(2). When bind calls ifa_ifwithaddr(9) to +> make sure the address exists on the interface, the comparison will +> fail causing bind(2) to return EADDRNOTAVAIL if the data wasnt zero'ed +> before initialization. [...] +> if (jailed(so->so_cred)) { +> + memset(&jail, 0, sizeof(jail)); +> jail.sin_family =3D PF_INET; Why not bzero()? --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --+FEWvIKKURwZl3fO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAn6GKForvXbEpPzQRAkgEAKCCLMxgJyyfTVxUEETqiIjhbqArEACfb17X /dhnmCeUOyntlwpJquJT++M= =lLYS -----END PGP SIGNATURE----- --+FEWvIKKURwZl3fO--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040510153642.GE24376>