[Security,Check] drm/i915/gvt: return error on cmd access

Submitted by Zhao, Yan Y on July 25, 2018, 6:42 a.m.

Details

Message ID 20180725064255.17504-1-yan.y.zhao@intel.com
State New
Headers show
Series "drm/i915/gvt: return error on cmd access" ( rev: 1 ) in Intel GVT devel

Not browsing as part of any series.

Commit Message

Zhao, Yan Y July 25, 2018, 6:42 a.m.
If a register is not cmd accessible, should not just print error
message. Return error here so as not to deliver this cmd.

Signed-off-by: Zhao Yan <yan.y.zhao@intel.com>
---
 drivers/gpu/drm/i915/gvt/cmd_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c
index c39e13abe50d..bc05831faa5f 100644
--- a/drivers/gpu/drm/i915/gvt/cmd_parser.c
+++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c
@@ -874,7 +874,7 @@  static int cmd_reg_handler(struct parser_exec_state *s,
 	if (!intel_gvt_mmio_is_cmd_access(gvt, offset)) {
 		gvt_vgpu_err("%s access to non-render register (%x)\n",
 				cmd, offset);
-		return 0;
+		return -EPERM;
 	}
 
 	if (is_shadowed_mmio(offset)) {

Comments