Re: executing code in mmapped memory

From: Dennis Handly (dhandly_at_cup.hp.com)
Date: 08/27/03

  • Next message: ECStahl: "Re: Memory Question"
    Date: 26 Aug 2003 20:56:10 -0700
    
    

    Anton Ertl (anton@mips.complang.tuwien.ac.at) wrote:
    : I allocate the memory for the code I generate at run-time with
    : mmap(next_address, size, PROT_EXEC|PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0)

    : As soon as the program tries to execute the first instruction in this
    : region, it produces a SIGSEGV
    : - the PA-RISC segmentation somehow gets in the way.

    This is probably it. How did you "call" this code?

    >From a register dump, what is sr4, sr5, pcsqh and pcoqh?
    Unfortunately gdb doesn't model the hardware and track the 96 bit PC value.


  • Next message: ECStahl: "Re: Memory Question"

    Relevant Pages

    • Re: Images and libraries
      ... In that case you are out of luck with ALLOTed memory, ... ALLOCATE. ... but I think the cost is rather minor compared to the cost ... M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html ...
      (comp.lang.forth)
    • Re: gforth/allocate
      ... and there is not enough virtual memory left to ... little program took 9ms real time, the same as the startup alone. ... I suspect the mechanism gForth uses for ALLOCATE would also work when the ... M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html ...
      (comp.lang.forth)
    • Re: Is there a maximum contiguous memory allocation?
      ... but could ALLOCATE it! ... allocate it if I had 2GB of physical memory! ... the amount of physical memory I have installed. ... Note that you can use raw VirtualAlloc to improve your ...
      (microsoft.public.vc.mfc)
    • [UNIX] Linux Kernel binfmt_elf ELF Loader Privilege Escalation
      ... Get your security news from a reliable source. ... or in other words to execute a new program. ... One of the Linux format loaders is the ELF (Executable and Linkable ... of the memory map header in the binary image and the program ...
      (Securiteam)
    • [SECURITY] iSEC advisory about binfmt_elf
      ... Linux kernel binfmt_elf loader vulnerabilities ... One of the Linux format loaders is the ELF (Executable and Linkable ... and the position of the memory map header in the binary image and ... An user may try to execute such a malicious binary with an unterminated ...
      (Linux-Kernel)