看板FB_security
标 题Re: md(4) (swap-base) disks not cleaned on creation
发信站NCTU CS FreeBSD Server (Wed Nov 7 23:47:01 2012)
转信站ptt!csnews.cs.nctu!news.cs.nctu!.cs.nctucs.nctu!.org!ownorg!owner-free
--jmbcokH0GrqI2Ucc
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Wed, Nov 07, 2012 at 01:36:55PM +0100, Dag-Erling Sm??rgrav wrote:
> Konstantin Belousov <[email protected]> writes:
> > It is definitely not a security issue.
>=20
> I disagree. There may be legitimate reasons for root to create an md
> and give read access to an unprivileged user, under the assumption that
> it is zeroed; or to allow root in a jail to create mds.
I disagree, but lets this settle. I will commit a fix today.
>=20
> DES
> --=20
> Dag-Erling Sm??rgrav - [email protected]
>=20
> > That said, the following patch should fix the nit. I am unsure about
> > it, because it fixes mostly non-issue by spending CPU time to zero a
> > page which would be either zeroed or overwritten right now anyway in
> > normal usage.
>=20
> You can at least partly mitigate this by adding VM_ALLOC_ZERO to the
> flags passed to vm_page_grab() on line 666 and then checking the PG_ZERO
> bit in m->flags.
This is worse, since now you deprive the zero pool even for the case
when the page is successfully read from the swap later. My patch only
zeroes pages which do not have any content to fill.
--jmbcokH0GrqI2Ucc
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)
iEYEARECAAYFAlCaZlQACgkQC3+MBN1Mb4hN+wCgtePtQOrIyjlSRxa5ZEeC4UlT
cowAoIlDN7Fkt7oZzbco+TvwsERBtvtM
=F0UV
-----END PGP SIGNATURE-----
--jmbcokH0GrqI2Ucc--