summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2018-01-02 18:20:46 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-01-25 17:25:34 -0500
commit496757003302994f1136225b2f25e7599fc14eb5 (patch)
tree820d49275a12f74dc6d72a57fcb14525cbb28f43
parenta373843d072f53ad72c510826d289a0d3b9062e4 (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 2039126 CVE-2017-5753 Change-Id: Ib6c4b2f99b85af3119cce3882fe35ab47509c76f Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1640500 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 0932778d..68ad7bcd 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -3809,6 +3809,8 @@ int gr_gk20a_query_zbc(struct gk20a *g, struct gr_gk20a *gr,
3809 "invalid zbc color table index"); 3809 "invalid zbc color table index");
3810 return -EINVAL; 3810 return -EINVAL;
3811 } 3811 }
3812
3813 nvgpu_speculation_barrier();
3812 for (i = 0; i < GK20A_ZBC_COLOR_VALUE_SIZE; i++) { 3814 for (i = 0; i < GK20A_ZBC_COLOR_VALUE_SIZE; i++) {
3813 query_params->color_l2[i] = 3815 query_params->color_l2[i] =
3814 gr->zbc_col_tbl[index].color_l2[i]; 3816 gr->zbc_col_tbl[index].color_l2[i];
@@ -3824,6 +3826,8 @@ int gr_gk20a_query_zbc(struct gk20a *g, struct gr_gk20a *gr,
3824 "invalid zbc depth table index"); 3826 "invalid zbc depth table index");
3825 return -EINVAL; 3827 return -EINVAL;
3826 } 3828 }
3829
3830 nvgpu_speculation_barrier();
3827 query_params->depth = gr->zbc_dep_tbl[index].depth; 3831 query_params->depth = gr->zbc_dep_tbl[index].depth;
3828 query_params->format = gr->zbc_dep_tbl[index].format; 3832 query_params->format = gr->zbc_dep_tbl[index].format;
3829 query_params->ref_cnt = gr->zbc_dep_tbl[index].ref_cnt; 3833 query_params->ref_cnt = gr->zbc_dep_tbl[index].ref_cnt;