summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix-handle.h
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2018-11-08 11:02:32 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2018-11-09 14:04:35 +0000
commitf0b5816f775ee75d42946694f031e70616a98cd9 (patch)
tree223a4fad4eab7c4e3aad751126d072034a311a64 /xlators/storage/posix/src/posix-handle.h
parent9d9b9745c7e424f01e5526b23b1da17db263275e (diff)
server: don't allow '/' in basename
Server stack needs to have all the sort of validation, assuming clients can be compromized. It is possible for a compromized client to send basenames with paths with '/', and with that create files without permission on server. By sanitizing the basename, and not allowing anything other than actual directory as the parent for any entry creation, we can mitigate the effects of clients not able to exploit the server. Fixes: CVE-2018-14651 Fixes: bz#1647667 Change-Id: I5dc0da0da2713452ff2b65ac2ddbccf1a267dc20 Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix-handle.h')
-rw-r--r--xlators/storage/posix/src/posix-handle.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/storage/posix/src/posix-handle.h b/xlators/storage/posix/src/posix-handle.h
index 621f8f4d450..04ab0fa1dd5 100644
--- a/xlators/storage/posix/src/posix-handle.h
+++ b/xlators/storage/posix/src/posix-handle.h
@@ -142,9 +142,9 @@
break; \
} \
\
- if (strstr (loc->name, "../")) { \
+ if (strchr (loc->name, '/')) { \
gf_msg (this->name, GF_LOG_ERROR, 0, P_MSG_ENTRY_HANDLE_CREATE, \
- "'../' in name not allowed: (%s)", loc->name); \
+ "'/' in name not allowed: (%s)", loc->name); \
op_ret = -1; \
break; \
} \