Date: Mon, 7 Jun 2004 13:45:05 +0200 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net> Cc: FreeBSD current mailing list <current@freebsd.org> Subject: Re: vfs_syscalls / fhstatfs / suser() Message-ID: <20040607114505.GQ12007@darkness.comp.waw.pl> In-Reply-To: <Pine.BSF.4.53.0406061932520.62813@e0-0.zab2.int.zabbadoz.net> References: <Pine.BSF.4.53.0406061932520.62813@e0-0.zab2.int.zabbadoz.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--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/--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040607114505.GQ12007>
