diff options
author | kib <kib@FreeBSD.org> | 2008-01-04 04:33:13 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2008-01-04 04:33:13 +0000 |
commit | 8e700284f52e283e65ab5d7fe57d0e86988525cb (patch) | |
tree | 4788acde9a74d8ef00b4a3ab8842aabc94acbaec | |
parent | 21f57c54a6251181207511c934f057402bc5965a (diff) | |
download | FreeBSD-src-8e700284f52e283e65ab5d7fe57d0e86988525cb.zip FreeBSD-src-8e700284f52e283e65ab5d7fe57d0e86988525cb.tar.gz |
In the vm_map_stack(), check for the specified stack region wraparound.
Reported and tested by: Peter Holm
Reviewed by: alc
MFC after: 3 days
-rw-r--r-- | sys/vm/vm_map.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index d042c65..f3ee930 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -2712,7 +2712,9 @@ vm_map_stack(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, cow &= ~orient; KASSERT(orient != 0, ("No stack grow direction")); - if (addrbos < vm_map_min(map) || addrbos > map->max_offset) + if (addrbos < vm_map_min(map) || + addrbos > vm_map_max(map) || + addrbos + max_ssize < addrbos) return (KERN_NO_SPACE); init_ssize = (max_ssize < sgrowsiz) ? max_ssize : sgrowsiz; |