From 16f6579cb3e1214b1386fb530b8e16c8cbfdef33 Mon Sep 17 00:00:00 2001 From: Mohammed Rafi KC Date: Thu, 21 Jan 2016 12:41:55 +0530 Subject: protocol/server: Race between server_reconfigure and server_setvolume During server_reconfigure we authenticate each connected clients against the current options. To do this authentication we store previous values in a dictionary during the connection establishment phase (server_setvolume). If the authentication fails during reconfigure then we will disconnect the transport. Here it introduce a race between server_setvolume and reconfugure. If a reconfigure called before doing a setvolume, the transport will be disconnected Change-Id: Icce2c28a171481327a06efd3901f8a5ee67b05ab BUG: 1300564 Signed-off-by: Mohammed Rafi KC Reviewed-on: http://review.gluster.org/13271 Smoke: Gluster Build System Reviewed-by: Raghavendra G CentOS-regression: Gluster Build System Reviewed-by: Raghavendra Talur NetBSD-regression: NetBSD Build System --- xlators/protocol/server/src/server.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'xlators/protocol/server/src/server.c') diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index 3a4a81d349c..d07b840b3fc 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -822,6 +822,18 @@ reconfigure (xlator_t *this, dict_t *options) { list_for_each_entry (xprt, &conf->xprt_list, list) { /* check for client authorization */ + if (!xprt->clnt_options) { + /* If clnt_options dictionary is null, + * which means for this transport + * server_setvolume was not called. + * + * So here we can skip authentication + * because server_setvolume will do + * gf_authenticate. + * + */ + continue; + } ret = gf_authenticate (xprt->clnt_options, options, conf->auth_modules); if (ret == AUTH_ACCEPT) { -- cgit