<div dir="ltr">IMHO, doing hardening and security should be left the individual distributions and the package maintainers. Generally, each distribution has it&#39;s own policies with regards to hardening and security. We as an upstream project cannot decide on what a distribution should do. But we should be ready to fix bugs that could arise when distributions do hardened builds.<div><br></div><div>So, I vote against having these hardening flags added to the base GlusterFS build. But we could add the flags the Fedora spec files which we carry with our source.</div><div><br></div><div>~kaushal</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 31, 2015 at 11:49 AM, Atin Mukherjee <span dir="ltr">&lt;<a href="mailto:amukherj@redhat.com" target="_blank">amukherj@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Folks,<br>
<br>
There are some projects which uses compiler/glibc features to strengthen<br>
the security claims. Popular distros suggest to harden daemon with<br>
RELRO/PIE flags. You could see [1] [2] [3]<br>
<br>
Partial relro is when you have -Wl,-z,relro in the LDFLAGS for building<br>
libraries. Partial relro means that some ELF sections are reordered so<br>
that overflows in some likely sections don&#39;t affect others and the local<br>
offset table is readonly. To get full relro, you also need to have:<br>
-Wl,-z,bind_now added to LDFLAGS. What this does is make the Global<br>
Offset table and Procedure Lookup Table readonly. This takes<br>
some time, so its only worth it for apps that have a real possibility of<br>
being attacked. This would be setuid/setgid/setcap and daemons. There<br>
are some security critical apps that can have this too. If the apps<br>
likely parses files from an untrusted source (internet), then it might<br>
also want to have full relro.<br>
<br>
To enable PIE, you would pass -fPIE -DPIE in the CFLAGS and -pie in the<br>
LDFLAGS. What PIE does is randomize the locations of important items<br>
such as the base address of an executable and position of libraries,<br>
heap, and stack, in a process&#39;s address space. Sometimes this is called<br>
ASLR. Its designed to make buffer/heap overflow, return into libc<br>
attacks much harder. Part of the way it does this is to make a new<br>
section in the ELF image that is writable to redirect function calls to<br>
the correct address (offsets). This has to be writable because each<br>
invocation will have different layouts and needs to be fixed up. So,<br>
when you have an application with PIE, you want full relro so that<br>
these sections become readonly and not part of an attacker&#39;s target areas.<br>
<br>
I would like to hear from the community whether we should introduce<br>
these hardening flags in glusterfs as well.<br>
<br>
[1] <a href="https://fedorahosted.org/fesco/ticket/563" target="_blank">https://fedorahosted.org/fesco/ticket/563</a><br>
[2] <a href="https://wiki.debian.org/Hardening" target="_blank">https://wiki.debian.org/Hardening</a><br>
[3] <a href="https://wiki.ubuntu.com/Security/Features#relro" target="_blank">https://wiki.ubuntu.com/Security/Features#relro</a><br>
<span class="HOEnZb"><font color="#888888">--<br>
~Atin<br>
_______________________________________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a><br>
<a href="http://www.gluster.org/mailman/listinfo/gluster-devel" target="_blank">http://www.gluster.org/mailman/listinfo/gluster-devel</a><br>
</font></span></blockquote></div><br></div>