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:	Thu, 23 Jan 2014 15:15:00 +0100
From:	David Herrmann <dh.herrmann@...il.com>
To:	dri-devel@...ts.freedesktop.org
Cc:	Ingo Molnar <mingo@...nel.org>, linux-fbdev@...r.kernel.org,
	Dave Airlie <airlied@...il.com>,
	Daniel Vetter <daniel.vetter@...ll.ch>,
	Tomi Valkeinen <tomi.valkeinen@...com>,
	linux-kernel@...r.kernel.org, Tom Gundersen <teg@...m.no>,
	David Herrmann <dh.herrmann@...il.com>
Subject: [PATCH 08/11] drm/i915: remove sysfbs early

Once we allow DRM drivers for system-framebuffers, we need to evict such
devices *before* probing the real driver. A simple call to sysfb_claim()
does this and remove_conflicting_framebuffers() implicitly calls this.
However, it causes the sysfb device to be unloaded and thus locks
drm_global_mutex. remove_conflicting_framebuffers() must be called from
outside any ->load() callback to avoid a dead-lock.

All other DRM drivers call this right before probing the pci-device, which
is fine. For i915 we need to figure out the apertures before we can evict
fw-framebuffers, though. This turns out to be not as easy as you might
think, so lets just evict all sysfbs for now before loading i915.

A proper fix would be to make DRM code allow parallel device probing.
That's not going to happen soon, so be safe and make i915 evict all
sysfbs.

Signed-off-by: David Herrmann <dh.herrmann@...il.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 43245b3..ceb875a 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -838,6 +838,12 @@ static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	driver.driver_features &= ~(DRIVER_USE_AGP);
 
+	/* We cannot call remove_conflicting_framebuffers() here as we cannot
+	 * easily figure out the apertures here. So lets just remove all
+	 * system-framebuffers early so we don't deadlock later when calling it
+	 * with drm_global_mutex held. */
+	sysfb_claim(NULL, SYSFB_CLAIM_ALL);
+
 	return drm_get_pci_dev(pdev, ent, &driver);
 }
 
-- 
1.8.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ