linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* vmwgfx: Fix unitialized stack read in vmw_setup_otable_base
@ 2014-01-31  2:27 Dave Jones
  2014-02-05  7:50 ` Thomas Hellstrom
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Jones @ 2014-01-31  2:27 UTC (permalink / raw)
  To: Linux Kernel; +Cc: thellstrom

One of the error paths in vmw_setup_otable_base causes us to return with
'ret' having never been set to anything causing us to return whatever was
on the stack.

Found with Coverity

Signed-off-by: Dave Jones <davej@fedoraproject.org>

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c b/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c
index 4910e7b81811..d4a5a19cb8c3 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c
@@ -134,6 +134,7 @@ static int vmw_setup_otable_base(struct vmw_private *dev_priv,
 	cmd = vmw_fifo_reserve(dev_priv, sizeof(*cmd));
 	if (unlikely(cmd == NULL)) {
 		DRM_ERROR("Failed reserving FIFO space for OTable setup.\n");
+		ret = -ENOMEM;
 		goto out_no_fifo;
 	}
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: vmwgfx: Fix unitialized stack read in vmw_setup_otable_base
  2014-01-31  2:27 vmwgfx: Fix unitialized stack read in vmw_setup_otable_base Dave Jones
@ 2014-02-05  7:50 ` Thomas Hellstrom
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Hellstrom @ 2014-02-05  7:50 UTC (permalink / raw)
  To: Dave Jones, Linux Kernel

On 01/31/2014 03:27 AM, Dave Jones wrote:
> One of the error paths in vmw_setup_otable_base causes us to return with
> 'ret' having never been set to anything causing us to return whatever was
> on the stack.
>
> Found with Coverity
>
> Signed-off-by: Dave Jones <davej@fedoraproject.org>
>
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c b/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c
> index 4910e7b81811..d4a5a19cb8c3 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c
> @@ -134,6 +134,7 @@ static int vmw_setup_otable_base(struct vmw_private *dev_priv,
>  	cmd = vmw_fifo_reserve(dev_priv, sizeof(*cmd));
>  	if (unlikely(cmd == NULL)) {
>  		DRM_ERROR("Failed reserving FIFO space for OTable setup.\n");
> +		ret = -ENOMEM;
>  		goto out_no_fifo;
>  	}
>  

Thanks,
Will queue on vmwgfx-fixes for -rc2.

/Thomas

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-05  7:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-31  2:27 vmwgfx: Fix unitialized stack read in vmw_setup_otable_base Dave Jones
2014-02-05  7:50 ` Thomas Hellstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).