[linux] 01/03: [x86] drm/vmwgfx: limit the number of mip levels in vmw_gb_surface_define_ioctl() (CVE-2017-7346)
debian-kernel at lists.debian.org
debian-kernel at lists.debian.org
Wed Jul 26 20:43:49 UTC 2017
This is an automated email from the git hooks/post-receive script.
carnil pushed a commit to branch stretch-security
in repository linux.
commit 3046d0a52bd7dccdb20ad6e03b19ea124105dc8f
Author: Salvatore Bonaccorso <carnil at debian.org>
Date: Wed Jul 26 22:06:15 2017 +0200
[x86] drm/vmwgfx: limit the number of mip levels in vmw_gb_surface_define_ioctl() (CVE-2017-7346)
---
debian/changelog | 7 ++++
...limit-the-number-of-mip-levels-in-vmw_gb_.patch | 38 ++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 46 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index ec03df5..c292f1f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+linux (4.9.30-2+deb9u3) UNRELEASED; urgency=medium
+
+ * [x86] drm/vmwgfx: limit the number of mip levels in
+ vmw_gb_surface_define_ioctl() (CVE-2017-7346)
+
+ -- Salvatore Bonaccorso <carnil at debian.org> Wed, 26 Jul 2017 22:08:32 +0200
+
linux (4.9.30-2+deb9u2) stretch-security; urgency=high
* Revert changes in version 4.9.30-2+deb9u1 (Closes: #865303)
diff --git a/debian/patches/bugfix/x86/drm-vmwgfx-limit-the-number-of-mip-levels-in-vmw_gb_.patch b/debian/patches/bugfix/x86/drm-vmwgfx-limit-the-number-of-mip-levels-in-vmw_gb_.patch
new file mode 100644
index 0000000..19eb98a
--- /dev/null
+++ b/debian/patches/bugfix/x86/drm-vmwgfx-limit-the-number-of-mip-levels-in-vmw_gb_.patch
@@ -0,0 +1,38 @@
+From: Vladis Dronov <vdronov at redhat.com>
+Date: Fri, 2 Jun 2017 07:42:09 +0200
+Subject: drm/vmwgfx: limit the number of mip levels in
+ vmw_gb_surface_define_ioctl()
+Origin: https://git.kernel.org/linus/ee9c4e681ec4f58e42a83cb0c22a0289ade1aacf
+Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-7346
+
+The 'req->mip_levels' parameter in vmw_gb_surface_define_ioctl() is
+a user-controlled 'uint32_t' value which is used as a loop count limit.
+This can lead to a kernel lockup and DoS. Add check for 'req->mip_levels'.
+
+References:
+https://bugzilla.redhat.com/show_bug.cgi?id=1437431
+
+Cc: <stable at vger.kernel.org>
+Signed-off-by: Vladis Dronov <vdronov at redhat.com>
+Reviewed-by: Sinclair Yeh <syeh at vmware.com>
+---
+ drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
+index 7681341fe32b..baf03d4d86d2 100644
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
+@@ -1279,6 +1279,9 @@ int vmw_gb_surface_define_ioctl(struct drm_device *dev, void *data,
+ if (req->multisample_count != 0)
+ return -EINVAL;
+
++ if (req->mip_levels > DRM_VMW_MAX_MIP_LEVELS)
++ return -EINVAL;
++
+ if (unlikely(vmw_user_surface_size == 0))
+ vmw_user_surface_size = ttm_round_pot(sizeof(*user_srf)) +
+ 128;
+--
+2.11.0
+
diff --git a/debian/patches/series b/debian/patches/series
index 08baaa9..a931ab2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -122,6 +122,7 @@ bugfix/all/crypto-skcipher-Add-missing-api-setkey-checks.patch
bugfix/all/ipv6-fix-out-of-bound-writes-in-__ip6_append_data.patch
bugfix/all/mm-larger-stack-guard-gap-between-vmas.patch
bugfix/all/mm-fix-new-crash-in-unmapped_area_topdown.patch
+bugfix/x86/drm-vmwgfx-limit-the-number-of-mip-levels-in-vmw_gb_.patch
# Fix exported symbol versions
bugfix/ia64/revert-ia64-move-exports-to-definitions.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git
More information about the Kernel-svn-changes
mailing list