eal: fix use-after-free on control thread creation
authorJianfeng Tan <jianfeng.tan@intel.com>
Wed, 2 May 2018 13:52:14 +0000 (13:52 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 2 May 2018 15:23:37 +0000 (17:23 +0200)
commit3a0d465d4c53c5d8e23ed6d14eed8526291e1da3
treec05d7c09ac0f7adaa3ba23f76d09162494bb42f2
parente87923a9be65e0f3ebd1e45d116a2618b6dcfe07
eal: fix use-after-free on control thread creation

After below commit, we encounter some strange issue:
  1) Dead lock as described here:
     http://dpdk.org/ml/archives/dev/2018-April/099806.html
  2) SIGSEGV issue when starting a testpmd in VM.

Considering below commit changes to use dynamic memory instead of
stack for memory barrier, we doubt it's caused by use-after-free.

Fixes: 3d09a6e26d8b ("eal: fix threads block on barrier")

Reported-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reported-by: Lei Yao <lei.a.yao@intel.com>
Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Suggested-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_eal/common/eal_common_thread.c