提交 b9f0aee8 编写于 作者: D Dave Airlie

drm: stop information leak of old kernel stack.

non-critical issue, CVE-2010-2803

Userspace controls the amount of memory to be allocate, so it can
get the ioctl to allocate more memory than the kernel uses, and get
access to kernel stack. This can only be done for processes authenticated
to the X server for DRI access, and if the user has DRI access.

Fix is to just memset the data to 0 if the user doesn't copy into
it in the first place.
Reported-by: NKees Cook <kees@ubuntu.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 31ce4bfd
...@@ -477,7 +477,9 @@ long drm_ioctl(struct file *filp, ...@@ -477,7 +477,9 @@ long drm_ioctl(struct file *filp,
retcode = -EFAULT; retcode = -EFAULT;
goto err_i1; goto err_i1;
} }
} } else
memset(kdata, 0, _IOC_SIZE(cmd));
if (ioctl->flags & DRM_UNLOCKED) if (ioctl->flags & DRM_UNLOCKED)
retcode = func(dev, kdata, file_priv); retcode = func(dev, kdata, file_priv);
else { else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册