ipc: fix use-after-free in synchronous requests
authorAnatoly Burakov <anatoly.burakov@intel.com>
Fri, 13 Apr 2018 11:54:59 +0000 (12:54 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 16 Apr 2018 23:27:21 +0000 (01:27 +0200)
commitfe98e52a52f0989c299883bf7c231b64ae1cd242
tree7bac2bdfac380c7bc9dc5c2b45b4b42b2731a62f
parent2ae831fb42b1aa273cf4ef20775fa964463be083
ipc: fix use-after-free in synchronous requests

Previously, we were adding synchronous requests to request list, we
were doing it after checking if request existed. However, we only
removed the request from the request list if we have succeeded in
sending the request. In case of failed request send, we left an
invalid pointer in the request list.

Fix this by only adding request to the list once we succeed in
sending it.

Fixes: 783b6e54971d ("eal: add synchronous multi-process communication")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
lib/librte_eal/common/eal_common_proc.c