Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45992
b: refs/heads/master
c: 0d59a01
h: refs/heads/master
v: v3
  • Loading branch information
Adam Litke authored and Linus Torvalds committed Jan 31, 2007
1 parent 328d97d commit 89bbe8d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bcdddfb66cc998252d34758ce4109cedc0d24a5c
refs/heads/master: 0d59a01bc461bbab4017ff449b8401151ef44cf6
7 changes: 7 additions & 0 deletions trunk/mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,7 @@ static int acct_stack_growth(struct vm_area_struct * vma, unsigned long size, un
{
struct mm_struct *mm = vma->vm_mm;
struct rlimit *rlim = current->signal->rlim;
unsigned long new_start;

/* address space limit tests */
if (!may_expand_vm(mm, grow))
Expand All @@ -1496,6 +1497,12 @@ static int acct_stack_growth(struct vm_area_struct * vma, unsigned long size, un
return -ENOMEM;
}

/* Check to ensure the stack will not grow into a hugetlb-only region */
new_start = (vma->vm_flags & VM_GROWSUP) ? vma->vm_start :
vma->vm_end - size;
if (is_hugepage_only_range(vma->vm_mm, new_start, size))
return -EFAULT;

/*
* Overcommit.. This must be the final test, as it will
* update security statistics.
Expand Down

0 comments on commit 89bbe8d

Please sign in to comment.