summaryrefslogtreecommitdiff
path: root/vm
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2025-06-09 00:20:56 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-06-09 00:20:56 +0200
commit1ca7651e1ccbf6c71783f4f676269abbe0fd2f13 (patch)
treeaa755ad8869fba3e6c2a89eb14e3786a8b1b5a99 /vm
parent6d422d5588b830464b31680a9076144a2b594113 (diff)
vm_allocate_contiguous: Avoid 64bit addresses for 32bit userland
Diffstat (limited to 'vm')
-rw-r--r--vm/vm_user.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vm/vm_user.c b/vm/vm_user.c
index 7f706d71..c6dbda68 100644
--- a/vm/vm_user.c
+++ b/vm/vm_user.c
@@ -604,6 +604,11 @@ kern_return_t vm_allocate_contiguous(
if (palign != PAGE_SIZE)
return KERN_INVALID_ARGUMENT;
+#ifdef USER32
+ if (pmax > 0x100000000ULL)
+ pmax = 0x100000000ULL;
+#endif
+
selector = VM_PAGE_SEL_DMA;
if (pmax > VM_PAGE_DMA_LIMIT)
#ifdef VM_PAGE_DMA32_LIMIT