Skip to content

Commit

Permalink
bhyve: Fix fetching of capability tags
Browse files Browse the repository at this point in the history
The mapping of the guest address space clears tags, so we need to fetch
them out of band.
  • Loading branch information
markjdb committed Jan 5, 2025
1 parent 60fbff4 commit 0f503b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion usr.sbin/bhyve/gdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1963,12 +1963,16 @@ gdb_query(const uint8_t *data, size_t len)
return;
}

error = vm_get_cheri_capability_tag(ctx, gpa, &capbuf[0]);
if (error != 0) {
send_error(errno);
return;
}
cap = paddr_guest2host(ctx, gpa, sizeof(uintcap_t));
if (cap == NULL) {
send_error(EFAULT);
return;
}
capbuf[0] = cheri_gettag(*cap);
memcpy(&capbuf[1], cap, sizeof(uintcap_t));

start_packet();
Expand Down

0 comments on commit 0f503b0

Please sign in to comment.