]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add stricter checking of some mmap() arguments:
authorJohn Baldwin <jhb@FreeBSD.org>
Mon, 15 Sep 2014 17:20:13 +0000 (17:20 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Mon, 15 Sep 2014 17:20:13 +0000 (17:20 +0000)
commit5fd3f8b3b697d1ff60f5ef3b15e4feae3f28a070
tree93c8cc057b6c3ff7c23527608d6183ae01cc9bbb
parenta7fecb4d3afec11d5c89e2751d3b789776b7471c
Add stricter checking of some mmap() arguments:
- Fail with EINVAL if an invalid protection mask is passed to mmap().
- Fail with EINVAL if an unknown flag is passed to mmap().
- Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to mmap().
- Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous
  mappings.

Reviewed by: alc, kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D698
lib/libc/sys/mmap.2
sys/vm/vm_mmap.c