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>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On Mon, May 10, 2004 at 08:07:23AM -0700, Christian S.J. Peron wrote:
+> Modified files:
+> sys/net rtsock.c
+> 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 jails.
+>
+> Currently some processes, like traceroute(8) construct a routing request
+> 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 = PF_INET;
Why not bzero()?
--
Pawel Jakub Dawidek http://www.FreeBSD.org
pjd@FreeBSD.org http://garage.freebsd.pl
FreeBSD committer Am I Evil? Yes, I Am!
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)
iD8DBQFAn6GKForvXbEpPzQRAkgEAKCCLMxgJyyfTVxUEETqiIjhbqArEACfb17X
/dhnmCeUOyntlwpJquJT++M=
=lLYS
-----END PGP SIGNATURE-----
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040510153642.GE24376>
