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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Mon, 7 Feb 2022 22:43:03 +0800
From:   Jia-Ju Bai <>
Subject: [BUG] net: ti: possible deadlock in cpts_ptp_gettimeex() and


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

   mutex_lock(&cpts->ptp_clk_mutex); --> Line 260 (Lock A)
     wait_for_completion_timeout(&cpts->ts_push_complete, HZ); --> Line 
210 (Wait X)

   mutex_lock(&cpts->ptp_clk_mutex); --> Line 411 (Lock A)
       complete(&cpts->ts_push_complete); --> Line 142 (Wake X)

When cpts_ptp_gettimeex() is executed, "Wait X" is performed by holding 
"Lock A". If cpts_overflow_check() is executed at this time, "Wake X" 
cannot be performed to wake up "Wait X" in cpts_ptp_gettimeex(), because 
"Lock A" has been already hold by cpts_ptp_gettimeex(), 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