Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Issues
  • #329
Closed
Open
Issue created Nov 28, 2014 by Derek Bruening@derekbrueningContributor

[APP CRASH] DR Fails to deliver signal when BB crosses a page boundary into a non-executable page

From peterfeiner on July 29, 2010 15:59:43

A similar problem: What steps will reproduce the problem? Compile the following program on 64-bit Linux:

#include <assert.h> #include <unistd.h> #include <sys/mman.h> #include <stdio.h>

int main(int argc, char* argv[]) {

// 1. Allocate two contiguous pages, the first with RWX permissions, the second RW-. // 2. Emit the following code // mov rax, 42 // ret // such that the RET instruction is stored on the first byte of the second page. // 3. Call the emitted code.

unsigned char* m = (unsigned char_) mmap(NULL, getpagesize() * 2, PROT_WRITE | PROT_READ, MAP_ANONYMOUS | MAP_SHARED, -1, 0); assert(m != MAP_FAILED); int mprotect_result = mprotect(m, getpagesize()_1, PROT_READ | PROT_WRITE | PROT_EXEC); assert(mprotect_result == 0);

unsigned char* code = m + getpagesize() - 7;

// mov rax, 42 code[0] = 0x48; code[1] = 0xc7; code[2] = 0xc0; code[3] = 0x2a; code[4] = 0x00; code[5] = 0x00; code[6] = 0x00;

// ret code[7] = 0xc3;

int x = ((int(*)(void)) code)();

printf("%d\n", x);

return argc; } What is the expected output? What do you see instead? I expect the program to crash as the result of an unhandled SEGV. Instead, under DR's control, the program prints 42 and exits cleanly. What version of the product are you using? On what operating system? Debug build of r379 on 64-bit Ubuntu 10.04. Please provide any additional information below.

Original issue: http://code.google.com/p/dynamorio/issues/detail?id=329

Assignee
Assign to
Time tracking