diff options
author | Zhenyu Wang <zhenyuw@linux.intel.com> | 2019-11-21 13:57:45 +0800 |
---|---|---|
committer | Zhenyu Wang <zhenyuw@linux.intel.com> | 2019-12-02 11:06:49 +0800 |
commit | 92b1aa773fadb4e2a90ed5d3beecb422d568ad9a (patch) | |
tree | a4788e0011cdc9379dcc9d8bc1886581958f96cb /drivers/gpu/drm/i915/gvt | |
parent | 68421940b0d66f3806bfd0cd0f78a6935c75cb55 (diff) | |
download | linux-92b1aa773fadb4e2a90ed5d3beecb422d568ad9a.tar.gz linux-92b1aa773fadb4e2a90ed5d3beecb422d568ad9a.tar.bz2 linux-92b1aa773fadb4e2a90ed5d3beecb422d568ad9a.zip |
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: 00a33be40634 ("drm/i915/gvt: Add valid length check for MI variable commands")
Reported-by: Alex Williamson <alex.williamson@redhat.com>
Acked-by: Gao Fred <fred.gao@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/gvt')
-rw-r--r-- | drivers/gpu/drm/i915/gvt/cmd_parser.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c index 6a3ac8cde95d..21a176cd8acc 100644 --- a/drivers/gpu/drm/i915/gvt/cmd_parser.c +++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c @@ -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) |