Skip to content

Commit

Permalink
drm/i915/gvt: Fix cmd length check for MI_ATOMIC
Browse files Browse the repository at this point in the history
Correct valid command length check for MI_ATOMIC, need to check inline
data available field instead of operand data length for whole command.

Fixes: 00a33be ("drm/i915/gvt: Add valid length check for MI variable commands")
Reported-by: Alex Williamson <[email protected]>
Acked-by: Gao Fred <[email protected]>
Cc: [email protected]
Signed-off-by: Zhenyu Wang <[email protected]>
  • Loading branch information
zhenyw committed Dec 2, 2019
1 parent 6842194 commit 92b1aa7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/i915/gvt/cmd_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1599,9 +1599,9 @@ static int cmd_handler_mi_op_2f(struct parser_exec_state *s)
if (!(cmd_val(s, 0) & (1 << 22)))
return ret;

/* check if QWORD */
if (DWORD_FIELD(0, 20, 19) == 1)
valid_len += 8;
/* check inline data */
if (cmd_val(s, 0) & BIT(18))
valid_len = CMD_LEN(9);
ret = gvt_check_valid_cmd_length(cmd_length(s),
valid_len);
if (ret)
Expand Down

0 comments on commit 92b1aa7

Please sign in to comment.