Re: [PATCH 6/7] mm: kill vma flag VM_EXECUTABLE

From: Oleg Nesterov
Date: Mon Apr 02 2012 - 10:48:34 EST


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(&current->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.

> set_mm_exe_file(current->mm, new_file);

No, fput() can sleep.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/