lkml.org 
[lkml]   [2012]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[ 217/218] vmwgfx: corruption in vmw_event_fence_action_create()
    Date
    3.4-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Dan Carpenter <dan.carpenter@oracle.com>

    commit 68c4fce737c4b963e336435f225621dc21138397 upstream.

    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>
    Signed-off-by: Dave Airlie <airlied@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
    +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
    @@ -1018,7 +1018,7 @@ int vmw_event_fence_action_create(struct
    }


    - 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;



    \
     
     \ /
      Last update: 2012-09-29 00:01    [W:2.267 / U:0.072 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site