ARM64: dts: rockchip: add ctrl-base for rk3399
[firefly-linux-kernel-4.4.55.git] / fs / binfmt_elf.c
index b0b9a779f9acb737c098efa68ba9e764da81db05..0c52941dd62c0d8ccb6d16b41472d9d6ad28fe5f 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/utsname.h>
 #include <linux/coredump.h>
 #include <linux/sched.h>
+#include <linux/dax.h>
 #include <asm/uaccess.h>
 #include <asm/param.h>
 #include <asm/page.h>
@@ -650,7 +651,7 @@ static unsigned long randomize_stack_top(unsigned long stack_top)
 
        if ((current->flags & PF_RANDOMIZE) &&
                !(current->personality & ADDR_NO_RANDOMIZE)) {
-               random_variable = (unsigned long) get_random_int();
+               random_variable = get_random_long();
                random_variable &= STACK_RND_MASK;
                random_variable <<= PAGE_SHIFT;
        }
@@ -1236,6 +1237,15 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma,
        if (vma->vm_flags & VM_DONTDUMP)
                return 0;
 
+       /* support for DAX */
+       if (vma_is_dax(vma)) {
+               if ((vma->vm_flags & VM_SHARED) && FILTER(DAX_SHARED))
+                       goto whole;
+               if (!(vma->vm_flags & VM_SHARED) && FILTER(DAX_PRIVATE))
+                       goto whole;
+               return 0;
+       }
+
        /* Hugetlb memory check */
        if (vma->vm_flags & VM_HUGETLB) {
                if ((vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_SHARED))