Linux x86_64 Process Memory space layout

Source: Internet
Author: User

For Linux 32-bit memory space layout, you can refer to this blog post Linux C program process address Space Bureau of the source code in the various data types/code in the ELF format files and process space in the segment, under X86_64 and i386 is similar, This paper focuses on the macro layout of process space memory under the influence of Vm.legacy_va_layout and Kernel.randomize_va_space parameters.

Scenario One:
    • Vm_legacy_va_layout=1
    • Kernel.randomize_va_space=0
      In this case, the traditional memory layout mode is used, and the randomization is not turned on.
      Memory layout for CAT programs

      Can be seen:
      Code Snippet:0x400000–>
      Data segment
      Heap: Upward growth 2aaaaaaab000–>
      Stack: 7ffffffde000<–7ffffffff000
      System call: ffffffffff600000-ffffffffff601000
      You can try other programs, and the heap start is constant at kernel.randomize_va_space=0.
Scenario Two:
    • Vm_legacy_va_layout=0
    • Kernel.randomize_va_space=0
      Now default memory layout, not randomization

      Can be seen:
      Code Snippet:0x400000–>
      Data segment
      Heap: Downward growth <–7ffff7fff000
      Stack: 7ffffffde000<–7ffffffff000
      System call: ffffffffff600000-ffffffffff601000
Scenario Three:
    • Vm_legacy_va_layout=0
    • kernel.randomize_va_space=2//ubuntu 14.04 Default value
      Use the default layout now, Randomize


      Compared to the two-boot cat program, the starting point of the memory layout heap is variable, which prevents buffer overflow attacks to a certain extent.
Scenario Four:
    • Vm_legacy_va_layout=1
    • kernel.randomize_va_space=2//ubuntu 14.04 Default value
      Similar to the situation three, no longer repeat

Linux x86_64 Process Memory space layout

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.