From 3d7b19cd1ecd53f0808b07df7c4ac801fd48f3c3 Mon Sep 17 00:00:00 2001 From: Santosh Kumar Pradhan Date: Thu, 3 Jul 2014 17:11:44 +0530 Subject: rpcsvc: Validate RPC procedure number before fetch While accessing the procedures of given RPC program in, rpcsvc_get_program_vector_sizer(), It was not checking boundary conditions which would cause buffer overflow and subsequently SEGV. Make sure rpcsvc_actor_t arrays have numactors number of actors. FIX: Validate the RPC procedure number before fetching the actor. Upstream main review: http://review.gluster.org/7726 BUG: 1096020 Change-Id: Iaf207ee976cb56fa9a554ec82c9eab36d3b289ed Signed-off-by: Santosh Kumar Pradhan Reviewed-on: http://review.gluster.org/8228 Tested-by: Gluster Build System Reviewed-by: Niels de Vos --- xlators/protocol/client/src/client-callback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/protocol/client/src/client-callback.c') diff --git a/xlators/protocol/client/src/client-callback.c b/xlators/protocol/client/src/client-callback.c index d886862f776..b2707cb395b 100644 --- a/xlators/protocol/client/src/client-callback.c +++ b/xlators/protocol/client/src/client-callback.c @@ -40,7 +40,7 @@ client_cbk_ino_flush (struct rpc_clnt *rpc, void *mydata, void *data) return 0; } -rpcclnt_cb_actor_t gluster_cbk_actors[] = { +rpcclnt_cb_actor_t gluster_cbk_actors[GF_CBK_MAXVALUE] = { [GF_CBK_NULL] = {"NULL", GF_CBK_NULL, client_cbk_null }, [GF_CBK_FETCHSPEC] = {"FETCHSPEC", GF_CBK_FETCHSPEC, client_cbk_fetchspec }, [GF_CBK_INO_FLUSH] = {"INO_FLUSH", GF_CBK_INO_FLUSH, client_cbk_ino_flush }, -- cgit