drm: fix NULL pointer access by wrong ioctl
authorZhaowei Yuan <zhaowei.yuan@samsung.com>
Wed, 18 Jun 2014 06:33:59 +0000 (14:33 +0800)
committerDave Airlie <airlied@redhat.com>
Wed, 25 Jun 2014 03:26:57 +0000 (13:26 +1000)
commit1539fb9bd405ee32282ea0a38404f9e008ac5b7a
tree80d834baf72aa0f9b205c24528403a5eb69a3581
parenta497c3ba1d97fc69c1e78e7b96435ba8c2cb42ee
drm: fix NULL pointer access by wrong ioctl

If user uses wrong ioctl command with _IOC_NONE and argument size
greater than 0, it can cause NULL pointer access from memset of line
463. If _IOC_NONE, don't memset to 0 for kdata.

Signed-off-by: Zhaowei Yuan <zhaowei.yuan@samsung.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_drv.c [changed mode: 0644->0755]