[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F79DE84.8020807@openvz.org>
Date: Mon, 02 Apr 2012 21:14:44 +0400
From: Konstantin Khlebnikov <khlebnikov@...nvz.org>
To: Cyrill Gorcunov <gorcunov@...nvz.org>
CC: Oleg Nesterov <oleg@...hat.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
Andrew Morton <akpm@...ux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Eric Paris <eparis@...hat.com>
Subject: Re: [PATCH 6/7] mm: kill vma flag VM_EXECUTABLE
Cyrill Gorcunov wrote:
> On Mon, Apr 02, 2012 at 08:19:59PM +0400, Konstantin Khlebnikov wrote:
>> Oleg Nesterov wrote:
>>> On 04/02, Konstantin Khlebnikov wrote:
>>>>
>>>> In this patch I leave mm->exe_file lockless.
>>>> After exec/fork we can change it only for current task and only if mm->mm_users == 1.
>>>>
>>>> something like this:
>>>>
>>>> task_lock(current);
>>>
>>> OK, this protects against the race with get_task_mm()
>>>
>>>> if (atomic_read(¤t->mm->mm_users) == 1)
>>>
>>> this means PR_SET_MM_EXE_FILE can fail simply because someone did
>>> get_task_mm(). Or the caller is multithreaded.
>>
>> This is sad, seems like we should keep mm->exe_file protection by mm->mmap_sem.
>> So, I'll rework this patch...
>
> Ah, it's about locking. I misundertand it at first.
> Oleg, forget about my email then.
Yes, it's about locking. Please review patch for your code from attachment.
View attachment "diff-pr-set-mm-exe-file-without-vm_executable" of type "text/plain" (2122 bytes)
Powered by blists - more mailing lists