]> git.ipfire.org Git - thirdparty/glibc.git/commit
cheri: malloc: Initial capability narrowing support
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Wed, 21 Sep 2022 14:32:34 +0000 (15:32 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Tue, 22 Nov 2022 14:31:25 +0000 (14:31 +0000)
commitd7d9ee6edcb81380645de095a41f0f301c1bf5e1
treed3b1edef10bbcfe5c78e4f3887b0bd94c58f3799
parent32c64139eef90920af88e85c07c168fcada73935
cheri: malloc: Initial capability narrowing support

Public interfaces return pointers with narrow bounds, this internally
requires bumping the size and alignment requirement of allocations so
the bounds are representible.

When pointers with narrow bounds need to be turned back to have wide
bounds (free, realloc), the pointer is rederived from DDC. (So this
patch relies on DDC to cover all heap memory with RW permission.)

Allocations above the mmap threshold waste memory for alignment and
realloc often falls back to the inefficient alloc, copy, free sequence
instead of mremap or other inplace solution.
malloc/malloc.c
sysdeps/aarch64/morello/libc-cap.h [new file with mode: 0644]
sysdeps/generic/libc-cap.h [new file with mode: 0644]