summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAparna Das <aparnad@nvidia.com>2018-02-05 15:36:11 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-02-06 23:03:26 -0500
commit2a9431bbe008d9d6bcd10113341e4106cb3e564a (patch)
tree331bfc47a6ee84fb17b5c5e66e62f0a08412ef29
parent9402f4165b7a5568363f793e47bb893719639ca2 (diff)
gpu: nvgpu: add speculative load barrier (ctrl IOCTLs)
Data can be speculatively loaded from memory and stay in cache even when bound check fails. This can lead to unintended information disclosure via side-channel analysis. To mitigate this problem insert a speculation barrier. bug 2041355 Change-Id: I03fbc81c105632e788d8a0f97fb4e233d1124b49 Signed-off-by: Aparna Das <aparnad@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1652230 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/gv11b/gr_gv11b.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
index 46f5ffb5..0d7a3f4d 100644
--- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
@@ -956,6 +956,8 @@ int gr_gv11b_zbc_s_query_table(struct gk20a *g, struct gr_gk20a *gr,
956 nvgpu_err(g, "invalid zbc stencil table index"); 956 nvgpu_err(g, "invalid zbc stencil table index");
957 return -EINVAL; 957 return -EINVAL;
958 } 958 }
959
960 nvgpu_speculation_barrier();
959 query_params->depth = gr->zbc_s_tbl[index].stencil; 961 query_params->depth = gr->zbc_s_tbl[index].stencil;
960 query_params->format = gr->zbc_s_tbl[index].format; 962 query_params->format = gr->zbc_s_tbl[index].format;
961 query_params->ref_cnt = gr->zbc_s_tbl[index].ref_cnt; 963 query_params->ref_cnt = gr->zbc_s_tbl[index].ref_cnt;