From 462aa346c6a30970e7786dcf05dd52732585cbca Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Mon, 26 Nov 2007 18:47:26 -0500 Subject: [PATCH] --- yaml --- r: 74642 b: refs/heads/master c: 8869477a49c3e99def1fcdadd6bbc407fea14b45 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/mm/mmap.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 4c667ad26c19..392f406eb92b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ab5a91a8364c3d6fc617abc47cc81d162c01d90a +refs/heads/master: 8869477a49c3e99def1fcdadd6bbc407fea14b45 diff --git a/trunk/mm/mmap.c b/trunk/mm/mmap.c index facc1a75bd4f..938313c76d02 100644 --- a/trunk/mm/mmap.c +++ b/trunk/mm/mmap.c @@ -1615,6 +1615,12 @@ static inline int expand_downwards(struct vm_area_struct *vma, */ if (unlikely(anon_vma_prepare(vma))) return -ENOMEM; + + address &= PAGE_MASK; + error = security_file_mmap(0, 0, 0, 0, address, 1); + if (error) + return error; + anon_vma_lock(vma); /* @@ -1622,8 +1628,6 @@ static inline int expand_downwards(struct vm_area_struct *vma, * is required to hold the mmap_sem in read mode. We need the * anon_vma lock to serialize against concurrent expand_stacks. */ - address &= PAGE_MASK; - error = 0; /* Somebody else might have raced and expanded it already */ if (address < vma->vm_start) {