Re: Stack changes for a program on mulitple occasions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> You will see that if you repeat the above steps
> multiple times ( after the program exits), 
> the stack in 'pmap' output & 
> 'vsize' in ps output keeps changing , though 
> the Resident set size of the process remains 
> same across all invocations.
> 
> Could somebody please explain this behaviour . 

this is done deliberately for 2 reasons

1) Performance: By changing the stack to different positions, you get
less cache aliases, so you can use the cpu cache better
2) Security: By having a different and unpredictable stack place in
memory, stack based buffer overflow exploits are harder to create.
(and in combination with other security measures, really really hard ;)


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux