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)
committerWilly Tarreau <w@1wt.eu>
Tue, 20 Jun 2017 12:04:41 +0000 (14:04 +0200)
commit354b332cb731caca4811707ae175d08a46cff28e
tree8226708f621dd122a48f0b72079a86039df83c40
parent30cd45a69bc69b191b0f6c14b317a6aeb4771439
drm/vmwgfx: avoid calling vzalloc with a 0 size in vmw_get_cap_3d_ioctl()

commit 63774069d9527a1aeaa4aa20e929ef5e8e9ecc38 upstream.

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.

Signed-off-by: Murray McAllister <murray.mcallister@insomniasec.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c