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  PHC 
Open Source and information security mailing list archives
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 7 Feb 2022 23:31:26 +0800
From:   Jia-Ju Bai <>
Subject: [BUG] intersil: p54: possible deadlock in p54_remove_interface() and


My static analysis tool reports a possible deadlock in the p54 driver in 
Linux 5.16:

   mutex_lock(&priv->conf_mutex); --> Line 262 (Lock A)
wait_for_completion_interruptible_timeout(&priv->beacon_comp, HZ); --> 
Line 271 (Wait X)

   mutex_lock(&priv->conf_mutex); --> Line 208 (Lock A)
   p54p_stop() (call via priv->stop)
         complete(&priv->beacon_comp); --> Line 230 (Wake X)

When p54_remove_interface() is executed, "Wait X" is performed by 
holding "Lock A". If p54_stop() is executed at this time, "Wake X" 
cannot be performed to wake up "Wait X" in p54_remove_interface(), 
because "Lock A" has been already hold by p54_remove_interface(), 
causing a possible deadlock.
I find that "Wait X" is performed with a timeout, to relieve the 
possible deadlock; but I think this timeout can cause inefficient execution.

I am not quite sure whether this possible problem is real and how to fix 
it if it is real.
Any feedback would be appreciated, thanks :)

Best wishes,
Jia-Ju Bai

Powered by blists - more mailing lists