From owner-freebsd-net@FreeBSD.ORG Tue Mar 23 04:38:35 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 427DC16A4CE for ; Tue, 23 Mar 2004 04:38:35 -0800 (PST) Received: from darkness.comp.waw.pl (unknown [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id E52E143D39 for ; Tue, 23 Mar 2004 04:38:34 -0800 (PST) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id E28BAAC974; Tue, 23 Mar 2004 13:38:31 +0100 (CET) Date: Tue, 23 Mar 2004 13:38:31 +0100 From: Pawel Jakub Dawidek To: freebsd-net@freebsd.org Message-ID: <20040323123831.GM8930@darkness.comp.waw.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Rm5rkB9L8kG9H2n8" Content-Disposition: inline User-Agent: Mutt/1.4.2i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 5.2.1-RC2 i386 Subject: in_pcbbind_setup(), etc. X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2004 12:38:35 -0000 --Rm5rkB9L8kG9H2n8 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hmm. I'm looking at in_pcbbind_setup() and this doesn't looks right in few places. For example: 'td' can be NULL? It is offten tested, but not always, Line 290: if (sin->sin_addr.s_addr !=3D INADDR_ANY) if (prison_ip(td->td_ucred, 0, &sin->sin_addr.s_addr)) return(EINVAL); td_ucred is used, but 'td' is not tested. If this is always current thread, it can't be NULL, right? If this not have to be current thread, we cannot touch td_ucred here, because (from proc.h): [...] * k - only accessed by curthread [...] struct ucred *td_ucred; /* (k) Reference to credentials. */ [...] Not telling that we can just remove this argument if this is always current thread. --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --Rm5rkB9L8kG9H2n8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAYC/HForvXbEpPzQRAgp+AJ4r6LeDODuRxJxYRBQkC1j6N3xQ/wCfZAYl MCqAl8qF5KoTxmM//Vjn3cM= =HL/f -----END PGP SIGNATURE----- --Rm5rkB9L8kG9H2n8--