Commit 92b1aa77 authored by Zhenyu Wang's avatar Zhenyu Wang

drm/i915/gvt: Fix cmd length check for MI_ATOMIC

Correct valid command length check for MI_ATOMIC, need to check inline
data available field instead of operand data length for whole command.

Fixes: 00a33be4 ("drm/i915/gvt: Add valid length check for MI variable commands")
Reported-by: default avatarAlex Williamson <alex.williamson@redhat.com>
Acked-by: default avatarGao Fred <fred.gao@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
parent 68421940
...@@ -1599,9 +1599,9 @@ static int cmd_handler_mi_op_2f(struct parser_exec_state *s) ...@@ -1599,9 +1599,9 @@ static int cmd_handler_mi_op_2f(struct parser_exec_state *s)
if (!(cmd_val(s, 0) & (1 << 22))) if (!(cmd_val(s, 0) & (1 << 22)))
return ret; return ret;
/* check if QWORD */ /* check inline data */
if (DWORD_FIELD(0, 20, 19) == 1) if (cmd_val(s, 0) & BIT(18))
valid_len += 8; valid_len = CMD_LEN(9);
ret = gvt_check_valid_cmd_length(cmd_length(s), ret = gvt_check_valid_cmd_length(cmd_length(s),
valid_len); valid_len);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment