Subject: linux-next: manual merge of the rdma-fixes tree with Linus' tree

From: Stephen Rothwell <[email-masked]>
Date: Fri, 26 Apr 2019 07:37:09 +1000

Hi all,

Today's linux-next merge of the rdma-fixes tree got a conflict in:

  drivers/infiniband/core/uverbs_main.c

between commit:

  04f5866e41fb ("coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping")

from Linus' tree and commit:

  67f269b37f9b ("RDMA/ucontext: Fix regression with disassociate")

from the rdma-fixes tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/infiniband/core/uverbs_main.c
index f2e7ffe6fc54,db20b6e0f253..000000000000
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@@ -992,9 -1039,7 +1039,9 @@@ void uverbs_user_mmap_disassociate(stru
  		 * at a time to get the lock ordering right. Typically there
  		 * will only be one mm, so no big deal.
  		 */
- 		down_write(&mm->mmap_sem);
+ 		down_read(&mm->mmap_sem);
 +		if (!mmget_still_valid(mm))
 +			goto skip_mm;
  		mutex_lock(&ufile->umap_lock);
  		list_for_each_entry_safe (priv, next_priv, &ufile->umaps,
  					  list) {
@@@ -1006,11 -1051,9 +1053,10 @@@
  
  			zap_vma_ptes(vma, vma->vm_start,
  				     vma->vm_end - vma->vm_start);
- 			vma->vm_flags &= ~(VM_SHARED | VM_MAYSHARE);
  		}
  		mutex_unlock(&ufile->umap_lock);
 +	skip_mm:
- 		up_write(&mm->mmap_sem);
+ 		up_read(&mm->mmap_sem);
  		mmput(mm);
  	}
  }