diff options
author | Ian Moffett <ian@osmora.org> | 2025-09-15 21:50:08 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-09-15 21:50:29 -0400 |
commit | 923856d4233894adc059e368cec7af12e796f708 (patch) | |
tree | 90f1be2c9de6070f6d2684cbbba194c4672903f8 /src | |
parent | 33a7516137fdf6332a27265cbe282c0a44b12924 (diff) |
kern: vm_map: Add guard pages at end of mappings
Place a guard page at the end of every mapping to catch overflows before
they start corrupting the system.
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/sys/vm/vm_map.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sys/vm/vm_map.c b/src/sys/vm/vm_map.c index ed187d8..1b27a21 100644 --- a/src/sys/vm/vm_map.c +++ b/src/sys/vm/vm_map.c @@ -104,5 +104,8 @@ vm_map(struct vm_vas *vas, struct mmu_map *spec, size_t len, int prot) return -1; } + /* Place a guard page at the end */ + spec->va = spec_cpy.va + len; + __vm_map(vas, spec, DEFAULT_PAGESIZE, 0); return 0; } |