From: Ben Hutchings Subject: Re: high_memory address in /proc/dri/*/vma Date: Tue, 20 Dec 2011 04:23:19 +0000 Message-ID: <1324354999.2844.127.camel@deadeye> References: <20111220000939.GB20752@decadent.org.uk> <1324347501.2844.111.camel@deadeye> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1277074722==" Return-path: Received: from shadbolt.e.decadent.org.uk (shadbolt.e.decadent.org.uk [88.96.1.126]) by gabe.freedesktop.org (Postfix) with ESMTP id 2872B9E818 for ; Mon, 19 Dec 2011 20:23:34 -0800 (PST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Kees Cook Cc: Dave Airlie , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1277074722== Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-JVJUVu/1kKSduZhhm92q" --=-JVJUVu/1kKSduZhhm92q Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2011-12-19 at 18:35 -0800, Kees Cook wrote: > On Mon, Dec 19, 2011 at 6:18 PM, Ben Hutchings wrot= e: > > On Mon, 2011-12-19 at 16:14 -0800, Kees Cook wrote: > >> On Mon, Dec 19, 2011 at 4:09 PM, Ben Hutchings w= rote: > >> > Kees, in commit 01e2f533a234dc62d16c0d3d4fb9d71cf1ce50c3 ("drm: do n= ot > >> > leak kernel addresses via /proc/dri/*/vma") you changed the logging = of > >> > high_memory: > >> > > >> > - seq_printf(m, "vma use count: %d, high_memory =3D %p, 0x%08l= lx\n", > >> > + seq_printf(m, "vma use count: %d, high_memory =3D %pK, 0x%pK= \n", > >> > atomic_read(&dev->vma_count), > >> > - high_memory, (u64)virt_to_phys(high_memory)); > >> > + high_memory, (void *)virt_to_phys(high_memory)); > >> > > >> > This doesn't make sense because the physical address may be truncate= d > >> > (in theory at least). > >> > >> Leaking even a truncated address is still a problem, IMO. Or do you > >> mean there is some side-effect causing a problem? > > > > I mean that this the conversion to void * can be a narrowing conversion= , > > so when printing of kernel pointers is enabled the full physical addres= s > > may not be displayed. >=20 > Ah-ha, okay, I see what you mean now. This is, as you say, only a > problem "in theory". Is it worth fixing currently? I don't know. > If so, we probably need to add the "K" option to %x in some fashion. Something like that, yes. Ben. --=20 Ben Hutchings Humans are not rational beings; they are rationalising beings. --=-JVJUVu/1kKSduZhhm92q Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIVAwUATvANt+e/yOyVhhEJAQqRgRAApMeE7O3JOZWDdo6zf8bSqIzeDWVXwttx B0c7pI723j0Ymcy8bAQaM6POxZA8uZAW4l6GVs5qk8rf6l4AJpXs4FQJfxUJlOR9 vSsSehnyocHDz9zDxJtMyLSsirCxvEPZE3TJcsnbi/WTO9UHlEAQyjJuUB/XoTL/ APZbeVRSP89RJRCWIoVUf1tRclZ2KnsAGiWVVoaDI74coUanwEJhP7UaDE5gecTS OUG4gLnT+oxsANVZhgWUBlMRAHn1B8RSQR/8Ir6PXV3CtQtRqw09HKvXjFC6OZll YXMnW6FnpjF+u8ZjOvsckYaDRsqWt0BpC9WL8tB2VdCePcLGp90d88pGS1ZjJwUc EyXOBLNEz79e3ZEJbweTdxyJHJSNfe7mrwfXaBjXNPx/AyaHsskCTyXnNpxrJfFw bPosaJJ1lXd3YMHE7hNnOs5MaO4qLJSoS5GWPhx0MsMSWCsyeDEaCtVuzMr6FCOR jGQkBT234BRBK2rTuMSbeUaINgBMo3t7EZ71Cte65IPGVwvJgi9sV9h3odOhucwh UgbtvxV3ZBdvJDmjUjpoeGKMR9+5Qt7mLBGAP/x5MUo3St5xwxjwsvOI4GPQ+tKO kJhSmsCN5Y6h6qVnAnyYOfUKS9+ftSYsinqfNlYVm0z4Jx830s7tNdNJc56FhyAR W+k9DyjqK0c= =g4wr -----END PGP SIGNATURE----- --=-JVJUVu/1kKSduZhhm92q-- --===============1277074722== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============1277074722==--