]> xenbits.xensource.com Git - linux-pvops.git/commit
drm: Fix authentication kernel crash
authorThomas Hellstrom <thellstrom@vmware.com>
Tue, 24 Jan 2012 17:54:21 +0000 (18:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Feb 2012 17:26:50 +0000 (09:26 -0800)
commit26487be3d861e50dcfd4b19199e3c206d3700678
treeefd83a50b4f3228488db0e3c9d595781a28bb9aa
parentbd8f0a46a1d92470b88ae53e8282dc4edf4f0ba9
drm: Fix authentication kernel crash

commit 598781d71119827b454fd75d46f84755bca6f0c6 upstream.

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>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/drm_auth.c
drivers/gpu/drm/drm_fops.c
include/drm/drmP.h