Direct naar de inhoud
⚡ Kritieke cyberalerts voor jouw sector & systemen — direct in je inbox. Aanmelden →
cybernieuws.nl Cybersecurity en informatiebeveiling nieuws alerts live · 8 min 121 bronnen 1 kritiek 7 vandaag
CVE's Videos Dagbriefing

← Terug naar CVE-database

CVE-2026-74576

NONE Gepubliceerd:

Beschrijving NL

In de Linux kernel is de volgende kwetsbaarheid verholpen:

mm/plaat: voorkom onbegrensde recursie in vrij pad met nieuw kmalloc-type

Commit 280ea9c3154b ("mm/slab: vermijd het toewijzen van slabobj_ext array van
zijn eigen plaat") vermeden recursieve toewijzing van obj_exts van kmalloc
caches van dezelfde grootte, door de toewijzing van de obj_exts-array te stoten
grootte wanneer de arraygrootte gelijk is aan de grootte van het object dat
toegewezen. Zoals gerapporteerd door Danielle Costantino en Shakeel Butt,
zelfs platen van kmalloc-caches van verschillende groottes kunnen een cyclus vormen
door obj_exts-arrays van elkaar toe te wijzen [1]:

Wat is er gebeurd: de obj_exts-array van een KMALLOC_NORMAL slab (gebruikt door
allocatie profilering / memcg accounting) is zelf kmalloc()'d van een
KMALLOC_NORMAL cache, dus de "plaat bevat de obj_exts-array van een andere plaat"
relatie cycli kan vormen. Met sizeof(struct slabobj_ext) == 16 en
de geometrie van de host:

- kmalloc-512 heeft 64 objecten/plaat -> array is 64*16 == 1024 bytes,
geserveerd vanaf kmalloc-1k;
- kmalloc-1k heeft 32 objecten/plaat -> array is 32*16 == 512 bytes,
geserveerd vanaf kmalloc-512. Een kmalloc-512 plaat en een kmalloc-1k plaat houden elkaars
obj_exts array. Het weggooien van de ene bevrijdt de array van de ander, die leegloopt
en gooit die plaat weg, die de array van de eerste vrijmaakt, enzovoort:
__free_slab() -> free_slab_obj_exts() -> kfree() -> weggooien_slab() ->
__free_slab() herhaalt zich langs de cyclus totdat de stapel is uitgeput. Met geheugentoewijzingsprofilering maakt dit onbegrensde recursie mogelijk
in het vrije pad en leidde tot een stack overflow op een productiehost in
de Meta-vloot [1]:

BUG: taakstapelbeveiligingspagina is geraakt
Oeps: stapelbeveiligingspagina
RIP: 0010:kvrij+0x8/0x5d0
Oproeptracering:
__free_slab+0x66/0xc0
kvrij+0x3f0/0x5d0
... ( ~125x __free_slab kfree ) ... do_syscall_64

Er wordt voorgesteld [1] om dit probleem op te lossen door altijd de obj_exts
array-allocatie van kmalloc-caches (of grote kmalloc) van maten groter
dan de objectgrootte. Echter, zoals opgemerkt door Vlastimil Babka [2],
dit kan een overmatige hoeveelheid geheugen verspillen als platen van grote
kmalloc-groottes (bijv. kmalloc-8k) hebben over het algemeen veel obj_exts-arrays nodig
kleiner dan de objectgrootte. Laten we daarom, in plaats van de maat te stoten, een andere
benadering; niet toestaan dat cycli worden gevormd tussen kmalloc-typen wanneer
obj_exts-arrays toewijzen. Momenteel worden alle obj_exts-arrays geserveerd
van normale kmalloc caches. Cycli kunnen niet worden gemaakt als obj_exts-arrays
van normale kmalloc caches worden geserveerd vanuit een speciaal kmalloc type dat
nooit obj_exts-arrays hebben. Om dit te bereiken, maakt u een nieuw kmalloc-type aan met de naam KMALLOC_NO_OBJ_EXT. KMALLOC_NO_OBJ_EXT caches worden aangemaakt met SLAB_NO_OBJ_EXT flag wanneer
ofwel 1) geheugentoewijzingsprofilering is niet permanent uitgeschakeld,
of 2) kmalloc types met een prioriteit hoger dan KMALLOC_CGROUP zijn
aliased met KMALLOC_NORMAL. Sheaf bootstrapping voor KMALLOC_NO_OBJ_EXT caches moet nu worden uitgesteld
omdat toewijzing van een schuur obj_exts-arraytoewijzing van
normale kmalloc caches wanneer de KMALLOC_NO_OBJ_EXT cache voor die grootte
is nog niet klaar. Voor de eenvoud, voer bootstrapping van schijven uit voor
alle kmalloc caches later. Introduceer een nieuwe slabtoewijzingsvlag, SLAB_ALLOC_NO_OBJ_ext, om te voorkomen dat
toewijzing van obj_exts-arrays en laat kmalloc_slab() het type overschrijven
naar KMALLOC_NO_OBJ_EXT indien gespecificeerd. Merk op dat kmalloc_type() blijft
ongewijzigd omdat kmalloc_flags() het kmalloc-fastpad omzeilt. Geef SLAB_ALLOC_NO_RECURSE niet door aan kmalloc_flags() in
alloc_slab_obj_exts () en gebruik in plaats daarvan SLAB_ALLOC_NO_OBJ_EXT alleen wanneer
de objecten worden toegewezen vanuit normale kmalloc caches. Terwijl dit
voorkomt onbegrensde recursieve toewijzing van obj_exts, het maakt het mogelijk
KMALLOC_NO_OBJ_EXT caches to have sheaves. Aangezien schooftoewijzingen SLAB_ALLOC_NO_RECURSE specificeren die voorkomt
toewijzing van zowel schijven als obj_exts arrays, de recursiediepte
begrensd is. obj_exts arrays voor niet-
---verkort---

Origineel (Engels) tonen

In the Linux kernel, the following vulnerability has been resolved:

mm/slab: prevent unbounded recursion in free path with new kmalloc type

Commit 280ea9c3154b ("mm/slab: avoid allocating slabobj_ext array from
its own slab") avoided recursive allocation of obj_exts from kmalloc
caches of the same size, by bumping the obj_exts array's allocation
size whenever the array size equals the size of the object being
allocated.

However, as reported by Danielle Costantino and Shakeel Butt,
even slabs from kmalloc caches of different sizes can form a cycle
by allocating obj_exts arrays from each other [1]:

What happened: a KMALLOC_NORMAL slab's obj_exts array (used by
allocation profiling / memcg accounting) is itself kmalloc()'d from a
KMALLOC_NORMAL cache, so the "slab holds another slab's obj_exts array"
relation can form cycles. With sizeof(struct slabobj_ext) == 16 and
the host's geometry:

- kmalloc-512 has 64 objects/slab -> array is 64*16 == 1024 bytes,
served from kmalloc-1k;
- kmalloc-1k has 32 objects/slab -> array is 32*16 == 512 bytes,
served from kmalloc-512.

A kmalloc-512 slab and a kmalloc-1k slab therefore hold each other's
obj_exts array. Discarding one frees the other's array, which empties
and discards that slab, which frees the first's array, and so on:
__free_slab() -> free_slab_obj_exts() -> kfree() -> discard_slab() ->
__free_slab() recurses along the cycle until the stack is exhausted.

With memory allocation profiling, this allows unbounded recursion
in the free path and led to a stack overflow on a production host in
the Meta fleet [1]:

BUG: TASK stack guard page was hit
Oops: stack guard page
RIP: 0010:kfree+0x8/0x5d0
Call Trace:
__free_slab+0x66/0xc0
kfree+0x3f0/0x5d0
... ( ~125x __free_slab kfree ) ...

do_syscall_64

It is proposed [1] to resolve this issue by always serving the obj_exts
array allocation from kmalloc caches (or large kmalloc) of sizes larger
than the object size. However, as pointed out by Vlastimil Babka [2],
this can waste an excessive amount of memory as slabs from large
kmalloc sizes (e.g. kmalloc-8k) generally need obj_exts arrays much
smaller than the object size.

Therefore, rather than bumping the size, let us take a different
approach; disallow formation of cycles between kmalloc types when
allocating obj_exts arrays. Currently, all obj_exts arrays are served
from normal kmalloc caches. Cycles cannot be created if obj_exts arrays
of normal kmalloc caches are served from a special kmalloc type that can
never have obj_exts arrays.

To achieve this, create a new kmalloc type called KMALLOC_NO_OBJ_EXT.
KMALLOC_NO_OBJ_EXT caches are created with SLAB_NO_OBJ_EXT flag when
either 1) memory allocation profiling is not permanently disabled,
or 2) kmalloc types with a priority higher than KMALLOC_CGROUP are
aliased with KMALLOC_NORMAL.

Sheaf bootstrapping for KMALLOC_NO_OBJ_EXT caches now must be deferred
because allocation of a barn can trigger obj_exts array allocation of
normal kmalloc caches when the KMALLOC_NO_OBJ_EXT cache for that size
is not ready yet. For simplicity, perform bootstrapping of sheaves for
all kmalloc caches later.

Introduce a new slab alloc flag, SLAB_ALLOC_NO_OBJ_EXT, to prevent
allocation of obj_exts arrays, and let kmalloc_slab() override the type
to KMALLOC_NO_OBJ_EXT when specified. Note that kmalloc_type() remains
unchanged because kmalloc_flags() bypasses the kmalloc fastpath.

Do not pass SLAB_ALLOC_NO_RECURSE to kmalloc_flags() in
alloc_slab_obj_exts() and instead use SLAB_ALLOC_NO_OBJ_EXT only when
the objects are allocated from normal kmalloc caches. While this
prevents unbounded recursive allocation of obj_exts, it allows
KMALLOC_NO_OBJ_EXT caches to have sheaves.

Since sheaf allocations specify SLAB_ALLOC_NO_RECURSE that prevents
allocation of both sheaves and obj_exts arrays, the recursion depth
is bounded.

obj_exts arrays for non-
---truncated---

References