From owner-freebsd-current@FreeBSD.ORG Mon Jun 7 11:45:08 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 12DA916A4CE; Mon, 7 Jun 2004 11:45:08 +0000 (GMT) Received: from darkness.comp.waw.pl (darkness.comp.waw.pl [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id B3F7C43D46; Mon, 7 Jun 2004 11:45:07 +0000 (GMT) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id B128DACAE6; Mon, 7 Jun 2004 13:45:05 +0200 (CEST) Date: Mon, 7 Jun 2004 13:45:05 +0200 From: Pawel Jakub Dawidek To: "Bjoern A. Zeeb" Message-ID: <20040607114505.GQ12007@darkness.comp.waw.pl> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3gk1bTGVZuaU9V5/" Content-Disposition: inline In-Reply-To: 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 cc: alfred@freebsd.org cc: FreeBSD current mailing list Subject: Re: vfs_syscalls / fhstatfs / suser() X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2004 11:45:08 -0000 --3gk1bTGVZuaU9V5/ Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 06, 2004 at 07:38:14PM +0000, Bjoern A. Zeeb wrote: +> Hi, +>=20 +> if I am not wrong the part removed by the atatched diff is not +> needed because at the very beginning of the function there is a +>=20 +> error =3D suser(td); +> if (error) +> return (error); +>=20 +> so a second check should never become true again (if threads cannot be +> move in and out of jails). +>=20 +> please correct me if I am wrong. +>=20 +>=20 +> --- ./vfs_syscalls.c.orig Sun Jun 6 19:32:23 2004 +> +++ ./vfs_syscalls.c Sun Jun 6 19:33:12 2004 +> @@ -4128,11 +4128,6 @@ fhstatfs(td, uap) +> sp->f_flags =3D mp->mnt_flag & MNT_VISFLAGMASK; +> if ((error =3D VFS_STATFS(mp, sp, td)) !=3D 0) +> return (error); +> - if (suser(td)) { +> - bcopy(sp, &sb, sizeof(sb)); +> - sb.f_fsid.val[0] =3D sb.f_fsid.val[1] =3D 0; +> - sp =3D &sb; +> - } +> return (copyout(sp, uap->buf, sizeof(*sp))); +> } I'm not sure what the intention was, but I think we should probably change first suser() to suser_cred(td->td_ucred, PRISON_ROOT) as leave second one. PS. I'm CCing this to alfred@ who bring it from NetBSD. --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --3gk1bTGVZuaU9V5/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAxFVBForvXbEpPzQRAslhAKCZQ5Hw8y3s+yTSMTmN9snpY/fgmQCgpckH lFlK/aj1iN2Oojucd+u+DhM= =4aNv -----END PGP SIGNATURE----- --3gk1bTGVZuaU9V5/--