if (copyin(args->addr, (char *)&addr, sizeof (addr)))
goto done;
- rv = mach_vm_allocate(task->map, &addr, args->size, args->flags);
+ rv = mach_vm_allocate_external(task->map, &addr, args->size, args->flags);
if (rv == KERN_SUCCESS)
rv = copyout(&addr, args->addr, sizeof (addr));
if (copyin(args->addr, (char *)&addr, sizeof (addr)))
goto done;
- rv = mach_vm_map(task->map, &addr, args->size, args->mask, args->flags,
+ rv = mach_vm_map_external(task->map, &addr, args->size, args->mask, args->flags,
IPC_PORT_NULL, 0, FALSE, args->cur_protection, VM_PROT_ALL,
VM_INHERIT_DEFAULT);
if (rv == KERN_SUCCESS)
if (args->recipes_size < MACH_VOUCHER_TRAP_STACK_LIMIT) {
/* keep small recipes on the stack for speed */
uint8_t krecipes[args->recipes_size];
- if (copyin(args->recipes, (void *)krecipes, args->recipes_size)) {
+ if (copyin(CAST_USER_ADDR_T(args->recipes), (void *)krecipes, args->recipes_size)) {
kr = KERN_MEMORY_ERROR;
goto done;
}
goto done;
}
- if (copyin(args->recipes, (void *)krecipes, args->recipes_size)) {
+ if (copyin(CAST_USER_ADDR_T(args->recipes), (void *)krecipes, args->recipes_size)) {
kfree(krecipes, (vm_size_t)args->recipes_size);
kr = KERN_MEMORY_ERROR;
goto done;
if (sz < MACH_VOUCHER_TRAP_STACK_LIMIT) {
/* keep small recipes on the stack for speed */
uint8_t krecipe[sz];
- if (copyin(args->recipe, (void *)krecipe, sz)) {
+ if (copyin(CAST_USER_ADDR_T(args->recipe), (void *)krecipe, sz)) {
kr = KERN_MEMORY_ERROR;
goto done;
}
assert(sz <= max_sz);
if (kr == KERN_SUCCESS && sz > 0)
- kr = copyout(krecipe, (void *)args->recipe, sz);
+ kr = copyout(krecipe, CAST_USER_ADDR_T(args->recipe), sz);
} else {
uint8_t *krecipe = kalloc((vm_size_t)max_sz);
if (!krecipe) {
goto done;
}
- if (copyin(args->recipe, (void *)krecipe, sz)) {
+ if (copyin(CAST_USER_ADDR_T(args->recipe), (void *)krecipe, sz)) {
kfree(krecipe, (vm_size_t)max_sz);
kr = KERN_MEMORY_ERROR;
goto done;
assert(sz <= max_sz);
if (kr == KERN_SUCCESS && sz > 0)
- kr = copyout(krecipe, (void *)args->recipe, sz);
+ kr = copyout(krecipe, CAST_USER_ADDR_T(args->recipe), sz);
kfree(krecipe, (vm_size_t)max_sz);
}