Small bug with with the regular protection bits not being decoded when there's a PROT_MAX.
Details
Details
- Reviewers
kaktus - Commits
- rS368022: libsysdecode: correctly decode mmap flags
Doesn't seem like anything uses explicit PROT_MAX()s in base. So here's a sample program to truss.
#include <stddef.h>
#include <sys/mman.h>
#include <sys/param.h>
int main() {
int prots[] = { PROT_NONE, PROT_READ, PROT_WRITE, PROT_EXEC, PROT_READ|PROT_WRITE, PROT_READ|PROT_WRITE|PROT_EXEC };
for (size_t i = 0; i < nitems(prots); i++)
for (size_t j = 0; j < nitems(prots); j++)
mmap(NULL, PAGE_SIZE, prots[i] | PROT_MAX(prots[j]), MAP_ANON, -1, 0);
return (0);
}Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable