]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vmwgfx: avoid calling vzalloc with a 0 size in vmw_get_cap_3d_ioctl()
authorMurray McAllister <murray.mcallister@insomniasec.com>
Mon, 27 Mar 2017 09:15:12 +0000 (11:15 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Thu, 30 Mar 2017 09:43:37 +0000 (11:43 +0200)
commit9c01b404301fed186890d95d09237630e96e20e2
tree45b99c756375c0db0953930cb52f7be1b2b814a2
parente69f03609783894b69cc9d2878b6e2abb2c0a6cd
drm/vmwgfx: avoid calling vzalloc with a 0 size in vmw_get_cap_3d_ioctl()

In vmw_get_cap_3d_ioctl(), a user can supply 0 for a size that is
used in vzalloc(). This eventually calls dump_stack() (in warn_alloc()),
which can leak useful addresses to dmesg.

Add check to avoid a size of 0.

Cc: <stable@vger.kernel.org>
Signed-off-by: Murray McAllister <murray.mcallister@insomniasec.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c