Skip to content

Commit

Permalink
runtime: track madvise advice
Browse files Browse the repository at this point in the history
this lets us debug it from our event repr and helps future-proof against logic that may care which advice is applied
  • Loading branch information
fw-immunant committed Feb 2, 2024
1 parent 898720f commit 3659a87
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions runtime/mmap_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct mremap_info {

struct madvise_info {
struct range range;
int advice;
unsigned char pkey;
};

Expand Down
5 changes: 2 additions & 3 deletions runtime/track_memory_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,10 @@ static bool interpret_syscall(struct user_regs_struct *regs, unsigned char pkey,
info->range.start = regs->rdi;
info->range.len = regs->rsi;
info->pkey = pkey;

int advice = regs->rdx;
info->advice = regs->rdx;

debug_op("compartment %d madvise (%08zx, %zd) with advice=%d\n", info->pkey,
info->range.start, info->range.len, advice);
info->range.start, info->range.len, info->advice);
break;
}
case EVENT_MPROTECT: {
Expand Down

0 comments on commit 3659a87

Please sign in to comment.