agp: fix arbitrary kernel memory writes
commit7f482d63e27696707ac00eb838ed9379f89957b8
authorVasiliy Kulikov <segoon@openwall.com>
Thu, 14 Apr 2011 16:55:16 +0000 (14 20:55 +0400)
committerAndi Kleen <ak@linux.intel.com>
Mon, 1 Aug 2011 20:54:41 +0000 (1 13:54 -0700)
tree42b995f87d66664854623c94864edffd4d4da217
parent399f9eb9c628914fe5f1acef5bb2dd736227597c
agp: fix arbitrary kernel memory writes

[ upstream commit 194b3da873fd334ef183806db751473512af29ce ]

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: Andi Kleen <ak@linux.intel.com>
drivers/char/agp/generic.c