]> git.ipfire.org Git - thirdparty/tor.git/commit
hashx: Fix compiled hash function on NetBSD
authorMicah Elizabeth Scott <beth@torproject.org>
Fri, 25 Aug 2023 17:31:33 +0000 (10:31 -0700)
committerMicah Elizabeth Scott <beth@torproject.org>
Mon, 28 Aug 2023 17:11:00 +0000 (10:11 -0700)
commit95e8ffa97e413c19c7257c9e6dc9511e98347b68
tree7773b22b4e68586a3080781f03df020a06b7efdd
parentee4e9f7506d87be71fb85e0bce0a671f541ff059
hashx: Fix compiled hash function on NetBSD

NetBSD includes the idea of a 'maximum protection' per-region,
and an mprotect which exceeds the max protection will be denied.

If we explicitly ask for a maximum which includes execute permission, we
can successfully swap our code buffer's permissions between read-write
and read-execute when each hash program is compiled.

With this patch, the crypto/hashx tests pass on NetBSD 9.
This addresses bug #40844
src/ext/equix/hashx/src/virtual_memory.c