[OpenSIPS-Devel] [OpenSIPS/opensips] 6d2fe7: Fix concurrent parsing over samed shm message.

Bogdan Andrei IANCU noreply at github.com
Wed Apr 3 09:23:35 EDT 2019


  Branch: refs/heads/2.2
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 6d2fe7a1e241caf8681d57a36d6765e665dac809
      https://github.com/OpenSIPS/opensips/commit/6d2fe7a1e241caf8681d57a36d6765e665dac809
  Author: Bogdan-Andrei Iancu <bogdan at opensips.org>
  Date:   2019-04-03 (Wed, 03 Apr 2019)

  Changed paths:
    M modules/b2b_entities/dlg.c
    M modules/dialog/dlg_handlers.c
    M modules/osp/cnam.c
    M modules/presence/subscribe.c
    M modules/pua/send_subscribe.c
    M modules/topology_hiding/topo_hiding_logic.c
    M parser/parse_rr.c
    M parser/parse_rr.h

  Log Message:
  -----------
  Fix concurrent parsing over samed shm message.

As print_rr_body() may be called from different processes but over the same shm request, the performed parsing may lead to conflicts (different procs will fight one each other in setting the "parsed" field of the hdr_field in shm.
This will easily lead to memory corruption and crashes. As real case, different replies to the same request may trigger print_rr_body in topology_hiding(), over the same shm cloned request.
The newly added paramter (no_change) will instruct print_rr_body() to do its job but without changing anything in the inout set of RR hdrs.

(cherry picked from commit e1004f864587a37a1e5630d1181fa323ba51df14)





More information about the Devel mailing list