]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdkfd: fix some range checks in address watch ioctl
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 16 Jun 2015 10:49:32 +0000 (13:49 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Tue, 16 Jun 2015 12:42:26 +0000 (15:42 +0300)
commit173bcfb88e49fb565b40a0694ea49ffd7724b5fd
tree00f1595dd1de98ce349596b1fddff9e3a09ed7bc
parent9d6d6f24f27f400bc9b87c64f345d4d83ce3e652
drm/amdkfd: fix some range checks in address watch ioctl

buf_size_in_bytes must be large enough to hold ->num_watch_points and
watch_mode so I have added a sizeof(int) * 2 to the minimum size.

Also we have to subtract sizeof(*args) from the max args_idx limit so
that it matches the allocation.  Also I changed a > to >= for the last
compare.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c