提交 41ee2ff4 编写于 作者: J Johannes Weiner 提交者: Dave Airlie

drm: use drms ioctl cmd not what we get passed from userspace.

This enforces us to use the drm ioctl types so read/write works correctly and not believe
what userspace tells us.

It does this hopefully without breaking the drm api.

Fixes bug from thread: BUG: unable to handle kernel NULL pointer dereference (drm_getunique)
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 5dd34572
......@@ -475,6 +475,8 @@ int drm_ioctl(struct inode *inode, struct file *filp,
else
goto err_i1;
/* Do not trust userspace, use our own definition */
cmd = ioctl->cmd;
func = ioctl->func;
/* is there a local override? */
if ((nr == DRM_IOCTL_NR(DRM_IOCTL_DMA)) && dev->driver->dma_ioctl)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册