Navigation: Linux Kernel Driver DataBase - web LKDDB: Main index - K index

CONFIG_KMALLOC_PARTITION_TYPED: Type based slab cache selection for normal kmalloc

General informations

The Linux kernel configuration item CONFIG_KMALLOC_PARTITION_TYPED:

Help text

Rely 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.

Hardware

LKDDb

Raw data from LKDDb:

Sources

This page is automaticly generated with free (libre, open) software lkddb(see lkddb-sources).

The data is retrived from:

Automatic links from Google (and ads)

Custom Search

Popular queries:

Navigation: Linux Kernel Driver DataBase - web LKDDB: main index - K index

Automatically generated (in year 2026). See also LKDDb sources on GitLab