Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 230965
b: refs/heads/master
c: 9046e40
h: refs/heads/master
i:
  230963: 116af82
v: v3
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Jan 12, 2011
1 parent 5f9cefc commit 9c09c65
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: 7a63fa1a85d75756368d9c86fff5c1b193de991c
refs/heads/master: 9046e401e752dba784805a7818f99cc45a39cbff
2 changes: 2 additions & 0 deletions trunk/arch/s390/include/asm/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ do { \
current->mm->context.noexec == 0; \
})

#define STACK_RND_MASK 0x7ffUL

#define ARCH_DLINFO \
do { \
if (vdso_enabled) \
Expand Down
11 changes: 10 additions & 1 deletion trunk/arch/s390/mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@
#include <asm/pgalloc.h>
#include <asm/compat.h>

static unsigned long stack_maxrandom_size(void)
{
if (!(current->flags & PF_RANDOMIZE))
return 0;
if (current->personality & ADDR_NO_RANDOMIZE)
return 0;
return STACK_RND_MASK << PAGE_SHIFT;
}

/*
* Top of mmap area (just below the process stack).
*
Expand All @@ -47,7 +56,7 @@ static inline unsigned long mmap_base(void)
else if (gap > MAX_GAP)
gap = MAX_GAP;

return STACK_TOP - (gap & PAGE_MASK);
return STACK_TOP - stack_maxrandom_size() - (gap & PAGE_MASK);
}

static inline int mmap_is_legacy(void)
Expand Down

0 comments on commit 9c09c65

Please sign in to comment.