[Bugs] [Bug 1745965] glusterd fails to start due to SIGABRT dumping core

bugzilla at redhat.com bugzilla at redhat.com
Wed Aug 28 02:45:56 UTC 2019


https://bugzilla.redhat.com/show_bug.cgi?id=1745965



--- Comment #4 from Nithya Balachandran <nbalacha at redhat.com> ---
RCA: rpm builds use the following flags:

$ rpm --showrc | grep stack-protector
-13: __global_compiler_flags    -O2 -g -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions
-fstack-protector-strong -grecord-gcc-switches %{_hardened_cflags}
%{_annotated_cflags}Thanks to Nithya for mentioning the presence of
-fstack-protector
flag as a probable cause resulting in the crash which lead me to
check default rpm build macros.
-D_FORTIFY_SOURCE=2 checks for buffer overruns and aborts the process if it
finds any.

>From the coredump:


#8  init (this=0x557ef9f3b510) at glusterd.c:1450
1450            len = snprintf(logdir, PATH_MAX, "%s",
DEFAULT_LOG_FILE_DIRECTORY);


But

char logdir[VALID_GLUSTERD_PATHMAX] = {0,};

#define VALID_GLUSTERD_PATHMAX (PATH_MAX - (256 + 64))

so this can cause a buffer overrun.


More info at:
https://stackoverflow.com/questions/13517526/difference-between-gcc-d-fortify-source-1-and-d-fortify-source-2

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Bugs mailing list