Forum Discussion
Altera_Forum
Honored Contributor
15 years agostack address randomization
Hi,
I am trying to implement stack address randomization, by which i mean the stack (starting) address changes dynamically(by adding some random number) each time the same program is executed. I am not able to figure out which file/function in Micro C/OS II source code controls stack allocation address. I think once I figure out this, I can modify the stack address randomly. Any info/suggestion to figure out the source file which controls stack is highly appreciated. Thanks, Amjad1 Reply
- Altera_Forum
Honored Contributor
the stack pointer is initialized in the init function, befare main() is called. IIRC it is simply the highest memory pointer in the area reserved for heap.
The stack for each individual threads are specified by the user though the OsTaskCreate() / OsTaskCreateEx() functions. Those are a lot easier to control, so if your application is running from a thread I would start looking there.