]> git.baikalelectronics.ru Git - kernel.git/commit
drm: Perform ioctl command validation on the stored kernel values
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 12 Apr 2013 09:39:59 +0000 (10:39 +0100)
committerDave Airlie <airlied@redhat.com>
Tue, 16 Apr 2013 03:18:06 +0000 (13:18 +1000)
commita877ded2b00da3c485e9805b29b6e1e0bf42fe68
tree41362cc50b110c7f3e45e4e3a7fdcdd93feee396
parent3547dbd1822228727d744009158bdd15bc36017f
drm: Perform ioctl command validation on the stored kernel values

Userspace is free to pass in any command bits it feels like through the
ioctl cmd, and for example trinity likes to fuzz those bits to create
conflicting commands. So instead of relying upon userspace to pass along
the correct IN/OUT flags for the ioctl, use the flags as expected by the
kernel.

This does have a side-effect that NULL pointers can not be substituted
by userspace in place of a struct. This feature was not being used by
any driver, but instead exposed all of the command handlers to a user
triggerable OOPS.

Reported-by: Tommi Rantala <tt.rantala@gmail.com>
Link: http://lkml.kernel.org/r/CA+ydwtpuBvbwxbt-tdgPUvj1EU7itmCHo_2B3w13HkD5+jWKow@mail.gmail.com
Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_drv.c