drm: Validate requested virtual size against allocated fb size
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 26 Mar 2012 20:15:53 +0000 (21:15 +0100)
committerLuis Henriques <luis.henriques@canonical.com>
Mon, 30 Apr 2012 18:15:01 +0000 (19:15 +0100)
commitf3a07982ea3e6770711839f47126a768b2e5c6db
treeb2b820a184abf7a1152658359160c793e539a9c1
parent071ae57b0266ac9fe2ed8b874b4b8983519a7977
drm: Validate requested virtual size against allocated fb size

BugLink: http://bugs.launchpad.net/bugs/981162

commit 62fb376e214d3c1bfdf6fbb77dac162f6da04d7e upstream.

mplayer -vo fbdev tries to create a screen that is twice as tall as the
allocated framebuffer for "doublebuffering". By default, and all in-tree
users, only sufficient memory is allocated and mapped to satisfy the
smallest framebuffer and the virtual size is no larger than the actual.
For these users, we should therefore reject any userspace request to
create a screen that requires a buffer larger than the framebuffer
originally allocated.

References: https://bugs.freedesktop.org/show_bug.cgi?id=38138
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/gpu/drm/drm_fb_helper.c