dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Lespiau <damien.lespiau@intel.com>
To: Thomas Meyer <thomas@m3y3r.de>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] Fix SIGSEGV in libdrm for heigth = 0 and width = 0
Date: Thu, 20 Nov 2014 14:12:22 +0000	[thread overview]
Message-ID: <20141120141222.GA5584@strange.ger.corp.intel.com> (raw)
In-Reply-To: <1415385784.6136.7.camel@localhost.localdomain>

On Fri, Nov 07, 2014 at 07:43:04PM +0100, Thomas Meyer wrote:
> 
> drm_intel_gem_bo_free() crashes because the list bo_gem->vma_list is not
> yet initialised, but the error path tries to free it.
> 
> See also https://bugs.freedesktop.org/show_bug.cgi?id=75844
> 
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Thomas Meyer <thomas@m3y3r.de>

Thanks for the patch and review tag. Sorry it took so long to push, it
wasn't clear who was going to do it.

-- 
Damien

> ---
> 
> diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
> index f2f4fea..b3e9dba 100644
> --- a/intel/intel_bufmgr_gem.c
> +++ b/intel/intel_bufmgr_gem.c
> @@ -759,15 +759,16 @@ retry:
>  		bo_gem->swizzle_mode = I915_BIT_6_SWIZZLE_NONE;
>  		bo_gem->stride = 0;
>  
> +		/* drm_intel_gem_bo_free calls DRMLISTDEL() for an uninitialized
> +		   list (vma_list), so better set the list head here */
> +		DRMINITLISTHEAD(&bo_gem->name_list);
> +		DRMINITLISTHEAD(&bo_gem->vma_list);
>  		if (drm_intel_gem_bo_set_tiling_internal(&bo_gem->bo,
>  							 tiling_mode,
>  							 stride)) {
>  		    drm_intel_gem_bo_free(&bo_gem->bo);
>  		    return NULL;
>  		}
> -
> -		DRMINITLISTHEAD(&bo_gem->name_list);
> -		DRMINITLISTHEAD(&bo_gem->vma_list);
>  	}
>  
>  	bo_gem->name = name;
> 
> 
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2014-11-20 14:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07 18:43 [PATCH] Fix SIGSEGV in libdrm for heigth = 0 and width = 0 Thomas Meyer
2014-11-20 14:12 ` Damien Lespiau [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141120141222.GA5584@strange.ger.corp.intel.com \
    --to=damien.lespiau@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=thomas@m3y3r.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox