lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Tue, 11 Apr 2017 16:45:48 +0800
From:   Zhen Lei <thunder.leizhen@...wei.com>
To:     VMware Graphics <linux-graphics-maintainer@...are.com>,
        Sinclair Yeh <syeh@...are.com>,
        Thomas Hellstrom <thellstrom@...are.com>,
        David Airlie <airlied@...ux.ie>,
        DRM DRIVER <dri-devel@...ts.freedesktop.org>,
        linux-kernel <linux-kernel@...r.kernel.org>
CC:     Zefan Li <lizefan@...wei.com>, Xinwei Hu <huxinwei@...wei.com>,
        "Tianhong Ding" <dingtianhong@...wei.com>,
        Hanjun Guo <guohanjun@...wei.com>,
        Zhen Lei <thunder.leizhen@...wei.com>
Subject: [PATCH 1/1] drm/vmwgfx: remove an unnecessary check

commit e7e11f995642 ("drm/vmwgfx: fix integer overflow in vmw_surface_define_ioctl()")
ensures that each req->mip_levels[i] <= DRM_VMW_MAX_MIP_LEVELS, It would be easy to
conclude that the sum of req->mip_levels[i] (i = 0, ..., DRM_VMW_MAX_SURFACE_FACES - 1)
is less than or equal to (DRM_VMW_MAX_SURFACE_FACES * DRM_VMW_MAX_MIP_LEVELS).

Signed-off-by: Zhen Lei <thunder.leizhen@...wei.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
index 05fa092..4520b1f 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
@@ -719,8 +719,7 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void *data,
 		num_sizes += req->mip_levels[i];
 	}

-	if (num_sizes > DRM_VMW_MAX_SURFACE_FACES * DRM_VMW_MAX_MIP_LEVELS ||
-	    num_sizes == 0)
+	if (num_sizes == 0)
 		return -EINVAL;

 	size = vmw_user_surface_size + 128 +
--
2.5.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ