All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: "Nikula, Jani" <jani.nikula@intel.com>, dri-devel@lists.freedesktop.org
Subject: Re: [BUG] EDID leaks kernel memory
Date: Mon, 13 Aug 2012 16:24:37 +0200	[thread overview]
Message-ID: <CAKMK7uEC8iKFwdv5usfDrgXus_xo2hmEnOgiXEukq=CiqJCjhg@mail.gmail.com> (raw)
In-Reply-To: <20120811165118.GB18957@n2100.arm.linux.org.uk>

On Sat, Aug 11, 2012 at 6:51 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> Hi,
>
> While looking at the kernel DRM code, I've noticed that in many places
> we kmalloc() memory to store the raw EDID information, whether it be
> from a DDC adapter, or loaded from firmware.
>
> Nowhere can I find where this memory is freed.  It seems in several
> places that we assign it into connector->display_info.raw_edid, and
> next time we obtain EDID information, we re-kmalloc and overwrite this
> pointer.
>
> Note that some drivers do kfree() this memory themselves after blindly
> setting connector->display_info.raw_edid to NULL...
>
> Can someone please point me to where this memory is freed?  If not, I'll
> cook up a patch to add some kfree's.

Afaik the right thing is to simply kill the raw_edid pointer and
handle the edid kmalloc simple as some temp storage fully controlled
by the drivers.

I've volunteered Jani from our team to cook up a few patches to handle this.

Yours, Daniel
-- 
Daniel Vetter
daniel.vetter@ffwll.ch - +41 (0) 79 364 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2012-08-13 14:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-11 16:51 [BUG] EDID leaks kernel memory Russell King - ARM Linux
2012-08-13 14:24 ` Daniel Vetter [this message]
2012-08-15  9:32   ` [PATCH 0/4] remove raw_edid, and fix related memory leaks Jani Nikula
2012-08-15  9:32     ` [PATCH 1/4] drm/i915: fix EDID memory leak in SDVO Jani Nikula
2012-08-15 22:45       ` Daniel Vetter
2012-08-15  9:32     ` [PATCH 2/4] drm/ast: fix EDID memory leak Jani Nikula
2012-08-15  9:32     ` [PATCH 3/4] drm/exynos: fix EDID memory leak in HDMI Jani Nikula
2012-08-22  4:21       ` InKi Dae
2012-08-15  9:32     ` [PATCH 4/4] drm: remove the raw_edid field from struct drm_display_info Jani Nikula
2012-08-22  5:18       ` InKi Dae

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKMK7uEC8iKFwdv5usfDrgXus_xo2hmEnOgiXEukq=CiqJCjhg@mail.gmail.com' \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=linux@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.