Skip to content
Snippets Groups Projects
  • George Joseph's avatar
    ee7d72eb
    sig_pri: Fix deadlock caused by sig_pri_queue_hangup · ee7d72eb
    George Joseph authored
    The change to add setting hangupsource to sig_pri_queue_hangup()
    made in https://gerrit.asterisk.org/c/asterisk/+/12857 casued
    deadlocks when a hangup request was received from the core at the
    same time a hanguprequest was received from the remote end via the
    D channel.
    
    Although the PRI's channel private structure was being unlocked
    before setting the hangupsource, the PRI's own lock was still being
    held during the process.  If channel actions were also coming from
    the core, a deadlock on the PRI could result.  This deadlock could
    then escalate to the entire DAHDI subsystem via DAHDI's global
    interface list lock, especially if someone used the PRI CLI commands.
    
    Fix:
    
    * We now unlock the PRI as well as the PRI's channel private
      structure before setting the hangupsource, then relock both
      afterwards.
    
    ASTERISK-28605
    Reported by: Dirk Wendland
    
    Change-Id: Id74aaa5d4e3746063dbe9deed188eb65193cb9c9
    ee7d72eb
    History
    sig_pri: Fix deadlock caused by sig_pri_queue_hangup
    George Joseph authored
    The change to add setting hangupsource to sig_pri_queue_hangup()
    made in https://gerrit.asterisk.org/c/asterisk/+/12857 casued
    deadlocks when a hangup request was received from the core at the
    same time a hanguprequest was received from the remote end via the
    D channel.
    
    Although the PRI's channel private structure was being unlocked
    before setting the hangupsource, the PRI's own lock was still being
    held during the process.  If channel actions were also coming from
    the core, a deadlock on the PRI could result.  This deadlock could
    then escalate to the entire DAHDI subsystem via DAHDI's global
    interface list lock, especially if someone used the PRI CLI commands.
    
    Fix:
    
    * We now unlock the PRI as well as the PRI's channel private
      structure before setting the hangupsource, then relock both
      afterwards.
    
    ASTERISK-28605
    Reported by: Dirk Wendland
    
    Change-Id: Id74aaa5d4e3746063dbe9deed188eb65193cb9c9