Search code examples
redhatlibcbacktrace

Why libc enter address always change in redhat 7


I use backtrace() and backtrace_symbols() to get some information. outputs looks like:

./a.out

....
    (_Z8fun+0x1d( [0x400bb3]
    /lib64/libpthread.so.0 (+0x7dc5) [**0x7f2cb2b99dc5**]
    /lib64/libc.so.6(clone+0x6d) [**0x7fc20a61cd**]
...

In redhat 7, the bolder addrs is always change between times, while in redhat 6, the addrs looks fixed.


Solution

  • In redhat 7, the bolder addrs is always change between times, while in redhat 6, the addrs looks fixed

    The addresses change because most modern systems use Address Space Layout Randomization to make certain class of exploits harder.

    ASLR was introduced into the Linux kernel in 2001, and redhat-6.2 release predates this.

    P.S. Using such an old distribution for anything is ill-advised: you are missing 16 years worth of security and performance improvements.