From: Jason Gunthorpe <jgg@nvidia.com>
To: Jann Horn <jannh@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>,
"Eric W . Biederman" <ebiederm@xmission.com>,
Michel Lespinasse <walken@google.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Jeff Dike <jdike@addtoit.com>,
Richard Weinberger <richard@nod.at>,
Anton Ivanov <anton.ivanov@cambridgegreys.com>,
<linux-um@lists.infradead.org>,
"John Hubbard" <jhubbard@nvidia.com>
Subject: Re: [PATCH v2 2/2] exec: Broadly lock nascent mm until setup_arg_pages()
Date: Wed, 7 Oct 2020 09:12:34 -0300 [thread overview]
Message-ID: <20201007121234.GS4734@nvidia.com> (raw)
In-Reply-To: <20201006225450.751742-3-jannh@google.com>
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
prev parent reply other threads:[~2020-10-07 12:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-06 22:54 [PATCH v2 0/2] Broad write-locking of nascent mm in execve Jann Horn
2020-10-06 22:54 ` [PATCH v2 1/2] mmap locking API: Order lock of nascent mm outside lock of live mm Jann Horn
2020-10-07 7:42 ` Johannes Berg
2020-10-07 8:28 ` Jann Horn
2020-10-07 11:35 ` Johannes Berg
2020-10-06 22:54 ` [PATCH v2 2/2] exec: Broadly lock nascent mm until setup_arg_pages() Jann Horn
2020-10-07 12:12 ` Jason Gunthorpe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201007121234.GS4734@nvidia.com \
--to=jgg@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=anton.ivanov@cambridgegreys.com \
--cc=ebiederm@xmission.com \
--cc=jannh@google.com \
--cc=jdike@addtoit.com \
--cc=jhubbard@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-um@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=richard@nod.at \
--cc=sakari.ailus@linux.intel.com \
--cc=walken@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).