This is a note to let you know that I've just added the patch titled drm/vmwgfx: Validate the box size for the snooped cursor to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-vmwgfx-validate-the-box-size-for-the-snooped-cursor.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 4cf949c7fafe21e085a4ee386bb2dade9067316e Mon Sep 17 00:00:00 2001 From: Zack Rusin <zackr@xxxxxxxxxx> Date: Tue, 25 Oct 2022 23:19:35 -0400 Subject: drm/vmwgfx: Validate the box size for the snooped cursor From: Zack Rusin <zackr@xxxxxxxxxx> commit 4cf949c7fafe21e085a4ee386bb2dade9067316e upstream. 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@xxxxxxxxxx> Fixes: 2ac863719e51 ("vmwgfx: Snoop DMA transfers with non-covering sizes") Cc: <stable@xxxxxxxxxxxxxxx> # v3.2+ Reviewed-by: Michael Banack <banackm@xxxxxxxxxx> Reviewed-by: Martin Krastev <krastevm@xxxxxxxxxx> Link: https://patchwork.freedesktop.org/patch/msgid/20221026031936.1004280-1-zack@xxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -186,7 +186,8 @@ void vmw_kms_cursor_snoop(struct vmw_sur if (cmd->dma.guest.ptr.offset % PAGE_SIZE || box->x != 0 || box->y != 0 || box->z != 0 || box->srcx != 0 || box->srcy != 0 || box->srcz != 0 || - box->d != 1 || box_count != 1) { + box->d != 1 || box_count != 1 || + box->w > 64 || box->h > 64) { /* TODO handle none page aligned offsets */ /* TODO handle more dst & src != 0 */ /* TODO handle more then one copy */ Patches currently in stable-queue which might be from zackr@xxxxxxxxxx are queue-5.15/drm-vmwgfx-validate-the-box-size-for-the-snooped-cursor.patch