diff options
author | Sri Krishna chowdary <schowdary@nvidia.com> | 2015-09-02 13:20:59 -0400 |
---|---|---|
committer | Sri Krishna Chowdary <schowdary@nvidia.com> | 2015-09-07 01:59:31 -0400 |
commit | 47afbb71ead31e5378b9dddf22f92a5ff9bb9d6b (patch) | |
tree | 48acf63b79fc5116d3a08313a34a85b9f0483590 | |
parent | 54c2ae59f0010c75bc03719e7b5ece4040c102d3 (diff) |
gpu: nvgpu: fix alignment calculation
consider buffer size as well when calculating the required alignment
for a buffer else we would be mapping a VA range greater than requested
thus allowing access to entire large page even when not needed creating
a security hole.
Bug 1492689
Change-Id: Ic404708d238621ea64c26cafd05bc30ba8e02e12
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/793229
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index b12091bf..37151cda 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -1423,7 +1423,7 @@ u64 gk20a_vm_map(struct vm_gk20a *vm, | |||
1423 | sgl = sg_next(sgl); | 1423 | sgl = sg_next(sgl); |
1424 | } | 1424 | } |
1425 | } else | 1425 | } else |
1426 | bfr.align = 1 << __ffs(buf_addr); | 1426 | bfr.align = 1 << __ffs(buf_addr | bfr.size); |
1427 | 1427 | ||
1428 | bfr.pgsz_idx = -1; | 1428 | bfr.pgsz_idx = -1; |
1429 | mapping_size = mapping_size ? mapping_size : bfr.size; | 1429 | mapping_size = mapping_size ? mapping_size : bfr.size; |