]> git.baikalelectronics.ru Git - kernel.git/commit
drm/r128: Add test for initialisation to all ioctls that require it
authorBen Hutchings <ben@decadent.org.uk>
Sun, 23 Aug 2009 15:59:04 +0000 (16:59 +0100)
committerDave Airlie <airlied@redhat.com>
Sun, 30 Aug 2009 23:09:30 +0000 (09:09 +1000)
commit87909b9eeb0e760e640b5dd0658d508fdc45db16
tree2ec9a70ecad5f7cb94136d53d98d587837f05ef3
parentc22dcbcfde49c29b27e70dd3832fe82d76227d37
drm/r128: Add test for initialisation to all ioctls that require it

Almost all r128's private ioctls require that the CCE state has
already been initialised.  However, most do not test that this has
been done, and will proceed to dereference a null pointer.  This may
result in a security vulnerability, since some ioctls are
unprivileged.

This adds a macro for the common initialisation test and changes all
ioctl implementations that require prior initialisation to use that
macro.

Also, r128_do_init_cce() does not test that the CCE state has not
been initialised already.  Repeated initialisation may lead to a crash
or resource leak.  This adds that test.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/r128/r128_cce.c
drivers/gpu/drm/r128/r128_drv.h
drivers/gpu/drm/r128/r128_state.c