Navigation: Linux Kernel Driver DataBase - web LKDDB: Main index - K index
The Linux kernel configuration item CONFIG_KMALLOC_PARTITION_TYPED:
CONFIG_CC_HAS_ALLOC_TOKENRely on Clang's allocation tokens to choose a slab cache, where token IDs are derived from the allocated type.
Unlike KMALLOC_PARTITION_RANDOM, cache assignment is deterministic based on type, which guarantees that objects of certain types are not placed in the same cache. This effectively mitigates certain classes of exploits that probabilistic defenses like KMALLOC_PARTITION_RANDOM only make harder but not impossible. However, this also means the cache assignment is predictable.
Clang's default token ID calculation returns a bounded hash with disjoint ranges for pointer-containing and pointerless objects: when used as the slab cache index, this prevents buffer overflows on primitive buffers from directly corrupting pointer-containing objects.
The current effectiveness of Clang's type inference can be judged by -Rpass=alloc-token, which provides diagnostics where (after dead-code elimination) type inference failed.
Requires Clang 22 or later.
Raw data from LKDDb:
(none)This page is automaticly generated with free (libre, open) software lkddb(see lkddb-sources).
The data is retrived from:
Popular queries:
Navigation: Linux Kernel Driver DataBase - web LKDDB: main index - K index
Automatically generated (in year 2026). See also LKDDb sources on GitLab