trailofbits / cb-multios

DARPA Challenges Sets for Linux, Windows, and macOS
https://blog.trailofbits.com/2016/08/01/your-tool-works-better-than-mine-prove-it/
MIT License
520 stars 103 forks source link

Use -1 as the mmap file descriptor with MAP_ANONYMOUS #69

Closed smcc closed 4 years ago

smcc commented 4 years ago

Linux simply ignores the fd argument with MAP_ANONYMOUS, but some other systems (I checked the FreeBSD man page) require that the placeholder value be -1. Logically this makes sense because -1 is never a valid file descriptor, whereas 0 is the file descriptor for standard input.

claassistantio commented 4 years ago

CLA assistant check
All committers have signed the CLA.