The patch titled Subject: mm/mmu_notifier: fix mmget() assert in __mmu_interval_notifier_insert has been added to the -mm tree. Its filename is mm-mmu_notifier-fix-mmget-assert-in-__mmu_interval_notifier_insert.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mm-mmu_notifier-fix-mmget-assert-in-__mmu_interval_notifier_insert.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mm-mmu_notifier-fix-mmget-assert-in-__mmu_interval_notifier_insert.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Jann Horn <jannh@xxxxxxxxxx> Subject: mm/mmu_notifier: fix mmget() assert in __mmu_interval_notifier_insert The comment talks about having to hold mmget() (which means mm_users), but the actual check is on mm_count (which would be mmgrab()). Given that MMU notifiers are torn down in mmput() -> __mmput() -> exit_mmap() -> mmu_notifier_release(), I believe that the comment is correct and the check should be on mm->mm_users. Fix it up accordingly. Link: https://lkml.kernel.org/r/20200901000143.207585-1-jannh@xxxxxxxxxx Fixes: 99cb252f5e68 ("mm/mmu_notifier: add an interval tree notifier") Signed-off-by: Jann Horn <jannh@xxxxxxxxxx> Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx> Cc: John Hubbard <jhubbard@xxxxxxxxxx> Cc: Christoph Hellwig <hch@xxxxxx> Cc: Christian König <christian.koenig@xxxxxxx Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/mmu_notifier.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/mmu_notifier.c~mm-mmu_notifier-fix-mmget-assert-in-__mmu_interval_notifier_insert +++ a/mm/mmu_notifier.c @@ -913,7 +913,7 @@ static int __mmu_interval_notifier_inser return -EOVERFLOW; /* Must call with a mmget() held */ - if (WARN_ON(atomic_read(&mm->mm_count) <= 0)) + if (WARN_ON(atomic_read(&mm->mm_users) <= 0)) return -EINVAL; /* pairs with mmdrop in mmu_interval_notifier_remove() */ _ Patches currently in -mm which might be from jannh@xxxxxxxxxx are mm-mmu_notifier-fix-mmget-assert-in-__mmu_interval_notifier_insert.patch binfmt_elf_fdpic-stop-using-dump_emit-on-user-pointers-on-mmu.patch coredump-let-dump_emit-bail-out-on-short-writes.patch coredump-refactor-page-range-dumping-into-common-helper.patch coredump-rework-elf-elf_fdpic-vma_dump_size-into-common-helper.patch binfmt_elf-binfmt_elf_fdpic-use-a-vma-list-snapshot.patch mm-gup-take-mmap_lock-in-get_dump_page.patch mm-remove-the-now-unnecessary-mmget_still_valid-hack.patch