session: fix segment alloc/free worker race 22/34622/9
authorFlorin Coras <fcoras@cisco.com>
Wed, 1 Dec 2021 04:21:57 +0000 (20:21 -0800)
committerDamjan Marion <dmarion@me.com>
Wed, 22 Dec 2021 20:53:32 +0000 (20:53 +0000)
commitc824977ed38738985864c4524510f37a41453f7d
treee3ffc4e6bd0c3fccc1e3c1106a8ee1b9127bd511
parentd51250f5e2bc99784399b196733e813fef000d71
session: fix segment alloc/free worker race

Avoid scenarios where a worker allocates a segment but while it drops
the segment manager writer lock and acquires the reader lock another
worker uses the segment and frees it.

Type: fix

Thanks to wanghanlin@corp.netease.com for the report.

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I0a88d738c51b33fd07c34916f125c98806861a06
src/vnet/session/segment_manager.c
src/vnet/session/segment_manager.h