awnumar/memguard

Is PROT_EXEC required?

anitgandhi opened this issue · 1 comments

Looking at this code:

if read && write {
prot = unix.PROT_READ | unix.PROT_WRITE | unix.PROT_EXEC
} else if read {
prot = unix.PROT_READ | unix.PROT_EXEC
} else if write {
prot = unix.PROT_WRITE | unix.PROT_EXEC

Is PROT_EXEC really required? It feels unnecessary given the use case of memguard for byte slices only.

It was originally added just in case, since I wasn't aware of Go's own mmap policies. I'm currently working on a refactor of the memcall package---amongst other things---that will remove it.

I guess this issue is a good as place as any to track progress.