Skip to content

Commit

Permalink
vmwgfx: corruption in vmw_event_fence_action_create()
Browse files Browse the repository at this point in the history
We don't allocate enough data for this struct.  As soon as we start
modifying event->event on the next lines, then we're going beyond the
end of the memory we allocated.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@gmail.com>
  • Loading branch information
Dan Carpenter authored and Dave Airlie committed Sep 26, 2012
1 parent 4f20d9e commit 68c4fce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ int vmw_event_fence_action_create(struct drm_file *file_priv,
}


event = kzalloc(sizeof(event->event), GFP_KERNEL);
event = kzalloc(sizeof(*event), GFP_KERNEL);
if (unlikely(event == NULL)) {
DRM_ERROR("Failed to allocate an event.\n");
ret = -ENOMEM;
Expand Down

0 comments on commit 68c4fce

Please sign in to comment.