OSDN Git Service

drm/vmwgfx: Validate the box size for the snooped cursor
authorZack Rusin <zackr@vmware.com>
Wed, 26 Oct 2022 03:19:35 +0000 (23:19 -0400)
committerZack Rusin <zackr@vmware.com>
Mon, 31 Oct 2022 15:50:23 +0000 (11:50 -0400)
commit4cf949c7fafe21e085a4ee386bb2dade9067316e
tree934fb69424571c5eebf770ebe2efd4e24f9e4da2
parent4dba27f1a14592ac4cf71c3bc1cc1fd05dea8015
drm/vmwgfx: Validate the box size for the snooped cursor

Invalid userspace dma surface copies could potentially overflow
the memcpy from the surface to the snooped image leading to crashes.
To fix it the dimensions of the copybox have to be validated
against the expected size of the snooped cursor.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Fixes: 2ac863719e51 ("vmwgfx: Snoop DMA transfers with non-covering sizes")
Cc: <stable@vger.kernel.org> # v3.2+
Reviewed-by: Michael Banack <banackm@vmware.com>
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221026031936.1004280-1-zack@kde.org
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c