lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20220916080510.359a8e3a@canb.auug.org.au>
Date:   Fri, 16 Sep 2022 08:05:10 +1000
From:   Stephen Rothwell <sfr@...b.auug.org.au>
To:     Palmer Dabbelt <palmer@...belt.com>,
        Paul Walmsley <paul.walmsley@...ive.com>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux Next Mailing List <linux-next@...r.kernel.org>,
        Palmer Dabbelt <palmer@...osinc.com>,
        Steven Price <steven.price@....com>,
        Vladimir Isaev <vladimir.isaev@...tacore.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>
Subject: linux-next: manual merge of the risc-v-fixes tree with Linus' tree

Hi all,

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

  arch/riscv/mm/pageattr.c

between commit:

  8782fb61cc84 ("mm: pagewalk: Fix race between unmap and page walker")

from Linus' tree and commit:

  92c5738923f9 ("riscv: Fix permissions for all mm's during mm init")

from the risc-v-fixes tree.

I fixed it up (I think - 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 arch/riscv/mm/pageattr.c
index 86c56616e5de,74b8107ac743..000000000000
--- a/arch/riscv/mm/pageattr.c
+++ b/arch/riscv/mm/pageattr.c
@@@ -115,6 -115,55 +115,55 @@@ static int __set_memory_mm(struct mm_st
  		.clear_mask = clear_mask
  	};
  
 -	mmap_read_lock(mm);
++	mmap_write_lock(mm);
+ 	ret = walk_page_range_novma(mm, start, end, &pageattr_ops, NULL,
+ 				    &masks);
 -	mmap_read_unlock(mm);
++	mmap_write_unlock(mm);
+ 
+ 	return ret;
+ }
+ 
+ void fix_kernel_mem_early(char *startp, char *endp, pgprot_t set_mask,
+ 			  pgprot_t clear_mask)
+ {
+ 	struct task_struct *t, *s;
+ 
+ 	unsigned long start = (unsigned long)startp;
+ 	unsigned long end = PAGE_ALIGN((unsigned long)endp);
+ 
+ 	/*
+ 	 * In the SYSTEM_FREEING_INITMEM state we expect that all async code
+ 	 * is done and no new userspace task can be created.
+ 	 * So rcu_read_lock() should be enough here.
+ 	 */
+ 	WARN_ON(system_state != SYSTEM_FREEING_INITMEM);
+ 
+ 	__set_memory_mm(current->active_mm, start, end, set_mask, clear_mask);
+ 	__set_memory_mm(&init_mm, start, end, set_mask, clear_mask);
+ 
+ 	rcu_read_lock();
+ 	for_each_process(t) {
+ 		if (t->flags & PF_KTHREAD)
+ 			continue;
+ 		for_each_thread(t, s) {
+ 			if (s->mm) {
+ 				__set_memory_mm(s->mm, start, end, set_mask,
+ 						clear_mask);
+ 			}
+ 		}
+ 	}
+ 	rcu_read_unlock();
+ 
+ 	flush_tlb_kernel_range(start, end);
+ }
+ 
+ static int __set_memory(unsigned long addr, int numpages, pgprot_t set_mask,
+ 			pgprot_t clear_mask)
+ {
+ 	int ret;
+ 	unsigned long start = addr;
+ 	unsigned long end = start + PAGE_SIZE * numpages;
+ 
  	if (!numpages)
  		return 0;
  

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ