From: Daniel Vetter <daniel@ffwll.ch>
To: Thomas Hellstrom <thellstrom@vmware.com>
Cc: airlied@redhat.com, dri-devel@lists.freedesktop.org,
stable@vger.kernel.org
Subject: Re: [PATCH] drm: Fix authentication kernel crash
Date: Tue, 24 Jan 2012 15:47:43 +0100 [thread overview]
Message-ID: <20120124144743.GE3980@phenom.ffwll.local> (raw)
In-Reply-To: <1327397506-2979-1-git-send-email-thellstrom@vmware.com>
On Tue, Jan 24, 2012 at 10:31:46AM +0100, Thomas Hellstrom wrote:
> If the master tries to authenticate a client using drm_authmagic and
> that client has already closed its drm file descriptor,
> either wilfully or because it was terminated, the
> call to drm_authmagic will dereference a stale pointer into kmalloc'ed memory
> and corrupt it.
>
> Typically this results in a hard system hang.
>
> This patch fixes that problem by removing any authentication tokens
> (struct drm_magic_entry) open for a file descriptor when that file
> descriptor is closed.
>
> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Ok, I've wandered around a bit in this and noticed that the locking is the
usual convoluted disaster. We seem to randomly grab dev->struct_mutex in
the auth and master ioctl, but all the real protect seems to be due to
taking the global mutex in all relevant paths.
I guess I can't volunteer you to clean this up ;-)
Otherwise I couldn't poke a hole into this, so
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ----
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48
next prev parent reply other threads:[~2012-01-24 14:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-24 9:31 [PATCH] drm: Fix authentication kernel crash Thomas Hellstrom
2012-01-24 14:47 ` Daniel Vetter [this message]
2012-01-25 17:26 ` Thomas Hellstrom
2012-01-24 17:12 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2012-01-24 17:54 Thomas Hellstrom
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=20120124144743.GE3980@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=stable@vger.kernel.org \
--cc=thellstrom@vmware.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox