Commit c90a95bf authored by Dave Airlie's avatar Dave Airlie

Merge tag 'drm-amdkfd-next-fixes-2015-06-16' of...

Merge tag 'drm-amdkfd-next-fixes-2015-06-16' of git://people.freedesktop.org/~gabbayo/linux into drm-next

- Dan fixed some range checks in the address watch ioctl impl.
- Remove obsolete member from radeon_device structure

* tag 'drm-amdkfd-next-fixes-2015-06-16' of git://people.freedesktop.org/~gabbayo/linux:
  drm/amdkfd: fix some range checks in address watch ioctl
  drm/radeon: remove obsolete kfd_bo from radeon_device
parents 284b2884 7861c7a4
...@@ -553,7 +553,7 @@ static int kfd_ioctl_dbg_address_watch(struct file *filep, ...@@ -553,7 +553,7 @@ static int kfd_ioctl_dbg_address_watch(struct file *filep,
/* Validate arguments */ /* Validate arguments */
if ((args->buf_size_in_bytes > MAX_ALLOWED_AW_BUFF_SIZE) || if ((args->buf_size_in_bytes > MAX_ALLOWED_AW_BUFF_SIZE) ||
(args->buf_size_in_bytes <= sizeof(*args)) || (args->buf_size_in_bytes <= sizeof(*args) + sizeof(int) * 2) ||
(cmd_from_user == NULL)) (cmd_from_user == NULL))
return -EINVAL; return -EINVAL;
...@@ -590,7 +590,7 @@ static int kfd_ioctl_dbg_address_watch(struct file *filep, ...@@ -590,7 +590,7 @@ static int kfd_ioctl_dbg_address_watch(struct file *filep,
/* skip over the addresses buffer */ /* skip over the addresses buffer */
args_idx += sizeof(aw_info.watch_address) * aw_info.num_watch_points; args_idx += sizeof(aw_info.watch_address) * aw_info.num_watch_points;
if (args_idx >= args->buf_size_in_bytes) { if (args_idx >= args->buf_size_in_bytes - sizeof(*args)) {
kfree(args_buff); kfree(args_buff);
return -EINVAL; return -EINVAL;
} }
...@@ -614,7 +614,7 @@ static int kfd_ioctl_dbg_address_watch(struct file *filep, ...@@ -614,7 +614,7 @@ static int kfd_ioctl_dbg_address_watch(struct file *filep,
args_idx += sizeof(aw_info.watch_mask); args_idx += sizeof(aw_info.watch_mask);
} }
if (args_idx > args->buf_size_in_bytes) { if (args_idx >= args->buf_size_in_bytes - sizeof(args)) {
kfree(args_buff); kfree(args_buff);
return -EINVAL; return -EINVAL;
} }
......
...@@ -2458,7 +2458,6 @@ struct radeon_device { ...@@ -2458,7 +2458,6 @@ struct radeon_device {
/* amdkfd interface */ /* amdkfd interface */
struct kfd_dev *kfd; struct kfd_dev *kfd;
struct radeon_sa_manager kfd_bo;
struct mutex mn_lock; struct mutex mn_lock;
DECLARE_HASHTABLE(mn_hash, 7); DECLARE_HASHTABLE(mn_hash, 7);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment