This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to turn off PIE on Fedora?


On Fri, Dec 12, 2003 at 07:32:35PM -0800, Per Bothner wrote:
> Daniel Berlin wrote:
> 
> >[root@dberlin bin]# grep exec-shield /etc/sysctl.conf
> >kernel.exec-shield = 0
> >kernel.exec-shield-randomize = 0
> 
> Thanks for the quick response from you and Diego.  But
> I hope that isn't the official Red Hat answer.
> If Red Hat thinks PIE is useful then suggesting that
> people turn it off globally isn't an acceptable solution.
> If Red Hat doesn't think it is useful, then it shouldn't
> be enabled by default.

First of all, your question is not about disabling PIE
(which is an executable in a form of an ET_DYN object,
you disable PIE by simply relinking a binary as ET_EXEC executable
instead of -pie), but you want to disable randomization.

That can be disabled either globally as mentioned above,
or ATM using setarch i386 program for program and all processes
started by it (unless they use another setarch or call personality
syscall themselves).
I hope in the future there will be separate personality bits
for randomization, 3GB address space limitation and 32/64bit
uname -m selection, though that depends on Linus to accept
the personality changes at least.
Once there is an architecture independent bit for that,
surely gdb should disable randomization by default (but have
some command to allow it, e.g. from .gdbinit or its prompt),
similarly gcc/g++/gcj etc. drivers should IMHO disable randomization
for the compiler backend.
For now setarch i386 gdb works for me.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]