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-next>] [day] [month] [year] [list]
Message-Id: <1496220510-29968-1-git-send-email-baijiaju1990@163.com>
Date:   Wed, 31 May 2017 16:48:30 +0800
From:   Jia-Ju Bai <baijiaju1990@....com>
To:     patrik.r.jakobsson@...il.com, airlied@...ux.ie
Cc:     dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
        Jia-Ju Bai <baijiaju1990@....com>
Subject: [PATCH] gma500: Fix a sleep-in-atomic bug in psbfb_2d_submit

The driver may sleep under a spin lock, and the function call path is:
psbfb_2d_submit (acquire the lock by spin_lock_irqsave)
  psb_2d_wait_available
    psb_spank
      msleep --> may sleep

To fix it, the "msleep" is replaced with "mdelay" in psb_spank.

Signed-off-by: Jia-Ju Bai <baijiaju1990@....com>
---
 drivers/gpu/drm/gma500/accel_2d.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/gma500/accel_2d.c b/drivers/gpu/drm/gma500/accel_2d.c
index c51d925..7c24c8a 100644
--- a/drivers/gpu/drm/gma500/accel_2d.c
+++ b/drivers/gpu/drm/gma500/accel_2d.c
@@ -55,7 +55,7 @@ void psb_spank(struct drm_psb_private *dev_priv)
 		_PSB_CS_RESET_TWOD_RESET, PSB_CR_SOFT_RESET);
 	PSB_RSGX32(PSB_CR_SOFT_RESET);
 
-	msleep(1);
+	mdelay(1);
 
 	PSB_WSGX32(0, PSB_CR_SOFT_RESET);
 	wmb();
@@ -64,7 +64,7 @@ void psb_spank(struct drm_psb_private *dev_priv)
 	wmb();
 	(void) PSB_RSGX32(PSB_CR_BIF_CTRL);
 
-	msleep(1);
+	mdelay(1);
 	PSB_WSGX32(PSB_RSGX32(PSB_CR_BIF_CTRL) & ~_PSB_CB_CTRL_CLEAR_FAULT,
 		   PSB_CR_BIF_CTRL);
 	(void) PSB_RSGX32(PSB_CR_BIF_CTRL);
-- 
1.7.9.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ