+19
−1
Loading
Currently a request is only added to a list in jsonrpc connection structure (stored inside jsonrpc server data structure), when its response is ready to send. This means that until that point, we do not have its pointer available inside jsonrpc server data, so if a server is shut down, it cannot properly handle that request. Furthermore, when server's memory is freed and connection is closed before such a request is sent, `jsonrpc_server_send_response()` will still try to insert the request into connection queue, resulting in heap-use-after-free errors. To remedy that issue, this patch introduces a new list for outstanding requests and skips sending responses in case a connection is not available. Fixes #3052 Change-Id: I5ea6510d7cae5560654dbe2c18782e38eaa9fe97 Signed-off-by:Krzysztof Karas <krzysztof.karas@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19001 Tested-by:
SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by:
Jim Harris <jim.harris@gmail.com> Community-CI: Mellanox Build Bot Reviewed-by:
Konrad Sztyber <konrad.sztyber@intel.com>