GDB Stack Randomized with disable-randomization on

-1

According to https://visualgdb.com/gdbreference/commands/set_disable-randomization if I want the stack to have ASLR disabled in gdb it should be enabled by default but even beyond that I just can call set disable-randomization on. However, my stack pointers keep changing between runs within a single gdb instance. Below is a copy of my gdb output note how ebp's address is wildly different each time (I've purged the prompts between run calls).

(gdb) run < tmp2
...
Breakpoint 2, 0x08048795 in main ()
(gdb) x $ebp
0xffb18d98:     0x00000000
(gdb) run < tmp2
...
Breakpoint 2, 0x08048795 in main ()
(gdb) x $ebp
0xff997f08:     0x00000000
(gdb) run < tmp2
...
Breakpoint 2, 0x08048795 in main ()
(gdb) x $ebp
0xff9070f8:     0x00000000

I could provide code samples but seeing as I'm breakpointing on main and printing the base pointer I don't think the program is specifically the problem. The code was also built with -fno-stack-protector so between that and the disable-randomization I do not understand why ebp is so wildly different.

What can I do to make the stack no swing around so much?

security
assembly
x86
stack
asked on Stack Overflow Jun 20, 2020 by arduic

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0