agp: fix arbitrary kernel memory writes
authorVasiliy Kulikov <segoon@openwall.com>
Thu, 14 Apr 2011 16:55:16 +0000 (20:55 +0400)
committerPaolo Pisati <paolo.pisati@canonical.com>
Tue, 31 May 2011 12:20:03 +0000 (14:20 +0200)
commit1734dbded65d3af6d4446d9eabc548daa6fce391
tree96c484af3f12268cd8ead5a72e57cf8b3612f4fc
parentfe36a792e388068c897b64e81f52d01a037830e9
agp: fix arbitrary kernel memory writes

BugLink: http://bugs.launchpad.net/bugs/775809
commit 194b3da873fd334ef183806db751473512af29ce upstream.

pg_start is copied from userspace on AGPIOC_BIND and AGPIOC_UNBIND ioctl
cmds of agp_ioctl() and passed to agpioc_bind_wrap().  As said in the
comment, (pg_start + mem->page_count) may wrap in case of AGPIOC_BIND,
and it is not checked at all in case of AGPIOC_UNBIND.  As a result, user
with sufficient privileges (usually "video" group) may generate either
local DoS or privilege escalation.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/char/agp/generic.c