summarylogtreecommitdiffstats
path: root/01-fix-get_user_pages.patch
blob: 90e87f14a80db99a114fd38638ad3aefb2197605 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/blackmagic-12.0a14/blackmagic_lib.c b/blackmagic-12.0a14/blackmagic_lib.c.orig
index 5494372..d1685e2 100644
--- a/blackmagic-12.0a14/blackmagic_lib.c
+++ b/blackmagic-12.0a14/blackmagic_lib.c.orig
@@ -676,7 +676,12 @@ dl_get_user_pages(void *task_ptr, void *ptr, unsigned long size, unsigned long *
 #else
 	down_read(&current_task->mm->mmap_sem);
 #endif
-#if KERNEL_VERSION_OR_LATER(4, 10, 0)
+#if KERNEL_VERSION_OR_LATER(5, 9, 0)
+		if (current_task == current)
+			ret = get_user_pages((unsigned long)ptr & PAGE_MASK, *nr_pages, write ? FOLL_WRITE : 0, pages, NULL);
+		else
+			ret = get_user_pages_remote(current_task->mm, (unsigned long)ptr & PAGE_MASK, *nr_pages, write ? FOLL_WRITE : 0, pages, NULL, NULL);
+#elif KERNEL_VERSION_OR_LATER(4, 10, 0)
 		if (current_task == current)
 			ret = get_user_pages((unsigned long)ptr & PAGE_MASK, *nr_pages, write ? FOLL_WRITE : 0, pages, NULL);
 		else