]> 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)
commit99399ead1530d9b58158336784289e0a6ad656a5
tree00f1595dd1de98ce349596b1fddff9e3a09ed7bc
parentd44ac53aee9cf955514674b217b2b9f6ac2758f8
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