lkml.org 
[lkml]   [2018]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [v2 PATCH 2/2 -mm] mm: brk: dwongrade mmap_sem to read when shrinking
From
Date
On 9/27/18 2:50 PM, Kirill A. Shutemov wrote:
>> diff --git a/mm/mmap.c b/mm/mmap.c
>> index 017bcfa..0d2fae1 100644
>> --- a/mm/mmap.c
>> +++ b/mm/mmap.c
>> @@ -193,9 +193,11 @@ static int do_brk_flags(unsigned long addr, unsigned long request, unsigned long
>> unsigned long retval;
>> unsigned long newbrk, oldbrk;
>> struct mm_struct *mm = current->mm;
>> + unsigned long origbrk = mm->brk;
>
> Is it safe to read mm->brk outside the lock?

Good catch! I guess not, parallel brk()'s could then race.

\
 
 \ /
  Last update: 2018-09-27 15:21    [W:0.216 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site