From: Naoya Horiguchi Date: Wed, 17 Apr 2013 22:58:28 +0000 (-0700) Subject: fs/binfmt_elf.c: fix hugetlb memory check in vma_dump_size() X-Git-Tag: v3.8.9~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb586a6aac367fe5589ae115d470c2c2de45f6fb;p=thirdparty%2Fkernel%2Fstable.git fs/binfmt_elf.c: fix hugetlb memory check in vma_dump_size() commit 23d9e482136e31c9d287633a6e473daa172767c4 upstream. Documentation/filesystems/proc.txt says about coredump_filter bitmask, Note bit 0-4 doesn't effect any hugetlb memory. hugetlb memory are only effected by bit 5-6. However current code can go into the subsequent flag checks of bit 0-4 for vma(VM_HUGETLB). So this patch inserts 'return' and makes it work as written in the document. Signed-off-by: Naoya Horiguchi Reviewed-by: Rik van Riel Acked-by: Michal Hocko Reviewed-by: HATAYAMA Daisuke Acked-by: KOSAKI Motohiro Acked-by: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 0c42cdbabecff..5843a4740f641 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -1132,6 +1132,7 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma, goto whole; if (!(vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_PRIVATE)) goto whole; + return 0; } /* Do not dump I/O mapped devices or special mappings */