From 934df0ca61bfbb6bdedba8588457a3ffa2adde25 Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Fri, 6 Jun 2025 00:55:35 +0100 Subject: [PATCH] mman: Reserve two PROT_ for CHERI use In CheriBSD we use two bits to control load and store of CHERI capabilities (pointers). In anticipation of merging CHERI support in time for FreeBSD 16, reserved these two bits to avoid the (low, but non-zero) risk of a flag day downstream. I've used PROT_CHERI0 and PROT_CHERI1 rather than their downstream name in hopes of avoiding the impression they do something today. Reviewed by: kevans, adrian Suggested by: kevans, adrian Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D50621 --- sys/sys/mman.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/sys/mman.h b/sys/sys/mman.h index 611c5b4e669..ba478bc71c7 100644 --- a/sys/sys/mman.h +++ b/sys/sys/mman.h @@ -53,6 +53,8 @@ #define PROT_WRITE 0x02 /* pages can be written */ #define PROT_EXEC 0x04 /* pages can be executed */ #if __BSD_VISIBLE +#define PROT_CHERI0 0x08 +#define PROT_CHERI1 0x10 #define _PROT_ALL (PROT_READ | PROT_WRITE | PROT_EXEC) #define PROT_EXTRACT(prot) ((prot) & _PROT_ALL)