diff options
author | kan <kan@FreeBSD.org> | 2008-12-01 22:33:50 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2008-12-01 22:33:50 +0000 |
commit | 6f76d481f02bf58afb3c6e3880762ab0b47b0174 (patch) | |
tree | d59c8b2007b5c3ff7f2defa183b96ced2cfe4656 /sys | |
parent | 7f55711bccd44e4dd181f3b9b77c23b2032cd1d9 (diff) | |
download | FreeBSD-src-6f76d481f02bf58afb3c6e3880762ab0b47b0174.zip FreeBSD-src-6f76d481f02bf58afb3c6e3880762ab0b47b0174.tar.gz |
Shared memory objects that have size which is not necessarily equal to
exact multiple of system page size should still be allowed to be mapped
in their entirety to match the regular vnode backed file behavior.
Reported by: ed
Reviewed by: jhb
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/uipc_shm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index f2dec19..a12c731 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -605,7 +605,8 @@ shm_mmap(struct shmfd *shmfd, vm_size_t objsize, vm_ooffset_t foff, * XXXRW: This validation is probably insufficient, and subject to * sign errors. It should be fixed. */ - if (foff >= shmfd->shm_size || foff + objsize > shmfd->shm_size) + if (foff >= shmfd->shm_size || + foff + objsize > round_page(shmfd->shm_size)) return (EINVAL); mtx_lock(&shm_timestamp_lock); |