Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 166202
b: refs/heads/master
c: 8bbde7a
h: refs/heads/master
v: v3
  • Loading branch information
Anton Blanchard authored and Benjamin Herrenschmidt committed Sep 24, 2009
1 parent 144799d commit ea2c006
Show file tree
Hide file tree
Showing 2 changed files with 17 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: 738ef42e32fe95553a424c04016b936c9f6c9afb
refs/heads/master: 8bbde7a7062facf8af35bcc9a64cbafe8f36f3cf
17 changes: 16 additions & 1 deletion trunk/arch/powerpc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,22 @@ static inline unsigned long brk_rnd(void)

unsigned long arch_randomize_brk(struct mm_struct *mm)
{
unsigned long ret = PAGE_ALIGN(mm->brk + brk_rnd());
unsigned long base = mm->brk;
unsigned long ret;

#ifdef CONFIG_PPC64
/*
* If we are using 1TB segments and we are allowed to randomise
* the heap, we can put it above 1TB so it is backed by a 1TB
* segment. Otherwise the heap will be in the bottom 1TB
* which always uses 256MB segments and this may result in a
* performance penalty.
*/
if (!is_32bit_task() && (mmu_highuser_ssize == MMU_SEGSIZE_1T))
base = max_t(unsigned long, mm->brk, 1UL << SID_SHIFT_1T);
#endif

ret = PAGE_ALIGN(base + brk_rnd());

if (ret < mm->brk)
return mm->brk;
Expand Down

0 comments on commit ea2c006

Please sign in to comment.