[BUG] net: smc: possible deadlock in smc_lgr_free() and smc_link_down_work()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

My static analysis tool reports a possible deadlock in the smc module in Linux 5.16:

smc_lgr_free()
  mutex_lock(&lgr->llc_conf_mutex); --> Line 1289 (Lock A)
  smcr_link_clear()
    smc_wr_free_link()
      wait_event(lnk->wr_tx_wait, ...); --> Line 648 (Wait X)

smc_link_down_work()
  mutex_lock(&lgr->llc_conf_mutex); --> Line 1683 (Lock A)
  smcr_link_down()
    smcr_link_clear()
      smc_wr_free_link()
        smc_wr_wakeup_tx_wait()
          wake_up_all(&lnk->wr_tx_wait); --> Line 78 (Wake X)

When smc_lgr_free() is executed, "Wait X" is performed by holding "Lock A". If smc_link_down_work() is executed at this time, "Wake X" cannot be performed to wake up "Wait X" in smc_lgr_free(), because "Lock A" has been already hold by smc_lgr_free(), causing a possible deadlock.

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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux