Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1459556

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

From Denys Vlasenko <dvlasenk@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3] powerpc: Do not make the entire heap executable
Date 2016-08-10 21:00 +0200
Message-ID <s4GTp-n4-91@gated-at.bofh.it> (permalink)
References <s4kzv-3bk-7@gated-at.bofh.it> <s4o0p-5bG-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 08/10/2016 12:43 AM, Kees Cook wrote:
>> -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 <keescook@chromium.org>
>
> -Kees

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3] powerpc: Do not make the entire heap executable Denys Vlasenko <dvlasenk@redhat.com> - 2016-08-09 21:10 +0200
  Re: [PATCH v3] powerpc: Do not make the entire heap executable Kees Cook <keescook@chromium.org> - 2016-08-10 00:50 +0200
    Re: [PATCH v3] powerpc: Do not make the entire heap executable Denys Vlasenko <dvlasenk@redhat.com> - 2016-08-10 21:00 +0200
  Re: [PATCH v3] powerpc: Do not make the entire heap executable Michael Ellerman <mpe@ellerman.id.au> - 2016-08-10 06:40 +0200
    Re: [PATCH v3] powerpc: Do not make the entire heap executable Denys Vlasenko <dvlasenk@redhat.com> - 2016-08-10 23:40 +0200

csiph-web