Re: [PATCH 2/2] memcg: Close the race between migration and installing bprm->mm as mm
From: Oleg Nesterov
Date: Wed May 09 2018 - 10:52:02 EST
On 05/04, Eric W. Biederman wrote:
>
> --- a/fs/exec.c
> +++ b/fs/exec.c
> @@ -1044,6 +1044,8 @@ static int exec_mmap(struct mm_struct *mm)
> return 0;
> }
> mmdrop(active_mm);
> + /* The tsk may have migrated before the new mm was attached */
> + mm_sync_memcg_from_task(tsk);
> return 0;
> }
call_usermodehelper(). perhaps it makes sense to change flush_old_exec()
to clear PF_KTHREAD/etc before exec_mmap().
Oleg.