887953
From bff03720f92bfcde848f46dca6a2cfad7adaf42e Mon Sep 17 00:00:00 2001
887953
From: Amar Tumballi <amarts@redhat.com>
887953
Date: Tue, 9 Oct 2018 12:32:41 +0530
887953
Subject: [PATCH 399/399] all: fix the format string exceptions
887953
887953
Currently, there are possibilities in few places, where a user-controlled
887953
(like filename, program parameter etc) string can be passed as 'fmt' for
887953
printf(), which can lead to segfault, if the user's string contains '%s',
887953
'%d' in it.
887953
887953
While fixing it, makes sense to make the explicit check for such issues
887953
across the codebase, by making the format call properly.
887953
887953
Fixes: CVE-2018-14661
887953
887953
BUG: 1637084
887953
Change-Id: I63d6b65c61106f77c55f0922dc08a5b8fe421f23
887953
Signed-off-by: Amar Tumballi <amarts@redhat.com>
887953
Reviewed-on: https://code.engineering.redhat.com/gerrit/152221
887953
Reviewed-by: Xavi Hernandez <xhernandez@redhat.com>
887953
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
887953
---
887953
 cli/src/cli-cmd-volume.c                            |  2 +-
887953
 libglusterfs/src/client_t.c                         |  2 +-
887953
 libglusterfs/src/fd.c                               |  4 ++--
887953
 libglusterfs/src/inode.c                            |  2 +-
887953
 libglusterfs/src/iobuf.c                            |  8 ++++----
887953
 libglusterfs/src/latency.c                          |  2 +-
887953
 libglusterfs/src/logging.h                          |  3 ++-
887953
 libglusterfs/src/mem-pool.h                         |  3 ++-
887953
 libglusterfs/src/run.h                              |  3 ++-
887953
 libglusterfs/src/statedump.h                        |  6 ++++--
887953
 xlators/cluster/afr/src/afr-common.c                |  2 +-
887953
 xlators/cluster/ec/src/ec.c                         |  2 +-
887953
 xlators/debug/trace/src/trace.c                     |  2 +-
887953
 xlators/features/barrier/src/barrier.c              |  4 ++--
887953
 xlators/features/gfid-access/src/gfid-access.c      |  2 +-
887953
 xlators/features/locks/src/posix.c                  | 10 +++++-----
887953
 xlators/features/shard/src/shard.c                  |  2 +-
887953
 xlators/mgmt/glusterd/src/glusterd-rebalance.c      |  2 +-
887953
 xlators/mgmt/glusterd/src/glusterd-statedump.c      |  2 +-
887953
 xlators/mount/fuse/src/fuse-bridge.c                |  2 +-
887953
 xlators/performance/io-cache/src/io-cache.c         |  8 ++++----
887953
 xlators/performance/io-threads/src/io-threads.c     |  2 +-
887953
 xlators/performance/md-cache/src/md-cache.c         |  2 +-
887953
 xlators/performance/nl-cache/src/nl-cache-helper.c  |  2 +-
887953
 xlators/performance/nl-cache/src/nl-cache.c         |  2 +-
887953
 xlators/performance/open-behind/src/open-behind.c   |  4 ++--
887953
 xlators/performance/quick-read/src/quick-read.c     |  4 ++--
887953
 xlators/performance/read-ahead/src/read-ahead.c     |  6 +++---
887953
 xlators/performance/write-behind/src/write-behind.c |  6 +++---
887953
 xlators/protocol/client/src/client.c                |  2 +-
887953
 xlators/protocol/server/src/server.c                |  2 +-
887953
 xlators/storage/posix/src/posix.c                   |  2 +-
887953
 32 files changed, 56 insertions(+), 51 deletions(-)
887953
887953
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
887953
index 2639afa..a1f0840 100644
887953
--- a/cli/src/cli-cmd-volume.c
887953
+++ b/cli/src/cli-cmd-volume.c
887953
@@ -2846,7 +2846,7 @@ cli_launch_glfs_heal (int heal_op, dict_t *options)
887953
                 runner_add_args (&runner, "source-brick", NULL);
887953
                 runner_argprintf (&runner, "%s:%s", hostname, path);
887953
                 if (dict_get_str (options, "file", &filename) == 0)
887953
-                        runner_argprintf (&runner, filename);
887953
+                        runner_argprintf (&runner, "%s", filename);
887953
                 break;
887953
         case GF_SHD_OP_SPLIT_BRAIN_FILES:
887953
                 runner_add_args (&runner, "split-brain-info", NULL);
887953
diff --git a/libglusterfs/src/client_t.c b/libglusterfs/src/client_t.c
887953
index 17e3026..dce27c1 100644
887953
--- a/libglusterfs/src/client_t.c
887953
+++ b/libglusterfs/src/client_t.c
887953
@@ -650,7 +650,7 @@ clienttable_dump (clienttable_t *clienttable, char *prefix)
887953
                             clienttable->cliententries[i].next_free) {
887953
                                 gf_proc_dump_build_key(key, prefix,
887953
                                                        "cliententry[%d]", i);
887953
-                                gf_proc_dump_add_section(key);
887953
+                                gf_proc_dump_add_section("%s", key);
887953
                                 cliententry_dump(&clienttable->cliententries[i],
887953
                                                  key);
887953
                         }
887953
diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c
887953
index 2dc52ba..27c8e13 100644
887953
--- a/libglusterfs/src/fd.c
887953
+++ b/libglusterfs/src/fd.c
887953
@@ -1056,7 +1056,7 @@ fd_dump (fd_t *fd, char *prefix)
887953
 
887953
         if (fd->inode) {
887953
                 gf_proc_dump_build_key (key, "inode", NULL);
887953
-                gf_proc_dump_add_section(key);
887953
+                gf_proc_dump_add_section("%s", key);
887953
                 inode_dump (fd->inode, key);
887953
         }
887953
 
887953
@@ -1104,7 +1104,7 @@ fdtable_dump (fdtable_t *fdtable, char *prefix)
887953
                 if (GF_FDENTRY_ALLOCATED ==
887953
                     fdtable->fdentries[i].next_free) {
887953
                         gf_proc_dump_build_key(key, prefix, "fdentry[%d]", i);
887953
-                        gf_proc_dump_add_section(key);
887953
+                        gf_proc_dump_add_section("%s", key);
887953
                         fdentry_dump(&fdtable->fdentries[i], key);
887953
                 }
887953
         }
887953
diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c
887953
index cf264d8..1bc05a4 100644
887953
--- a/libglusterfs/src/inode.c
887953
+++ b/libglusterfs/src/inode.c
887953
@@ -31,7 +31,7 @@
887953
                 list_for_each_entry (inode, head, list) {               \
887953
                         gf_proc_dump_build_key(key_buf, key_prefix,     \
887953
                                                "%s.%d",list_type, i++); \
887953
-                        gf_proc_dump_add_section(key_buf);              \
887953
+                        gf_proc_dump_add_section("%s", key_buf);        \
887953
                         inode_dump(inode, key);                         \
887953
                 }                                                       \
887953
         }
887953
diff --git a/libglusterfs/src/iobuf.c b/libglusterfs/src/iobuf.c
887953
index 76584fc..f6b8558 100644
887953
--- a/libglusterfs/src/iobuf.c
887953
+++ b/libglusterfs/src/iobuf.c
887953
@@ -1174,7 +1174,7 @@ iobuf_arena_info_dump (struct iobuf_arena *iobuf_arena, const char *key_prefix)
887953
         gf_proc_dump_write(key, "%"PRIu64, iobuf_arena->page_size);
887953
         list_for_each_entry (trav, &iobuf_arena->active.list, list) {
887953
                 gf_proc_dump_build_key(key, key_prefix,"active_iobuf.%d", i++);
887953
-                gf_proc_dump_add_section(key);
887953
+                gf_proc_dump_add_section("%s", key);
887953
                 iobuf_info_dump(trav, key);
887953
         }
887953
 
887953
@@ -1215,21 +1215,21 @@ iobuf_stats_dump (struct iobuf_pool *iobuf_pool)
887953
                 list_for_each_entry (trav, &iobuf_pool->arenas[j], list) {
887953
                         snprintf(msg, sizeof(msg),
887953
                                  "arena.%d", i);
887953
-                        gf_proc_dump_add_section(msg);
887953
+                        gf_proc_dump_add_section("%s", msg);
887953
                         iobuf_arena_info_dump(trav,msg);
887953
                         i++;
887953
                 }
887953
                 list_for_each_entry (trav, &iobuf_pool->purge[j], list) {
887953
                         snprintf(msg, sizeof(msg),
887953
                                  "purge.%d", i);
887953
-                        gf_proc_dump_add_section(msg);
887953
+                        gf_proc_dump_add_section("%s", msg);
887953
                         iobuf_arena_info_dump(trav,msg);
887953
                         i++;
887953
                 }
887953
                 list_for_each_entry (trav, &iobuf_pool->filled[j], list) {
887953
                         snprintf(msg, sizeof(msg),
887953
                                  "filled.%d", i);
887953
-                        gf_proc_dump_add_section(msg);
887953
+                        gf_proc_dump_add_section("%s", msg);
887953
                         iobuf_arena_info_dump(trav,msg);
887953
                         i++;
887953
                 }
887953
diff --git a/libglusterfs/src/latency.c b/libglusterfs/src/latency.c
887953
index 1d75f5b..a890454 100644
887953
--- a/libglusterfs/src/latency.c
887953
+++ b/libglusterfs/src/latency.c
887953
@@ -169,7 +169,7 @@ gf_proc_dump_latency_info (xlator_t *xl)
887953
         int i;
887953
 
887953
         snprintf (key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.latency", xl->name);
887953
-        gf_proc_dump_add_section (key_prefix);
887953
+        gf_proc_dump_add_section ("%s", key_prefix);
887953
 
887953
         for (i = 0; i < GF_FOP_MAXVALUE; i++) {
887953
                 gf_proc_dump_build_key (key, key_prefix, "%s",
887953
diff --git a/libglusterfs/src/logging.h b/libglusterfs/src/logging.h
887953
index fd9a36d..4ed2a82 100644
887953
--- a/libglusterfs/src/logging.h
887953
+++ b/libglusterfs/src/logging.h
887953
@@ -172,7 +172,8 @@ int _gf_log_callingfn (const char *domain, const char *file,
887953
                        const char *fmt, ...)
887953
                        __attribute__ ((__format__ (__printf__, 6, 7)));
887953
 
887953
-int _gf_log_eh (const char *function, const char *fmt, ...);
887953
+int _gf_log_eh (const char *function, const char *fmt, ...)
887953
+  __attribute__ ((__format__ (__printf__, 2, 3)));
887953
 
887953
 
887953
 
887953
diff --git a/libglusterfs/src/mem-pool.h b/libglusterfs/src/mem-pool.h
887953
index 1272ad4..dfe1f9a 100644
887953
--- a/libglusterfs/src/mem-pool.h
887953
+++ b/libglusterfs/src/mem-pool.h
887953
@@ -86,7 +86,8 @@ int
887953
 gf_vasprintf (char **string_ptr, const char *format, va_list arg);
887953
 
887953
 int
887953
-gf_asprintf (char **string_ptr, const char *format, ...);
887953
+gf_asprintf (char **string_ptr, const char *format, ...)
887953
+  __attribute__ ((__format__ (__printf__, 2, 3)));
887953
 
887953
 void
887953
 __gf_free (void *ptr);
887953
diff --git a/libglusterfs/src/run.h b/libglusterfs/src/run.h
887953
index 1dc4bf9..e47ce11 100644
887953
--- a/libglusterfs/src/run.h
887953
+++ b/libglusterfs/src/run.h
887953
@@ -76,7 +76,8 @@ void runner_add_args (runner_t *runner, ...);
887953
  * @param runner pointer to runner_t instance
887953
  * @param format printf style format specifier
887953
  */
887953
-void runner_argprintf (runner_t *runner, const char *format, ...);
887953
+void runner_argprintf (runner_t *runner, const char *format, ...)
887953
+  __attribute__ ((__format__ (__printf__, 2, 3)));
887953
 
887953
 /**
887953
  * log a message about the command to be run.
887953
diff --git a/libglusterfs/src/statedump.h b/libglusterfs/src/statedump.h
887953
index 0a7a97e..ee97cdb 100644
887953
--- a/libglusterfs/src/statedump.h
887953
+++ b/libglusterfs/src/statedump.h
887953
@@ -73,9 +73,11 @@ void gf_proc_dump_cleanup(void);
887953
 
887953
 void gf_proc_dump_info(int signum, glusterfs_ctx_t *ctx);
887953
 
887953
-int gf_proc_dump_add_section(char *key,...);
887953
+int gf_proc_dump_add_section(char *key, ...)
887953
+  __attribute__ ((__format__ (__printf__, 1, 2)));
887953
 
887953
-int gf_proc_dump_write(char *key, char *value,...);
887953
+int gf_proc_dump_write(char *key, char *value, ...)
887953
+  __attribute__ ((__format__ (__printf__, 2, 3)));
887953
 
887953
 void inode_table_dump(inode_table_t *itable, char *prefix);
887953
 
887953
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
887953
index bded6a2..e8107c9 100644
887953
--- a/xlators/cluster/afr/src/afr-common.c
887953
+++ b/xlators/cluster/afr/src/afr-common.c
887953
@@ -4536,7 +4536,7 @@ afr_priv_dump (xlator_t *this)
887953
 
887953
         GF_ASSERT (priv);
887953
         snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type, this->name);
887953
-        gf_proc_dump_add_section(key_prefix);
887953
+        gf_proc_dump_add_section("%s", key_prefix);
887953
         gf_proc_dump_write("child_count", "%u", priv->child_count);
887953
         for (i = 0; i < priv->child_count; i++) {
887953
                 sprintf (key, "child_up[%d]", i);
887953
diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c
887953
index 9a23a45..9cb9580 100644
887953
--- a/xlators/cluster/ec/src/ec.c
887953
+++ b/xlators/cluster/ec/src/ec.c
887953
@@ -1316,7 +1316,7 @@ int32_t ec_dump_private(xlator_t *this)
887953
     GF_ASSERT(ec);
887953
 
887953
     snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type, this->name);
887953
-    gf_proc_dump_add_section(key_prefix);
887953
+    gf_proc_dump_add_section("%s", key_prefix);
887953
     gf_proc_dump_write("nodes", "%u", ec->nodes);
887953
     gf_proc_dump_write("redundancy", "%u", ec->redundancy);
887953
     gf_proc_dump_write("fragment_size", "%u", ec->fragment_size);
887953
diff --git a/xlators/debug/trace/src/trace.c b/xlators/debug/trace/src/trace.c
887953
index 451ef9a..34ac4ca 100644
887953
--- a/xlators/debug/trace/src/trace.c
887953
+++ b/xlators/debug/trace/src/trace.c
887953
@@ -3059,7 +3059,7 @@ trace_dump_history (xlator_t *this)
887953
         if (conf && conf->log_history == _gf_true) {
887953
                 gf_proc_dump_build_key (key_prefix, "xlator.debug.trace",
887953
                                         "history");
887953
-                gf_proc_dump_add_section (key_prefix);
887953
+                gf_proc_dump_add_section ("%s", key_prefix);
887953
                 eh_dump (this->history, NULL, dump_history_trace);
887953
         }
887953
         ret = 0;
887953
diff --git a/xlators/features/barrier/src/barrier.c b/xlators/features/barrier/src/barrier.c
887953
index ce3a255..8e964e8 100644
887953
--- a/xlators/features/barrier/src/barrier.c
887953
+++ b/xlators/features/barrier/src/barrier.c
887953
@@ -713,7 +713,7 @@ __barrier_dump_queue (barrier_priv_t *priv)
887953
 
887953
         list_for_each_entry (stub, &priv->queue, list) {
887953
                 snprintf (key, sizeof (key), "stub.%d", i++);
887953
-                gf_proc_dump_add_section (key);
887953
+                gf_proc_dump_add_section ("%s", key);
887953
                 barrier_dump_stub(stub, key);
887953
         }
887953
 
887953
@@ -735,7 +735,7 @@ barrier_dump_priv (xlator_t *this)
887953
                 return 0;
887953
 
887953
         gf_proc_dump_build_key (key, "xlator.features.barrier", "priv");
887953
-        gf_proc_dump_add_section (key);
887953
+        gf_proc_dump_add_section ("%s", key);
887953
 
887953
         LOCK (&priv->lock);
887953
         {
887953
diff --git a/xlators/features/gfid-access/src/gfid-access.c b/xlators/features/gfid-access/src/gfid-access.c
887953
index 7d75b09..aa8aac1 100644
887953
--- a/xlators/features/gfid-access/src/gfid-access.c
887953
+++ b/xlators/features/gfid-access/src/gfid-access.c
887953
@@ -1382,7 +1382,7 @@ ga_dump_inodectx (xlator_t *this, inode_t *inode)
887953
         if (ret == 0) {
887953
                 tmp_inode = (void*) value;
887953
                 gf_proc_dump_build_key (key_prefix, this->name, "inode");
887953
-                gf_proc_dump_add_section (key_prefix);
887953
+                gf_proc_dump_add_section ("%s", key_prefix);
887953
                 gf_proc_dump_write ("real-gfid", "%s",
887953
                                     uuid_utoa (tmp_inode->gfid));
887953
         }
887953
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c
887953
index c58e6ba..b434a08 100644
887953
--- a/xlators/features/locks/src/posix.c
887953
+++ b/xlators/features/locks/src/posix.c
887953
@@ -3292,7 +3292,7 @@ __dump_entrylks (pl_inode_t *pl_inode)
887953
                                           blocked, granted);
887953
                         }
887953
 
887953
-                        gf_proc_dump_write(key, tmp);
887953
+                        gf_proc_dump_write(key, "%s", tmp);
887953
 
887953
                         count++;
887953
                 }
887953
@@ -3313,7 +3313,7 @@ __dump_entrylks (pl_inode_t *pl_inode)
887953
                                   lkowner_utoa (&lock->owner), lock->client,
887953
                                   lock->connection_id, blocked);
887953
 
887953
-                        gf_proc_dump_write(key, tmp);
887953
+                        gf_proc_dump_write(key, "%s", tmp);
887953
 
887953
                         count++;
887953
                 }
887953
@@ -3364,7 +3364,7 @@ __dump_inodelks (pl_inode_t *pl_inode)
887953
                                       &lock->granted_time.tv_sec,
887953
                                       &lock->blkd_time.tv_sec,
887953
                                       _gf_true);
887953
-                        gf_proc_dump_write(key, tmp);
887953
+                        gf_proc_dump_write(key, "%s", tmp);
887953
 
887953
                         count++;
887953
                 }
887953
@@ -3380,7 +3380,7 @@ __dump_inodelks (pl_inode_t *pl_inode)
887953
                                       lock->client, lock->connection_id,
887953
                                       0, &lock->blkd_time.tv_sec,
887953
                                       _gf_false);
887953
-                        gf_proc_dump_write(key, tmp);
887953
+                        gf_proc_dump_write(key, "%s", tmp);
887953
 
887953
                         count++;
887953
                 }
887953
@@ -3421,7 +3421,7 @@ __dump_posixlks (pl_inode_t *pl_inode)
887953
                             &lock->owner, lock->client, NULL,
887953
                             &lock->granted_time.tv_sec, &lock->blkd_time.tv_sec,
887953
                             (lock->blocked)? _gf_false: _gf_true);
887953
-              gf_proc_dump_write(key, tmp);
887953
+              gf_proc_dump_write(key, "%s", tmp);
887953
 
887953
               count++;
887953
         }
887953
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c
887953
index d67cdf4..f5fb181 100644
887953
--- a/xlators/features/shard/src/shard.c
887953
+++ b/xlators/features/shard/src/shard.c
887953
@@ -5557,7 +5557,7 @@ shard_priv_dump (xlator_t *this)
887953
 
887953
         snprintf (key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type,
887953
                   this->name);
887953
-        gf_proc_dump_add_section (key_prefix);
887953
+        gf_proc_dump_add_section ("%s", key_prefix);
887953
         gf_proc_dump_write ("shard-block-size", "%s",
887953
                             gf_uint64_2human_readable (priv->block_size));
887953
         gf_proc_dump_write ("inode-count", "%d", priv->inode_count);
887953
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
887953
index 848e689..5ab828c 100644
887953
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
887953
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
887953
@@ -310,7 +310,7 @@ glusterd_handle_defrag_start (glusterd_volinfo_t *volinfo, char *op_errstr,
887953
         runner_add_arg (&runner, "--pid-file");
887953
         runner_argprintf (&runner, "%s",pidfile);
887953
         runner_add_arg (&runner, "-l");
887953
-        runner_argprintf (&runner, logfile);
887953
+        runner_argprintf (&runner, "%s", logfile);
887953
         if (volinfo->memory_accounting)
887953
                 runner_add_arg (&runner, "--mem-accounting");
887953
         if (dict_get_str (priv->opts, GLUSTERD_LOCALTIME_LOGGING_KEY,
887953
diff --git a/xlators/mgmt/glusterd/src/glusterd-statedump.c b/xlators/mgmt/glusterd/src/glusterd-statedump.c
887953
index d0a9705..8c2c4b5 100644
887953
--- a/xlators/mgmt/glusterd/src/glusterd-statedump.c
887953
+++ b/xlators/mgmt/glusterd/src/glusterd-statedump.c
887953
@@ -197,7 +197,7 @@ glusterd_dump_priv (xlator_t *this)
887953
                 return 0;
887953
 
887953
         gf_proc_dump_build_key (key, "xlator.glusterd", "priv");
887953
-        gf_proc_dump_add_section (key);
887953
+        gf_proc_dump_add_section ("%s", key);
887953
 
887953
         pthread_mutex_lock (&priv->mutex);
887953
         {
887953
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
887953
index 85cee73..1c4f4e4 100644
887953
--- a/xlators/mount/fuse/src/fuse-bridge.c
887953
+++ b/xlators/mount/fuse/src/fuse-bridge.c
887953
@@ -5189,7 +5189,7 @@ fuse_history_dump (xlator_t *this)
887953
 
887953
         gf_proc_dump_build_key (key_prefix, "xlator.mount.fuse",
887953
                                 "history");
887953
-        gf_proc_dump_add_section (key_prefix);
887953
+        gf_proc_dump_add_section ("%s", key_prefix);
887953
         eh_dump (this->history, NULL, dump_history_fuse);
887953
 
887953
         ret = 0;
887953
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c
887953
index 8963942..700d8c2 100644
887953
--- a/xlators/performance/io-cache/src/io-cache.c
887953
+++ b/xlators/performance/io-cache/src/io-cache.c
887953
@@ -2008,7 +2008,7 @@ ioc_inode_dump (xlator_t *this, inode_t *inode)
887953
                 if (gf_uuid_is_null (ioc_inode->inode->gfid))
887953
                         goto unlock;
887953
 
887953
-                gf_proc_dump_add_section (key_prefix);
887953
+                gf_proc_dump_add_section ("%s", key_prefix);
887953
                 section_added = _gf_true;
887953
 
887953
                 __inode_path (ioc_inode->inode, NULL, &path);
887953
@@ -2031,7 +2031,7 @@ unlock:
887953
 out:
887953
         if (ret && ioc_inode) {
887953
                 if (section_added == _gf_false)
887953
-                        gf_proc_dump_add_section (key_prefix);
887953
+                        gf_proc_dump_add_section ("%s", key_prefix);
887953
                 gf_proc_dump_write ("Unable to print the status of ioc_inode",
887953
                                     "(Lock acquisition failed) %s",
887953
                                     uuid_utoa (inode->gfid));
887953
@@ -2053,7 +2053,7 @@ ioc_priv_dump (xlator_t *this)
887953
         priv = this->private;
887953
 
887953
         gf_proc_dump_build_key (key_prefix, "io-cache", "priv");
887953
-        gf_proc_dump_add_section (key_prefix);
887953
+        gf_proc_dump_add_section ("%s", key_prefix);
887953
         add_section = _gf_true;
887953
 
887953
         ret = pthread_mutex_trylock (&priv->table_lock);
887953
@@ -2074,7 +2074,7 @@ out:
887953
                 if (!add_section) {
887953
                         gf_proc_dump_build_key (key_prefix, "xlator."
887953
                                                 "performance.io-cache", "priv");
887953
-                        gf_proc_dump_add_section (key_prefix);
887953
+                        gf_proc_dump_add_section ("%s", key_prefix);
887953
                 }
887953
                 gf_proc_dump_write ("Unable to dump the state of private "
887953
                                     "structure of io-cache xlator", "(Lock "
887953
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
887953
index 5c47072..41d48ab 100644
887953
--- a/xlators/performance/io-threads/src/io-threads.c
887953
+++ b/xlators/performance/io-threads/src/io-threads.c
887953
@@ -911,7 +911,7 @@ iot_priv_dump (xlator_t *this)
887953
         snprintf (key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type,
887953
                   this->name);
887953
 
887953
-        gf_proc_dump_add_section(key_prefix);
887953
+        gf_proc_dump_add_section("%s", key_prefix);
887953
 
887953
         gf_proc_dump_write("maximum_threads_count", "%d", conf->max_count);
887953
         gf_proc_dump_write("current_threads_count", "%d", conf->curr_count);
887953
diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c
887953
index 9d2eea6..e7452e9 100644
887953
--- a/xlators/performance/md-cache/src/md-cache.c
887953
+++ b/xlators/performance/md-cache/src/md-cache.c
887953
@@ -3087,7 +3087,7 @@ mdc_priv_dump (xlator_t *this)
887953
         conf = this->private;
887953
 
887953
         snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type, this->name);
887953
-        gf_proc_dump_add_section(key_prefix);
887953
+        gf_proc_dump_add_section("%s", key_prefix);
887953
 
887953
         gf_proc_dump_write("stat_hit_count", "%"PRId64,
887953
                            conf->mdc_counter.stat_hit.cnt);
887953
diff --git a/xlators/performance/nl-cache/src/nl-cache-helper.c b/xlators/performance/nl-cache/src/nl-cache-helper.c
887953
index 0b6c884..583d67b 100644
887953
--- a/xlators/performance/nl-cache/src/nl-cache-helper.c
887953
+++ b/xlators/performance/nl-cache/src/nl-cache-helper.c
887953
@@ -1177,7 +1177,7 @@ nlc_dump_inodectx (xlator_t *this, inode_t *inode)
887953
                 gf_proc_dump_build_key (key_prefix,
887953
                                         "xlator.performance.nl-cache",
887953
                                         "nlc_inode");
887953
-                gf_proc_dump_add_section (key_prefix);
887953
+                gf_proc_dump_add_section ("%s", key_prefix);
887953
 
887953
                 __inode_path (inode, NULL, &path);
887953
                 if (path != NULL) {
887953
diff --git a/xlators/performance/nl-cache/src/nl-cache.c b/xlators/performance/nl-cache/src/nl-cache.c
887953
index 7dad8d9..6365d82 100644
887953
--- a/xlators/performance/nl-cache/src/nl-cache.c
887953
+++ b/xlators/performance/nl-cache/src/nl-cache.c
887953
@@ -615,7 +615,7 @@ nlc_priv_dump (xlator_t *this)
887953
         conf = this->private;
887953
 
887953
         snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type, this->name);
887953
-        gf_proc_dump_add_section(key_prefix);
887953
+        gf_proc_dump_add_section("%s", key_prefix);
887953
 
887953
         gf_proc_dump_write("negative_lookup_hit_count", "%"PRId64,
887953
                            conf->nlc_counter.nlc_hit.cnt);
887953
diff --git a/xlators/performance/open-behind/src/open-behind.c b/xlators/performance/open-behind/src/open-behind.c
887953
index 3be35bc..2d77f2d 100644
887953
--- a/xlators/performance/open-behind/src/open-behind.c
887953
+++ b/xlators/performance/open-behind/src/open-behind.c
887953
@@ -897,7 +897,7 @@ ob_priv_dump (xlator_t *this)
887953
         gf_proc_dump_build_key (key_prefix, "xlator.performance.open-behind",
887953
                                 "priv");
887953
 
887953
-        gf_proc_dump_add_section (key_prefix);
887953
+        gf_proc_dump_add_section ("%s", key_prefix);
887953
 
887953
         gf_proc_dump_write ("use_anonymous_fd", "%d", conf->use_anonymous_fd);
887953
 
887953
@@ -926,7 +926,7 @@ ob_fdctx_dump (xlator_t *this, fd_t *fd)
887953
 
887953
         gf_proc_dump_build_key (key_prefix, "xlator.performance.open-behind",
887953
                                 "file");
887953
-        gf_proc_dump_add_section (key_prefix);
887953
+        gf_proc_dump_add_section ("%s", key_prefix);
887953
 
887953
         gf_proc_dump_write ("fd", "%p", fd);
887953
 
887953
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c
887953
index 61232c1..ca228b8 100644
887953
--- a/xlators/performance/quick-read/src/quick-read.c
887953
+++ b/xlators/performance/quick-read/src/quick-read.c
887953
@@ -748,7 +748,7 @@ qr_inodectx_dump (xlator_t *this, inode_t *inode)
887953
 
887953
         gf_proc_dump_build_key (key_prefix, "xlator.performance.quick-read",
887953
                                 "inodectx");
887953
-        gf_proc_dump_add_section (key_prefix);
887953
+        gf_proc_dump_add_section ("%s", key_prefix);
887953
 
887953
         gf_proc_dump_write ("entire-file-cached", "%s", qr_inode->data ? "yes" : "no");
887953
 
887953
@@ -794,7 +794,7 @@ qr_priv_dump (xlator_t *this)
887953
         gf_proc_dump_build_key (key_prefix, "xlator.performance.quick-read",
887953
                                 "priv");
887953
 
887953
-        gf_proc_dump_add_section (key_prefix);
887953
+        gf_proc_dump_add_section ("%s", key_prefix);
887953
 
887953
         gf_proc_dump_write ("max_file_size", "%d", conf->max_file_size);
887953
         gf_proc_dump_write ("cache_timeout", "%d", conf->cache_timeout);
887953
diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c
887953
index 242b579..74ddf49 100644
887953
--- a/xlators/performance/read-ahead/src/read-ahead.c
887953
+++ b/xlators/performance/read-ahead/src/read-ahead.c
887953
@@ -823,7 +823,7 @@ ra_fdctx_dump (xlator_t *this, fd_t *fd)
887953
                                 "xlator.performance.read-ahead",
887953
                                 "file");
887953
 
887953
-        gf_proc_dump_add_section (key_prefix);
887953
+        gf_proc_dump_add_section ("%s", key_prefix);
887953
 
887953
         ret = __inode_path (fd->inode, NULL, &path);
887953
         if (path != NULL) {
887953
@@ -1068,7 +1068,7 @@ ra_priv_dump (xlator_t *this)
887953
         gf_proc_dump_build_key (key_prefix, "xlator.performance.read-ahead",
887953
                                 "priv");
887953
 
887953
-        gf_proc_dump_add_section (key_prefix);
887953
+        gf_proc_dump_add_section ("%s", key_prefix);
887953
         add_section = _gf_true;
887953
 
887953
         ret = pthread_mutex_trylock (&conf->conf_lock);
887953
@@ -1086,7 +1086,7 @@ ra_priv_dump (xlator_t *this)
887953
 out:
887953
         if (ret && conf) {
887953
                 if (add_section == _gf_false)
887953
-                        gf_proc_dump_add_section (key_prefix);
887953
+                        gf_proc_dump_add_section ("%s", key_prefix);
887953
 
887953
                 gf_proc_dump_write ("Unable to dump priv",
887953
                                     "(Lock acquisition failed) %s", this->name);
887953
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
887953
index 478985a..ef02e18 100644
887953
--- a/xlators/performance/write-behind/src/write-behind.c
887953
+++ b/xlators/performance/write-behind/src/write-behind.c
887953
@@ -2763,7 +2763,7 @@ wb_priv_dump (xlator_t *this)
887953
         gf_proc_dump_build_key (key_prefix, "xlator.performance.write-behind",
887953
                                 "priv");
887953
 
887953
-        gf_proc_dump_add_section (key_prefix);
887953
+        gf_proc_dump_add_section ("%s", key_prefix);
887953
 
887953
         gf_proc_dump_write ("aggregate_size", "%d", conf->aggregate_size);
887953
         gf_proc_dump_write ("window_size", "%d", conf->window_size);
887953
@@ -2787,7 +2787,7 @@ __wb_dump_requests (struct list_head *head, char *prefix)
887953
                 gf_proc_dump_build_key (key_prefix, key, "%s",
887953
                                         (char *)gf_fop_list[req->fop]);
887953
 
887953
-                gf_proc_dump_add_section(key_prefix);
887953
+                gf_proc_dump_add_section("%s", key_prefix);
887953
 
887953
                 gf_proc_dump_write ("unique", "%"PRIu64, req->unique);
887953
 
887953
@@ -2859,7 +2859,7 @@ wb_inode_dump (xlator_t *this, inode_t *inode)
887953
         gf_proc_dump_build_key (key_prefix, "xlator.performance.write-behind",
887953
                                 "wb_inode");
887953
 
887953
-        gf_proc_dump_add_section (key_prefix);
887953
+        gf_proc_dump_add_section ("%s", key_prefix);
887953
 
887953
         __inode_path (inode, NULL, &path);
887953
         if (path != NULL) {
887953
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
887953
index 26b0907..674f1aa 100644
887953
--- a/xlators/protocol/client/src/client.c
887953
+++ b/xlators/protocol/client/src/client.c
887953
@@ -2855,7 +2855,7 @@ client_priv_dump (xlator_t *this)
887953
         gf_proc_dump_build_key(key_prefix, "xlator.protocol.client",
887953
                                "%s.priv", this->name);
887953
 
887953
-        gf_proc_dump_add_section(key_prefix);
887953
+        gf_proc_dump_add_section("%s", key_prefix);
887953
 
887953
         list_for_each_entry(tmp, &conf->saved_fds, sfd_pos) {
887953
                 sprintf (key, "fd.%d.remote_fd", i);
887953
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
887953
index d0e815e..3a429bc 100644
887953
--- a/xlators/protocol/server/src/server.c
887953
+++ b/xlators/protocol/server/src/server.c
887953
@@ -320,7 +320,7 @@ server_priv (xlator_t *this)
887953
                 return 0;
887953
 
887953
         gf_proc_dump_build_key (key, "xlator.protocol.server", "priv");
887953
-        gf_proc_dump_add_section (key);
887953
+        gf_proc_dump_add_section ("%s", key);
887953
 
887953
         ret = pthread_mutex_trylock (&conf->mutex);
887953
         if (ret != 0)
887953
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
887953
index f79dbda..7bfe780 100644
887953
--- a/xlators/storage/posix/src/posix.c
887953
+++ b/xlators/storage/posix/src/posix.c
887953
@@ -6960,7 +6960,7 @@ posix_priv (xlator_t *this)
887953
 
887953
         (void) snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s",
887953
                         this->type, this->name);
887953
-        gf_proc_dump_add_section(key_prefix);
887953
+        gf_proc_dump_add_section("%s", key_prefix);
887953
 
887953
         if (!this)
887953
                 return 0;
887953
-- 
887953
1.8.3.1
887953