diff options
author | Susant Palai <spalai@redhat.com> | 2015-06-04 22:37:11 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-06-13 01:13:56 -0700 |
commit | 1ea9c9a3d59d8c3ddf1e27e2939c136a4ed3c6e8 (patch) | |
tree | 3aa430681bf75467c2bd07ba58d994811505fc71 /xlators/mgmt/glusterd/src | |
parent | 6b97f339169dd86a3c3aad9cff9b3da83a40a614 (diff) |
glusterd: Buffer overflow causing crash for glusterd
Problem: In GLUSTERD_GET_DEFRAG_PROCESS we are using PATH_MAX (4096)
as the max size of the input for target path, but we have allocated
NAME_MAX (255) size of buffer for the target.
Now this crash is not seen with source install, but is seen with RPMS.
The reason is _foritfy_fail. This check happens when _FORTIFY_SOURCE
flag is enabled. This option tries to figure out possible
overflow scenarios like the bug here and does crash the process.
Change-Id: I26261be85936d2e94a526fdcaa8d3249f8af11c3
BUG: 1228093
Signed-off-by: Susant Palai <spalai@redhat.com>
Reviewed-on: http://review.gluster.org/11090
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: N Balachandran <nbalacha@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h index 7e3c8129a94..cad0b425fbd 100644 --- a/xlators/mgmt/glusterd/src/glusterd.h +++ b/xlators/mgmt/glusterd/src/glusterd.h @@ -597,9 +597,9 @@ typedef ssize_t (*gd_serialize_t) (struct iovec outmsg, void *args); #define GLUSTERD_GET_DEFRAG_PROCESS(path, volinfo) do { \ if (volinfo->rebal.defrag_cmd == GF_DEFRAG_CMD_START_TIER) \ - snprintf (path, PATH_MAX, "tier"); \ + snprintf (path, NAME_MAX, "tier"); \ else \ - snprintf (path, PATH_MAX, "rebalance"); \ + snprintf (path, NAME_MAX, "rebalance"); \ } while (0) #define GLUSTERD_GET_DEFRAG_DIR(path, volinfo, priv) do { \ |