From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Hutchings Subject: Re: high_memory address in /proc/dri/*/vma Date: Tue, 20 Dec 2011 02:18:21 +0000 Message-ID: <1324347501.2844.111.camel@deadeye> References: <20111220000939.GB20752@decadent.org.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1006959430==" 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 B6E939E7CA for ; Mon, 19 Dec 2011 18:18:41 -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 --===============1006959430== Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-yc55GrpfgW8su9AnQfm0" --=-yc55GrpfgW8su9AnQfm0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2011-12-19 at 16:14 -0800, Kees Cook wrote: > On Mon, Dec 19, 2011 at 4:09 PM, Ben Hutchings wrot= e: > > Kees, in commit 01e2f533a234dc62d16c0d3d4fb9d71cf1ce50c3 ("drm: do not > > 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%08llx\= 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 truncated > > (in theory at least). >=20 > 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 address may not be displayed. > > I think it would make more sense to make this entire file readable by > > root only, but I don't know whether anything depends on being able to > > read it. Its existence is conditional on DRM_DEBUG_CODE !=3D 0 but tha= t > > is always true at the moment. >=20 > The kptr_restrict syscall (that controls %pK behavior) has 3 modes, > including one that hides these values even from the root user, so I > would prefer this stays as-is. >=20 > Sorry I'm being dense, but what problem is %pK causing here? I'd be > happy to help get it fixed. The problem is that it is not suitable for printing physical addresses, because they are not pointers. =20 Ben. --=20 Ben Hutchings Humans are not rational beings; they are rationalising beings. --=-yc55GrpfgW8su9AnQfm0 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) iQIVAwUATu/wbee/yOyVhhEJAQrfXQ//TU6BRUfCW+EHnfYjgCOHYxfdrrqI80fP CtGciC0UIkzWEeD2BuGUooZ0nfq1Q0XEzGOdqOr3bX6iDv2ibfwuF/0iMtAnhNQq JN1F6TQaCQJLkwQ9CSdKz4QkqHxfzl3FXV4WUfSDkzvTMTEyNWQptNQoyuA4Z5jg eo87dsmhGvx/Hj36RUVtLTZQiBgGfuQ9oH3lRFSUmUXbre2Ap18FoGsySmtmh19w kti2h83P+lX1D8PjeZg3O8A6bShXcqvHa0D7k0epABbKzw0Vrz0+kS3QXz6C14nF ZEklFGLSq6yjVRx92dbmdnmc6BPeEMtyVgJMH1yBb5DphJxOAv3PgdRg0UbDLlml TqbsqQrFHWAoUnf6bhbD6u2uuvGLOkDFLhjOpIurys+fxuagQU69+Az4ohJ3PBNm /QljIv2KySu3ehVQj4Ytfc0fWrdvJNmRDY6Muiuq+MPxcxXB7pP9b0Y5ICpP5UbH CSwuOPDZ//6CdE9uwIq79/dXMtjlbFohznwHKCGRb3h3ohH2vtNCqJmDZ5aj7BKO IKxEuzvFDjJcStSHsnaigdBaFpM4zjwj6BUOUEYAxy+kEKKryEMUjJT+mQhDLPcL NRSiti6LTyjx1geCInCzGH/DOpL8P4dQLIg2mqWCw17uQh2frMlJSSFd7J6cZr+Q rx7v65xb+UE= =ByNF -----END PGP SIGNATURE----- --=-yc55GrpfgW8su9AnQfm0-- --===============1006959430== 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 --===============1006959430==--