Blame SOURCES/CVE-2022-41222.patch

661362
From 17f7e33c1a0008537d53add1f8e70df8e760486f Mon Sep 17 00:00:00 2001
661362
From: Joe Lawrence <joe.lawrence@redhat.com>
661362
Date: Fri, 6 Jan 2023 10:45:27 -0500
661362
Subject: [KPATCH CVE-2022-41222] kpatch fixes for CVE-2022-41222
661362
661362
If a race condition happens between rmap walk and mremap, this can
661362
result in stale TLB entries.  Waiman suggested a simple RHEL-only fix
661362
for kpatch (always taking the rmap_locks) while z-stream opted to
661362
backport about dozen related commits.
661362
661362
Kernels:
661362
4.18.0-425.3.1.el8
661362
661362
661362
Kpatch-MR: https://gitlab.com/redhat/prdsc/rhel/src/kpatch/rhel-8/-/merge_requests/68
661362
Approved-by: Yannick Cote (@ycote1)
661362
Changes since last build:
661362
arches: x86_64 ppc64le
661362
callback_xdr.o: changed function: nfs_callback_dispatch
661362
mremap.o: changed function: move_page_tables
661362
nfs3proc.o: changed function: nfsd3_init_dirlist_pages
661362
nfs3proc.o: changed function: nfsd3_proc_read
661362
nfsproc.o: changed function: nfsd_proc_read
661362
nfsproc.o: changed function: nfsd_proc_readdir
661362
nfssvc.o: changed function: nfsd_dispatch
661362
svc.o: changed function: nlmsvc_dispatch
661362
---------------------------
661362
661362
Modifications: RHEL-only
661362
Suggested-by: Waiman Long <longman@redhat.com>
661362
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
661362
---
661362
 mm/mremap.c | 6 ++----
661362
 1 file changed, 2 insertions(+), 4 deletions(-)
661362
661362
diff --git a/mm/mremap.c b/mm/mremap.c
661362
index 3c8a797d5693..d837de27011b 100644
661362
--- a/mm/mremap.c
661362
+++ b/mm/mremap.c
661362
@@ -289,12 +289,10 @@ unsigned long move_page_tables(struct vm_area_struct *vma,
661362
 			if (extent == HPAGE_PMD_SIZE) {
661362
 				bool moved;
661362
 				/* See comment in move_ptes() */
661362
-				if (need_rmap_locks)
661362
-					take_rmap_locks(vma);
661362
+				take_rmap_locks(vma);
661362
 				moved = move_huge_pmd(vma, old_addr, new_addr,
661362
 						    old_end, old_pmd, new_pmd);
661362
-				if (need_rmap_locks)
661362
-					drop_rmap_locks(vma);
661362
+				drop_rmap_locks(vma);
661362
 				if (moved)
661362
 					continue;
661362
 			}
661362
-- 
661362
2.39.1
661362
661362