summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/gvt
diff options
context:
space:
mode:
authorZhenyu Wang2019-02-20 09:25:04 +0100
committerGreg Kroah-Hartman2019-04-03 06:26:26 +0200
commitdf74e70ffec6757f9ea75e7d1ea35de29c7d8b1a (patch)
treefd2e0f4fd90d6fe9d96b83b9da21d72cc1602303 /drivers/gpu/drm/i915/gvt
parentdrm/vkms: fix use-after-free when drm_gem_handle_create() fails (diff)
downloadkernel-qcow2-linux-df74e70ffec6757f9ea75e7d1ea35de29c7d8b1a.tar.gz
kernel-qcow2-linux-df74e70ffec6757f9ea75e7d1ea35de29c7d8b1a.tar.xz
kernel-qcow2-linux-df74e70ffec6757f9ea75e7d1ea35de29c7d8b1a.zip
drm/i915/gvt: Fix MI_FLUSH_DW parsing with correct index check
commit 13bcb80b7ee79431fce361e060611134cb19e209 upstream. When MI_FLUSH_DW post write hw status page in index mode, the index value is in dword step and turned into address offset in cmd dword1. As status page size is 4K, so can't exceed that. This fixed upper bound check in cmd parser code which incorrectly stopped VM for reason of invalid MI_FLUSH_DW write index. v2: - Fix upper bound as 4K page size because index value is address offset. Fixes: be1da7070aea ("drm/i915/gvt: vGPU command scanner") Cc: stable@vger.kernel.org # v4.10+ Cc: "Zhao, Yan Y" <yan.y.zhao@intel.com> Reviewed-by: Yan Zhao <yan.y.zhao@intel.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu/drm/i915/gvt')
-rw-r--r--drivers/gpu/drm/i915/gvt/cmd_parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c
index a614db310ea2..be15289bff9c 100644
--- a/drivers/gpu/drm/i915/gvt/cmd_parser.c
+++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c
@@ -1446,7 +1446,7 @@ static inline int cmd_address_audit(struct parser_exec_state *s,
}
if (index_mode) {
- if (guest_gma >= I915_GTT_PAGE_SIZE / sizeof(u64)) {
+ if (guest_gma >= I915_GTT_PAGE_SIZE) {
ret = -EFAULT;
goto err;
}