Thread (5 messages) flat view 5 messages, 3 authors, 2016-08-10

Re: [PATCH v3] powerpc: Do not make the entire heap executable

From: Denys Vlasenko <hidden>
Date: 2016-08-10 18:56:26
Also in: linux-mm, lkml

On 08/10/2016 12:43 AM, Kees Cook wrote:
quoted
-static int do_brk(unsigned long addr, unsigned long len)
+static int do_brk_flags(unsigned long addr, unsigned long len, unsigned long flags)
 {
        struct mm_struct *mm = current->mm;
        struct vm_area_struct *vma, *prev;
-       unsigned long flags;
        struct rb_node **rb_link, *rb_parent;
        pgoff_t pgoff = addr >> PAGE_SHIFT;
        int error;
@@ -2666,7 +2665,7 @@ static int do_brk(unsigned long addr, unsigned long len)
        if (!len)
                return 0;

-       flags = VM_DATA_DEFAULT_FLAGS | VM_ACCOUNT | mm->def_flags;
+       flags |= VM_DATA_DEFAULT_FLAGS | VM_ACCOUNT | mm->def_flags;
For sanity's sake, should a mask be applied here? i.e. to be extra
careful about what flags can get passed in?
Maybe... I am leaving it to mm experts.
Otherwise, this looks okay to me:

Reviewed-by: Kees Cook <redacted>

-Kees
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help