Manual Page Search Parameters

MALLOC_REVOKE(3) Library Functions Manual MALLOC_REVOKE(3)

malloc_revoke_enabled, malloc_revoke_quarantine_force_flush, malloc_revoke, malloc_is_revokingmalloc revocation status and control

Standard C Library (libc, -lc)

#include <sys/errno.h>
#include <stdlib.h>

int
malloc_revoke_quarantine_force_flush(void);

void
malloc_revoke(void);

#include <malloc_np.h>

bool
malloc_revoke_enabled(void);

bool
malloc_is_revoking(void);

On systems which support heap temporal safety through a quarantine and sweep mechanism (such as CHERI systems), these interfaces permit control and monitoring of quarantined heap memory. On other systems, these interfaces are stubs.

The () triggers a full flush of the quarantine and scan of memory to ensure that all references to memory previously quarantined by free(3) or realloc(3) are revoked upon successful return. The deprecated () does the same, but does not return a status value.

The () function and its deprecated form () return the state of revocation in the current process. An array of system wide and implementation-specific knobs control this state during process startup.

If the current process has malloc() quarantining enabled malloc_revoke_enabled() returns otherwise

malloc_revoke_quarantine_force_flush() returns on success and an error code on failure. If quarantine is not implemented or is disabled it returns

jemalloc(3,) mrs(3)

This software and this manual page were developed by SRI International, the University of Cambridge Computer Laboratory (Department of Computer Science and Technology), and Capabilities Limited under contract (FA8750-24-C-B047) (“DEC”).

malloc_revoke_quarantine_force_flush() and malloc_revoke_enabled() were introduced in CheriBSD 25.02.

malloc_revoke() was present as a stub in CheriBSD 22.05 where it had no effect. A working implementation was first added in CheriBSD 23.11. As of CheriBSD 25.02 malloc_revoke() and malloc_is_revoking() are deprecated.

The malloc_revoke() function provides no indication of success or failure even if it is unimplemented.

February 13, 2025 dev