]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vmwgfx: Potential off by one in vmw_view_add()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 10 Jan 2018 09:40:04 +0000 (12:40 +0300)
committerThomas Hellstrom <thellstrom@vmware.com>
Wed, 10 Jan 2018 14:21:39 +0000 (15:21 +0100)
commitced300421182a3001c55f2bbcadbd09f10f0543f
treeb7de610a963347d9dfaa6bacf8cfb2ab3bf7220b
parent69e0b9c62146dd50d7595275c064e02a230c2860
drm/vmwgfx: Potential off by one in vmw_view_add()

The vmw_view_cmd_to_type() function returns vmw_view_max (3) on error.
It's one element beyond the end of the vmw_view_cotables[] table.

My read on this is that it's possible to hit this failure.  header->id
comes from vmw_cmd_check() and it's a user controlled number between
1040 and 1225 so we can hit that error.  But I don't have the hardware
to test this code.

Fixes: 37aa331a817d ("drm/vmwgfx: Initial DX support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: <stable@vger.kernel.org>
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c