x86: Don't randomize stack unless current->personality permits it
In-Reply-To: <[email protected]>
Quoted 5 lines · Al Boldi
Randomization on. Executable runs with 8x blips/hits. Randomization off. Executable runs without blips/hits.
With randomization off, a mere rename causes an 8x-slowdown to occur. Run this renamed executable through sh -c ./tstExec, and the slowdown disappears. Really weired :)
Does this help at all? I don't have a space heater^W^WPentium IV to test on.
arch/i386/kernel/process.c +1 -1
@@ -890,5 +890,5 @@ unsigned long arch_align_stack(unsigned {if (randomize_va_space) sp -=get_random_int () %8192 ; -return sp & ~0xf ; +return sp & ~0x7f ; }
Signature · 2 lines
Chuck "You can't read a newspaper if you can't read." --George W. Bush
Quoted 9 lines · Chuck Ebbert
Quoted 5 lines · Al Boldi
Randomization on. Executable runs with 8x blips/hits. Randomization off. Executable runs without blips/hits. With randomization off, a mere rename causes an 8x-slowdown to occur. Run this renamed executable through sh -c ./tstExec, and the slowdown disappears. Really weired :)
Does this help at all? I don't have a space heater^W^WPentium IV to test on.
P4 is not a space heater, it's a stove.
arch/i386/kernel/process.c unsigned long arch_align_stack(unsigned · line 894
Quoted 9 lines
arch/i386/kernel/process.c +1
-1@@ -890,5 +890,5 @@ unsigned long arch_align_stack(unsigned {if (randomize_va_space) sp -=get_random_int () %8192 ; -return sp & ~0xf ; +return sp & ~0x7f ; }
Thanks! That did the trick!
The weirdness is completely gone, as are the continuous slowdowns, but I still get these:
on mdk9.1/gcc3.2.2/2.6.17.4
# gcc -O3 tstExec.c # echo 0 > /proc/sys/kernel/randomize_va_space # while :; do ./a.out;done
5 5 5 5 5 5 13 5 13 5 msec 5 5 5 5 5 5 13 5 6 5 msec 5 5 5 5 5 5 7 5 6 5 msec 5 5 5 5 5 5 5 5 6 5 msec 5 5 5 5 5 5 5 5 6 5 msec 5 5 5 5 5 5 5 5 6 5 msec 5 5 5 5 5 5 5 5 6 5 msec 5 5 5 5 5 5 5 5 6 5 msec 5 5 5 5 5 5 5 5 6 5 msec 5 5 5 5 5 5 5 5 6 5 msec 5 5 5 5 5 5 5 5 6 5 msec 5 5 5 5 5 5 5 5 6 5 msec 5 5 5 5 5 5 5 5 6 5 msec 5 5 5 5 5 5 5 5 6 5 msec 5 5 5 5 5 5 5 5 6 5 msec 5 5 5 5 5 5 5 5 6 5 msec 5 5 5 5 5 5 5 5 6 5 msec 5 5 5 5 5 5 13 5 6 5 msec 5 5 5 5 5 5 5 5 6 5 msec 5 5 5 5 5 5 5 5 6 6 msec 5 5 5 5 5 5 5 5 6 5 msec 5 5 5 5 5 5 5 5 6 5 msec 5 5 5 5 5 5 13 5 6 5 msec 5 5 5 5 5 5 5 5 6 5 msec 5 5 5 5 5 5 5 5 6 5 msec
on mdk9.1/gcc3.2.2/2.6.17.4
# gcc -O3 tstExec.c # echo 1 > /proc/sys/kernel/randomize_va_space # while :; do ./a.out;done
5 5 5 5 5 5 13 5 13 5 msec 5 5 5 6 5 5 13 5 13 5 msec 5 5 5 5 5 5 13 5 6 5 msec 5 5 5 5 5 5 13 5 13 5 msec 5 5 5 5 5 5 6 5 6 5 msec 5 5 5 5 5 5 13 5 13 5 msec 5 5 5 5 5 5 13 5 13 5 msec 5 5 5 5 5 5 11 5 13 5 msec 5 5 5 5 5 5 13 5 13 5 msec 5 5 5 5 5 5 13 5 13 5 msec 5 5 6 5 5 5 13 5 13 5 msec 5 5 5 5 5 5 6 5 6 5 msec 5 5 5 5 5 5 6 5 6 5 msec 5 5 5 5 5 5 6 5 6 5 msec 5 5 5 5 5 5 13 5 6 5 msec 5 5 5 5 5 5 6 5 13 5 msec 5 5 5 5 5 5 13 5 13 5 msec 5 5 5 5 5 5 13 5 6 5 msec 5 5 5 5 5 5 6 5 6 5 msec 5 5 5 5 5 5 6 5 13 5 msec 5 5 5 5 5 5 13 5 13 5 msec 5 5 5 5 5 5 6 5 6 5 msec 5 5 5 5 5 5 6 5 13 5 msec 5 5 5 5 5 5 6 5 6 5 msec 5 5 5 5 5 5 13 5 6 5 msec 5 5 5 5 5 5 13 5 7 5 msec 5 5 5 5 5 5 13 5 13 5 msec 5 5 5 5 5 5 6 5 6 5 msec 5 5 5 5 5 5 6 5 6 5 msec
on rhel4/gcc4.0.1/2.6.17.4
# gcc -O3 tstExec.c # echo 0 > /proc/sys/kernel/randomize_va_space # while :; do ./a.out;done
5 5 5 5 5 5 5 5 5 5 msec 13 13 13 13 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 6 6 6 6 6 6 6 6 6 6 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 13 13 13 13 13 13 13 13 13 13 msec 5 5 5 5 5 5 5 5 5 5 msec 13 13 13 13 13 13 13 13 13 13 msec 13 13 13 13 13 13 13 13 13 13 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 13 13 13 13 13 13 13 13 13 13 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 5 6 5 5 5 5 5 5 5 5 msec
on rhel4/gcc4.0.1/2.6.17.4
# gcc -O3 tstExec.c # echo 1 > /proc/sys/kernel/randomize_va_space # while :; do ./a.out;done
13 13 13 13 13 13 13 13 13 13 msec 13 13 13 13 13 13 13 13 13 13 msec 5 5 5 5 5 5 5 5 5 5 msec 13 13 13 13 13 13 13 12 5 5 msec 13 13 13 13 13 13 13 13 13 13 msec 13 13 13 13 13 13 13 13 13 13 msec 13 13 13 13 13 13 13 13 13 14 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 13 13 13 13 13 13 13 13 13 13 msec 13 13 13 13 13 13 13 13 13 13 msec 5 5 5 5 5 5 5 5 5 5 msec 13 13 13 13 13 13 13 13 13 13 msec 5 5 5 5 5 5 5 5 5 5 msec 13 13 13 13 13 13 13 13 13 13 msec 5 5 5 5 5 5 5 5 5 5 msec 13 13 13 13 13 13 13 13 13 14 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec 5 5 5 5 5 5 5 5 5 5 msec
13 13 13 13 13 13 13 13 13 13 msec
5 5 5 5 5 5 5 5 5 5 msec
13 13 13 13 13 13 13 13 13 13 msec
Thanks again!
--
Al