References:
[1] CETS: Compiler-Enforced Temporal Safety for C, ISMM, 2010. [paper]
Temporal safety erros include:
invalid frees (calling free() with a non-heap address or pointer to the middle of a heap-allocated region).
Use location (or address) to determine whether it is allocated or not. Metadata records the allocated/deallocated status of each location.
Update the metadata upon all memory allocations/deallocations. Metadtata is checked during memory access.
Meta-data can be implemented in
Associates a unique (never reused) identifier with each memory allocation.
Per-pointer metadata via fat pointers Pointers are extended into multi-words.
Set-based indentifier checking
Set data structure (such as hash table) is used to track allocation/deallocation.
Lock-and-key identifier checking
Every pointer is a tuple consisting of an address and a key. Every object in the heap begins with a lock. A pointer to an object in the heap is valid only if the key in the pointer matches the lock in the object.
If you could revise
the fundmental principles of
computer system design
to improve security...
... what would you change?