[OpenSIPS-Devel] [OpenSIPS/opensips] b9511b: dialog: Fix some locking corner-cases

Liviu Chircu noreply at github.com
Wed Feb 26 12:50:23 EST 2020


  Branch: refs/heads/3.0
  Home:   https://github.com/OpenSIPS/opensips
  Commit: b9511b91f1aea8b9f83da41cd18fd43ce6bc3092
      https://github.com/OpenSIPS/opensips/commit/b9511b91f1aea8b9f83da41cd18fd43ce6bc3092
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2020-02-26 (Wed, 26 Feb 2020)

  Changed paths:
    M modules/dialog/dlg_db_handler.c
    M modules/dialog/dlg_handlers.c
    M modules/dialog/dlg_replication.c

  Log Message:
  -----------
  dialog: Fix some locking corner-cases

    * Re-INVITE pinging: synchronize writers and readers for the
       dlg->legs->adv_contact string, as well as the entire dlg->legs
       struct.  Example subtle race conditions:

	 1. setting $DLG_timeout after t_relay() (read op) vs.
	    concurrently processing a 200 OK (write op)

	 2. calling MI "dlg_push_var" after t_relay() (read op) vs.
	    concurrently processing a 200 OK (write op)

	 3. in parallel forking, dlg_onreq_out() (read op) vs.
	    concurrently processing 200 OK for prev. branch (write op)

    * DB load: to be 100% accurate, do not use ref_unsafe(), as we
       don't hold the lock -- use the safe version instead!

(cherry picked from commit 0dc968169a8d61cb6f9dea6143edb6dcf738e0d6)





More information about the Devel mailing list