From bae3b86cc44adb43fb70f674da1d9e31c60bba96 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Thu, 9 Jan 2014 20:22:58 +0530 Subject: protocol/server: copy the response into the payload instead of using the pointer The response structure filled up in server_submit_reply is local to the function (i.e stack allocated) whose address is stored in the barrier payload to use later while sending the replies. But after the function is exited (server_submit_reply) the pointer is not valid and contains invalid data, which either leads in a segfault due to illegal memory access or reply not being sent as the total length of the reply obtained from that memory might not be valid. So instead of saving the pointer inside the payload, save the complete reply itself. Change-Id: I7d0b7b181584865199357a67165b99bf35def5ab Signed-off-by: Raghavendra Bhat --- rpc/rpc-transport/socket/src/socket.c | 1 + 1 file changed, 1 insertion(+) (limited to 'rpc') diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index 93da3f296..3314c92d4 100644 --- a/rpc/rpc-transport/socket/src/socket.c +++ b/rpc/rpc-transport/socket/src/socket.c @@ -3138,6 +3138,7 @@ socket_submit_reply (rpc_transport_t *this, rpc_transport_reply_t *reply) } priv->submit_log = 0; + entry = __socket_ioq_new (this, &reply->msg); if (!entry) goto unlock; -- cgit