Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138497
b: refs/heads/master
c: 501cb16
h: refs/heads/master
i:
  138495: dd4ac4b
v: v3
  • Loading branch information
Anton Blanchard authored and Benjamin Herrenschmidt committed Feb 23, 2009
1 parent 86ec4f2 commit e6ef070
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 002b0ec73dd8b784004e5a013ad9f2fa6274af5a
refs/heads/master: 501cb16d3cfdcca99ac26fe122079f2a43b046b8
3 changes: 2 additions & 1 deletion trunk/arch/powerpc/include/asm/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ typedef elf_fpreg_t elf_vsrreghalf_t32[ELF_NVSRHALFREG];
the loader. We need to make sure that it is out of the way of the program
that it will "exec", and that there is sufficient room for the brk. */

#define ELF_ET_DYN_BASE (0x20000000)
extern unsigned long randomize_et_dyn(unsigned long base);
#define ELF_ET_DYN_BASE (randomize_et_dyn(0x20000000))

/*
* Our registers are always unsigned longs, whether we're a 32 bit
Expand Down
10 changes: 10 additions & 0 deletions trunk/arch/powerpc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -1170,3 +1170,13 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)

return ret;
}

unsigned long randomize_et_dyn(unsigned long base)
{
unsigned long ret = PAGE_ALIGN(base + brk_rnd());

if (ret < base)
return base;

return ret;
}

0 comments on commit e6ef070

Please sign in to comment.