mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: Validate regops num_ops argument
Check that num_ops is not too big. We have a hard limit of 1 page allocated for the operations. Bug 200192125 Change-Id: I724039c9dd6e0e93d9df0f5b3a797158fdb5e687 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1132965 GVS: Gerrit_Virtual_Submit
This commit is contained in:
@@ -975,6 +975,9 @@ static int nvgpu_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s,
|
||||
struct channel_gk20a *ch;
|
||||
u64 ops_size = sizeof(ops[0]) * args->num_ops;
|
||||
|
||||
if (args->num_ops > SZ_4K / sizeof(ops[0]))
|
||||
return -EINVAL;
|
||||
|
||||
gk20a_dbg_fn("%d ops, total size %llu", args->num_ops, ops_size);
|
||||
|
||||
if (!dbg_s->ops) {
|
||||
|
||||
Reference in New Issue
Block a user