Skip to content

Commit

Permalink
ptrace: Do not update the target pmap in proc_read_cheri_cap_page()
Browse files Browse the repository at this point in the history
It is unnecessary, and allows us to avoid having to revoke capabilities
in the would-be-mapped pages.
  • Loading branch information
markjdb authored and bsdjhb committed Mar 15, 2024
1 parent 0209c8e commit ebc253e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sys/kern/sys_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,8 @@ proc_read_cheri_cap_page(vm_map_t map, vm_offset_t va, struct uio *uio)
todo = MIN(todo, uio->uio_resid);
va = trunc_page(va);

error = vm_fault(map, va, VM_PROT_READ, VM_FAULT_NOFILL, &m);
error = vm_fault(map, va, VM_PROT_READ,
VM_FAULT_NOFILL | VM_FAULT_NOPMAP, &m);
if (error == KERN_PAGE_NOT_FILLED) {
memset(capbuf, 0, sizeof(capbuf));
while (todo > 0) {
Expand Down Expand Up @@ -682,7 +683,8 @@ proc_write_cheri_cap_page(struct proc *p, vm_map_t map, vm_offset_t va,
todo = MIN(todo, uio->uio_resid);
va = trunc_page(va);

error = vm_fault(map, va, VM_PROT_WRITE | VM_PROT_WRITE_CAP, 0, &m);
error = vm_fault(map, va, VM_PROT_WRITE | VM_PROT_WRITE_CAP,
VM_FAULT_NOPMAP, &m);
if (error != KERN_SUCCESS)
return (EFAULT);

Expand Down

0 comments on commit ebc253e

Please sign in to comment.