From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: high_memory address in /proc/dri/*/vma Date: Tue, 20 Dec 2011 17:32:13 +0100 Message-ID: <20111220163213.GB3883@phenom.ffwll.local> References: <20111220000939.GB20752@decadent.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ww0-f41.google.com (mail-ww0-f41.google.com [74.125.82.41]) by gabe.freedesktop.org (Postfix) with ESMTP id 66DC29ED67 for ; Tue, 20 Dec 2011 08:30:30 -0800 (PST) Received: by wgbdt12 with SMTP id dt12so10372789wgb.0 for ; Tue, 20 Dec 2011 08:30:29 -0800 (PST) Content-Disposition: inline In-Reply-To: <20111220000939.GB20752@decadent.org.uk> 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: Ben Hutchings Cc: Dave Airlie , Kees Cook , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Tue, Dec 20, 2011 at 12:09:39AM +0000, Ben Hutchings wrote: > [Re-sent to the right address, I hope.] > > 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 = %p, 0x%08llx\n", > + seq_printf(m, "vma use count: %d, high_memory = %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). > > 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 != 0 but that > is always true at the moment. Afaik (and I've done quite some code history checking) the proc files are not relied upon by userspace (up to about 10 years back). Patch to kill them all is pending and should hit either 3.3 or 3.4. -Daniel -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48