summaryrefslogtreecommitdiffstats
path: root/xlators/debug/io-stats
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2018-11-01 07:21:41 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2018-11-05 18:49:51 +0000
commitacb208221bfe3ac897d8eb4fbe18fa6c8aa9286e (patch)
tree8a68a8a66752096c748ed33123379c5bb94b4453 /xlators/debug/io-stats
parent49f1b76f471f0845a2c7edf69f5629226f73ad27 (diff)
io-stats: prevent taking file dump on server side
By allowing clients taking dump in a file on brick process, we are allowing compromised clients to create io-stats dumps on server, which can exhaust all the available inodes. Fixes: CVE-2018-14659 Fixes: bz#1644757 Change-Id: I32bfde9d4fe646d819a45e627805b928cae2e1ca Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators/debug/io-stats')
-rw-r--r--xlators/debug/io-stats/src/io-stats.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c
index 3b370f2..06a16c8 100644
--- a/xlators/debug/io-stats/src/io-stats.c
+++ b/xlators/debug/io-stats/src/io-stats.c
@@ -2930,6 +2930,15 @@ conditional_dump(dict_t *dict, char *key, data_t *value, void *data)
this = stub->this;
conf = this->private;
+ /* Don't do this on 'brick-side', only do this on client side */
+ /* Addresses CVE-2018-14659 */
+ if (this->ctx->process_mode != GF_CLIENT_PROCESS) {
+ gf_log(this->name, GF_LOG_DEBUG,
+ "taking io-stats dump using setxattr not permitted on brick."
+ " Use 'gluster profile' instead");
+ return -1;
+ }
+
/* Create a file name that is appended with the io-stats instance
name as well. This helps when there is more than a single io-stats
instance in the graph, or the client and server processes are running