[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201007121234.GS4734@nvidia.com>
Date: Wed, 7 Oct 2020 09:12:34 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Jann Horn <jannh@...gle.com>
CC: Andrew Morton <akpm@...ux-foundation.org>, <linux-mm@...ck.org>,
<linux-kernel@...r.kernel.org>,
"Eric W . Biederman" <ebiederm@...ssion.com>,
Michel Lespinasse <walken@...gle.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Jeff Dike <jdike@...toit.com>,
Richard Weinberger <richard@....at>,
Anton Ivanov <anton.ivanov@...bridgegreys.com>,
<linux-um@...ts.infradead.org>,
"John Hubbard" <jhubbard@...dia.com>
Subject: Re: [PATCH v2 2/2] exec: Broadly lock nascent mm until
setup_arg_pages()
On Wed, Oct 07, 2020 at 12:54:50AM +0200, Jann Horn wrote:
> @@ -1545,6 +1532,18 @@ void setup_new_exec(struct linux_binprm * bprm)
> me->mm->task_size = TASK_SIZE;
> mutex_unlock(&me->signal->exec_update_mutex);
> mutex_unlock(&me->signal->cred_guard_mutex);
> +
> +#ifndef CONFIG_MMU
> + /*
> + * On MMU, setup_arg_pages() wants to access bprm->vma after this point,
> + * so we can't drop the mmap lock yet.
> + * On !MMU, we have neither setup_arg_pages() nor bprm->vma, so we
> + * should drop the lock here.
> + */
> + mmap_write_unlock(bprm->mm);
> + mmput(bprm->mm);
> + bprm->mm = NULL;
> +#endif
> }
It looks like this could this be a
if (!IS_ENABLED(CONFIG_MMU))
This all seems nice, more locking points were removed than added at
least
Jason
Powered by blists - more mailing lists