Bug #1723
mmap() MAP_ANON honors offset
| Status: | Closed | Start date: | ||
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | - | |||
| Target version: | - |
Description
#include <stdlib.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
char *c = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE |
MAP_ANON, -1, 16);
return printf("%x \n", c);
}
gets an address of xxxxx010. mmap is supposed to fail with EINVAL given an
offset and MAP_ANON.
Patch here: http://endeavour.zapto.org/dfly/mmap_anon_offset.diff
Related todos
History
Updated by sjg about 3 years ago
This is the same as http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/71258