From 3659a8767dcdd1f0c6f2e51b1ccceea1c676d7fa Mon Sep 17 00:00:00 2001 From: Frances Wingerter Date: Fri, 2 Feb 2024 17:13:14 -0500 Subject: [PATCH] runtime: track madvise advice this lets us debug it from our event repr and helps future-proof against logic that may care which advice is applied --- runtime/mmap_event.h | 1 + runtime/track_memory_map.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/mmap_event.h b/runtime/mmap_event.h index 892c73bac..7810c8610 100644 --- a/runtime/mmap_event.h +++ b/runtime/mmap_event.h @@ -24,6 +24,7 @@ struct mremap_info { struct madvise_info { struct range range; + int advice; unsigned char pkey; }; diff --git a/runtime/track_memory_map.c b/runtime/track_memory_map.c index c627f60ea..1e176bad3 100644 --- a/runtime/track_memory_map.c +++ b/runtime/track_memory_map.c @@ -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: {