]> git.ipfire.org Git - thirdparty/glibc.git/commit
cheri: malloc: Capability narrowing using internal lookup table
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 29 Sep 2022 16:40:58 +0000 (17:40 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Tue, 22 Nov 2022 14:31:25 +0000 (14:31 +0000)
commitbd8fac4e2846e0621f87c675d7c609385a4d932d
tree494018b11bd6d9cf632561fc5846b2f9093b3174
parentd7d9ee6edcb81380645de095a41f0f301c1bf5e1
cheri: malloc: Capability narrowing using internal lookup table

Add more cap_ hooks to implement narrowing without depending on a
global capability covering the heap.  Either recording every
narrowed capability in a lookup table or recording every mapping
used for the heap are supported.  The morello implmentation uses
a lookup table for now.

The lookup table adds memory overhead, failure paths and locks.
Recording and removing entries from the lookup table must be done
carefully in realloc so on failure the old pointer is usable and
on success the old pointer is immediately reusable concurrently.
The locks require fork hooks so malloc works in multi-threaded
fork child.
malloc/arena.c
malloc/malloc.c
sysdeps/aarch64/morello/libc-cap.h
sysdeps/generic/libc-cap.h