From: bugzilla-daemon@freedesktop.org Subject: [Bug 92480] [Patch] Linux mutex leak in drm_dp_get_mst_branch Date: Thu, 15 Oct 2015 21:08:34 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0560286664==" Return-path: Received: from culpepper.freedesktop.org (unknown [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 0138E6E16F for ; Thu, 15 Oct 2015 14:08:35 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0560286664== Content-Type: multipart/alternative; boundary="1444943314.48EB1fE0.18724"; charset="UTF-8" --1444943314.48EB1fE0.18724 Date: Thu, 15 Oct 2015 21:08:34 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" https://bugs.freedesktop.org/show_bug.cgi?id=92480 Bug ID: 92480 Summary: [Patch] Linux mutex leak in drm_dp_get_mst_branch Product: DRI Version: unspecified Hardware: x86-64 (AMD64) OS: Linux (All) Status: NEW Severity: normal Priority: medium Component: General Assignee: dri-devel@lists.freedesktop.org Reporter: adam_richter2004@yahoo.com I believe I have found a mutex leak in drm_dp_get_mst_branch_device() in linux/drivers/gpu/drm/drm_dp_mst_topology.c in kernels 4.2-rc1 through the current version, 4.3-rc5, where the function can take an error exit without doing mutex_unlock(&mgr_lock). I have attached a proposed patch. Unfortunately, since I made the patch, I have not been able to trigger the error branch that the patch fixes, but I did find the bug by observing that error branch executing and printing an error message that I believe is unique to that branch ("*ERROR* failed to lookup MSTB"): [ 36.944273] [drm:gen8_irq_handler [i915]] *ERROR* The master control interrupt lied (SDE)! [ 74.576811] [drm:drm_dp_get_mst_branch_device [drm_kms_helper]] *ERROR* failed to lookup MSTB with lct 2, rad 10 [ 74.587704] BUG: workqueue leaked lock or atomic: kworker/u8:0/0x00000000/6 [ 74.587704] last function: i915_digport_work_func [i915] [ 74.655752] [drm:gen8_irq_handler [i915]] *ERROR* The master control interrupt lied (SDE)! I think this patch is also arguably an infinitesimal improvement in that it depends less on the optimizer, by reducing two references to port->mstb to one. Anyhow, if the patch looks good, I would be delighted to if the appropriate person (Dave?) would integrate it for submission upstream. Thanks in advance for any feedback on this. -- You are receiving this mail because: You are the assignee for the bug. --1444943314.48EB1fE0.18724 Date: Thu, 15 Oct 2015 21:08:34 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8"
Bug ID 92480
Summary [Patch] Linux mutex leak in drm_dp_get_mst_branch
Product DRI
Version unspecified
Hardware x86-64 (AMD64)
OS Linux (All)
Status NEW
Severity normal
Priority medium
Component General
Assignee dri-devel@lists.freedesktop.org
Reporter adam_richter2004@yahoo.com

I believe I have found a mutex leak in drm_dp_get_mst_branch_device() in
linux/drivers/gpu/drm/drm_dp_mst_topology.c in kernels 4.2-rc1 through the
current version, 4.3-rc5, where the function can take an error exit without
doing mutex_unlock(&mgr_lock).  I have attached a proposed patch.

Unfortunately, since I made the patch, I have not been able to trigger the
error branch that the patch fixes, but I did find the bug by observing that
error branch executing and printing an error message that I believe is unique
to that branch ("*ERROR* failed to lookup MSTB"):

[   36.944273] [drm:gen8_irq_handler [i915]] *ERROR* The master control
interrupt lied (SDE)!
[   74.576811] [drm:drm_dp_get_mst_branch_device [drm_kms_helper]] *ERROR*
failed to lookup MSTB with lct 2, rad 10
[   74.587704] BUG: workqueue leaked lock or atomic: kworker/u8:0/0x00000000/6
[   74.587704]      last function: i915_digport_work_func [i915]
[   74.655752] [drm:gen8_irq_handler [i915]] *ERROR* The master control
interrupt lied (SDE)!

I think this patch is also arguably an infinitesimal improvement in that it
depends less on the optimizer, by reducing two references to port->mstb to one.

Anyhow, if the patch looks good, I would be delighted to if the appropriate
person (Dave?) would integrate it for submission upstream.

Thanks in advance for any feedback on this.


You are receiving this mail because:
  • You are the assignee for the bug.
--1444943314.48EB1fE0.18724-- --===============0560286664== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9kcmktZGV2ZWwK --===============0560286664==--