lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 11 Jan 2015 21:49:05 +0000
From:	Ben Hutchings <ben@...adent.org.uk>
To:	Luis Henriques <luis.henriques@...onical.com>,
	Chris Wilson <chris@...is-wilson.co.uk>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	linux-kernel@...r.kernel.org, stable@...r.kernel.org,
	kernel-team@...ts.ubuntu.com,
	Daniel Vetter <daniel.vetter@...ll.ch>
Subject: Re: [PATCH 3.16.y-ckt 030/168] drm/i915: Handle failure to kick out
 a conflicting fb driver

On Mon, 2014-12-15 at 14:24 +0000, Luis Henriques wrote:
> 3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Chris Wilson <chris@...is-wilson.co.uk>
> 
> commit f96de58fc7e7d3d717c7c63975c3b896c906b5e3 upstream.
> 
> Signed-off-by: Chris Wilson <chris@...is-wilson.co.uk>
> Reviewed-by: Jani Nikula <jani.nikula@...el.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@...ll.ch>
> Signed-off-by: Luis Henriques <luis.henriques@...onical.com>

Should this also be applied to any older stable branches?

i915_kick_out_firmware_fb() was introduced in 3.6 and it has always been
possible for the alloc_apertures() call to fail.

remove_conflicting_framebuffers() has returned an error code since 3.14
(but could silently fail before then!) so this should be applicable to
the 3.14 stable branch too.

Ben.

> ---
>  drivers/gpu/drm/i915/i915_dma.c | 18 +++++++++++++-----
>  1 file changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index d44344140627..0663fb4fa606 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -1425,15 +1425,16 @@ void i915_master_destroy(struct drm_device *dev, struct drm_master *master)
>  }
>  
>  #if IS_ENABLED(CONFIG_FB)
> -static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> +static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>  {
>  	struct apertures_struct *ap;
>  	struct pci_dev *pdev = dev_priv->dev->pdev;
>  	bool primary;
> +	int ret;
>  
>  	ap = alloc_apertures(1);
>  	if (!ap)
> -		return;
> +		return -ENOMEM;
>  
>  	ap->ranges[0].base = dev_priv->gtt.mappable_base;
>  	ap->ranges[0].size = dev_priv->gtt.mappable_end;
> @@ -1441,13 +1442,16 @@ static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>  	primary =
>  		pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
>  
> -	remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
> +	ret = remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
>  
>  	kfree(ap);
> +
> +	return ret;
>  }
>  #else
> -static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> +static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>  {
> +	return 0;
>  }
>  #endif
>  
> @@ -1664,7 +1668,11 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
>  			goto out_gtt;
>  		}
>  
> -		i915_kick_out_firmware_fb(dev_priv);
> +		ret = i915_kick_out_firmware_fb(dev_priv);
> +		if (ret) {
> +			DRM_ERROR("failed to remove conflicting framebuffer drivers\n");
> +			goto out_gtt;
> +		}
>  	}
>  
>  	pci_set_master(dev->pdev);

-- 
Ben Hutchings
One of the nice things about standards is that there are so many of them.

Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ