linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Broad write-locking of nascent mm in execve
@ 2020-10-06 22:54 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-06 22:54 ` [PATCH v2 2/2] exec: Broadly lock nascent mm until setup_arg_pages() Jann Horn
  0 siblings, 2 replies; 7+ messages in thread
From: Jann Horn @ 2020-10-06 22:54 UTC (permalink / raw)
  To: Andrew Morton, linux-mm
  Cc: linux-kernel, Eric W . Biederman, Michel Lespinasse,
	Mauro Carvalho Chehab, Sakari Ailus, Jeff Dike,
	Richard Weinberger, Anton Ivanov, linux-um, Jason Gunthorpe,
	John Hubbard

v2:
 - fix commit message of patch 1/2 and be more verbose about where
   the old mmap lock is taken (Michel, Jason)
 - resending without mangling the diffs :/ (Michel, Jason)

These two patches replace "mmap locking API: don't check locking
if the mm isn't live yet"[1], which is currently in the mmotm tree,
and should be placed in the same spot where the old patch was.

While I originally said that this would be an alternative
patch (meaning that the existing patch would have worked just
as well), the new patches actually address an additional issue
that the old patch missed (bprm->vma is used after the switch
to the new mm).

I have boot-tested these patches on x64-64 (with lockdep) and
!MMU arm (the latter with both FLAT and ELF).

[1] https://lkml.kernel.org/r/CAG48ez03YJG9JU_6tGiMcaVjuTyRE_o4LEQ7901b5ZoCnNAjcg@mail.gmail.com

Jann Horn (2):
  mmap locking API: Order lock of nascent mm outside lock of live mm
  exec: Broadly lock nascent mm until setup_arg_pages()

 arch/um/include/asm/mmu_context.h |  3 +-
 fs/exec.c                         | 64 ++++++++++++++++---------------
 include/linux/binfmts.h           |  2 +-
 include/linux/mmap_lock.h         | 23 ++++++++++-
 kernel/fork.c                     |  7 +---
 5 files changed, 59 insertions(+), 40 deletions(-)


base-commit: fb0155a09b0224a7147cb07a4ce6034c8d29667f
prerequisite-patch-id: 08f97130a51898a5f6efddeeb5b42638577398c7
prerequisite-patch-id: 577664d761cd23fe9031ffdb1d3c9ac313572c67
prerequisite-patch-id: dc29a39716aa8689f80ba2767803d9df3709beaa
prerequisite-patch-id: 42b1b546d33391ead2753621f541bcc408af1769
prerequisite-patch-id: 2cbb839f57006f32e21f4229e099ae1bd782be24
prerequisite-patch-id: 1b4daf01cf61654a5ec54b5c3f7c7508be7244ee
prerequisite-patch-id: f46cc8c99f1909fe2a65fbc3cf1f6bc57489a086
prerequisite-patch-id: 2b0caed97223241d5008898dde995d02fda544e4
prerequisite-patch-id: 6b7adcb54989e1ec3370f256ff2c35d19cf785aa
-- 
2.28.0.806.g8561365e88-goog



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-10-07 12:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).