summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAparna Das <aparnad@nvidia.com>2018-06-22 14:35:10 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-06-26 14:17:49 -0400
commit8586414cc15ca36e92cf3c40c2cfb2f8b2691bee (patch)
treeb7529eda956bdbb1193820958818273e7d433ba4 /drivers
parent10c3d4447d4206302f5d51695bf1f193255dd889 (diff)
gpu: nvgpu: fix perf output buffer size validation
Currently we check if offset + size of perf output buffer crosses 4GB boundary. This check should be fixed to offset + size - 1. Bug 200422626 Change-Id: I87b1c0761a97903780ddde871d5ca396bf26170d Signed-off-by: Aparna Das <aparnad@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1758338 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/os/linux/ioctl_dbg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c
index 938e0abd..383bdca9 100644
--- a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c
+++ b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c
@@ -1383,7 +1383,7 @@ static int gk20a_perfbuf_map(struct dbg_session_gk20a *dbg_s,
1383 1383
1384 /* perf output buffer may not cross a 4GB boundary */ 1384 /* perf output buffer may not cross a 4GB boundary */
1385 virt_size = u64_lo32(args->mapping_size); 1385 virt_size = u64_lo32(args->mapping_size);
1386 if (u64_hi32(args->offset) != u64_hi32(args->offset + virt_size)) { 1386 if (u64_hi32(args->offset) != u64_hi32(args->offset + virt_size - 1)) {
1387 err = -EINVAL; 1387 err = -EINVAL;
1388 goto err_unmap; 1388 goto err_unmap;
1389 } 1389 }