Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218333
b: refs/heads/master
c: b5dc608
h: refs/heads/master
i:
  218331: 8c69963
v: v3
  • Loading branch information
Chris Wilson committed Oct 20, 2010
1 parent d0c0748 commit 2814ffb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 69dc4987cbe5fe70ae1c2a08906d431d53cdd242
refs/heads/master: b5dc608c98d929abbf2fe932ed07b3c868d83342
13 changes: 13 additions & 0 deletions trunk/drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -3399,6 +3399,15 @@ i915_gem_execbuffer_relocate(struct drm_i915_gem_object *obj,
iowrite32(reloc.delta, reloc_entry);
io_mapping_unmap_atomic(reloc_page, KM_USER0);
}

/* and update the user's relocation entry */
reloc.presumed_offset = target_offset;
if (__copy_to_user_inatomic(&user_relocs[i].presumed_offset,
&reloc.presumed_offset,
sizeof(reloc.presumed_offset))) {
ret = -EFAULT;
break;
}
}

drm_gem_object_unreference(target_obj);
Expand Down Expand Up @@ -3560,6 +3569,10 @@ validate_exec_list(struct drm_i915_gem_exec_object2 *exec,
if (!access_ok(VERIFY_READ, ptr, length))
return -EFAULT;

/* we may also need to update the presumed offsets */
if (!access_ok(VERIFY_WRITE, ptr, length))
return -EFAULT;

if (fault_in_pages_readable(ptr, length))
return -EFAULT;
}
Expand Down

0 comments on commit 2814ffb

Please sign in to comment.