Modify tests to use executable memory.
The check_unreadble_elf_* tests only create a readable map. I changed libunwind to disallow unwinding through non-executable maps, so make the maps executable too. Bug: 26589772 Change-Id: Idbe6426ac4d3243779b819c8f1aebdcdacb0669f
This commit is contained in:
parent
3472410eac
commit
61c48ac854
1 changed files with 2 additions and 2 deletions
|
@ -1156,7 +1156,7 @@ TEST(libbacktrace, check_unreadable_elf_local) {
|
|||
int fd = open(tmp_so_name, O_RDONLY);
|
||||
ASSERT_TRUE(fd != -1);
|
||||
|
||||
void* map = mmap(NULL, map_size, PROT_READ, MAP_PRIVATE, fd, 0);
|
||||
void* map = mmap(NULL, map_size, PROT_READ | PROT_EXEC, MAP_PRIVATE, fd, 0);
|
||||
ASSERT_TRUE(map != MAP_FAILED);
|
||||
close(fd);
|
||||
ASSERT_TRUE(unlink(tmp_so_name) != -1);
|
||||
|
@ -1206,7 +1206,7 @@ TEST(libbacktrace, check_unreadable_elf_remote) {
|
|||
exit(0);
|
||||
}
|
||||
|
||||
void* map = mmap(NULL, map_size, PROT_READ, MAP_PRIVATE, fd, 0);
|
||||
void* map = mmap(NULL, map_size, PROT_READ | PROT_EXEC, MAP_PRIVATE, fd, 0);
|
||||
if (map == MAP_FAILED) {
|
||||
fprintf(stderr, "Failed to map in memory: %s\n", strerror(errno));
|
||||
unlink(tmp_so_name);
|
||||
|
|
Loading…
Reference in a new issue