Linux Kernel 7.0 Slub allocator: Sheaf-based exploitation
Preface
along with the linux kernel 7.0 update, the slab allocator has made a lot of changes like replacing the slab freelist layer with sheaves which is small arrays of object pointers, along with the performance improve, it also caused some mitgation fail and boundary check missing, making sheaf a new target to exploit.
this blog mainly talk about new techniques(concepts) to exploit sheaves.
Architecture

Allocation flow

for more detailed slub allocator 7.0 analyze:
https://zkltch.me/2026/09/03/Linux%20kernel%207.0%20Slub%20allocator%20analyze/
and our primary target is slab_sheaf
1 | struct slab_sheaf { |

Mitgation failure
CONFIG_SLAB_FREELIST_HARDENED
back in 6.* the slub allocator use set_freepointer and get_freepointer to take the object pointer encoded with ptr ^ s->random ^ swab(ptr_addr) before alloc/free the object to freelist in fastpath

but in the new 7.0 slub allocator, added sheaf layers as fastpath and its implementation just directly alloc/free the object to it’s object pointer array of the sheaf
https://elixir.bootlin.com/linux/v7.0/source/mm/slub.c#L4671
1 | static __fastpath_inline |
literally just pop the object from main sheaf
1 | object = pcs->main->objects[pcs->main->size - 1]; |
CONFIG_SLAB_FREELIST_HARDENED does not apply to sheaf layer
CONFIG_SLAB_FREELIST_RANDOM
back in 6.* it was used to randomize the slab layout so the attacker cant predict the address next object allocate
but in linux kernel 7.0 this only apply to slowpath which is kmem_cache->offset (pointintg to a slab freelist)
and not apply to sheaf layer
double free check
a bit similar to the root cause of CONFIG_SLAB_FREELIST_HARDENED
the reason why double free check is also failed for sheaf layer is that it also dont use set_freepointer to free the object to sheaf object pointer array
the set_freepointer function will encode the pointer and detecting the double free/memory corruption
set_freepointer()
https://elixir.bootlin.com/linux/v7.0/source/mm/slub.c#L537
1 | static inline void set_freepointer(struct kmem_cache *s, void *object, void *fp) |
as for sheaf implementation
free_to_pcs()
https://elixir.bootlin.com/linux/v7.0/source/mm/slub.c#L5763
1 | static __fastpath_inline |
the way sheaf free object just pcs->main->objects[pcs->main->size++] = object push the object back to the main sheaf object pointer array without any double free/memory corruption checking
Techniques
the below techniques based in theory only showing the capable of it
in real exploit of these technqiues needs a lot more:
- the bug itself: heap overflow or UAF in a kmalloc bucket that hold a sheaf struct
- heap spray against
CONFIG_RANDOM_KMALLOC_CACHES - KASLR leak
- more…
Technique 1 - Object pointer array hijack
since CONFIG_SLAB_FREELIST_HARDENED and CONFIG_SLAB_FREELIST_RANDOM doesnt apply to sheaf object pointer array
so we can just hijack the next pop pointer
to achieve arbitrary alloc/write
- example: if u already knew kernel base address then just overwrite next object that will be allocated to the address of
modprobe_path

after got the hijacked object(modprobe_path) from kmem_cache_alloc() or kmalloc then just overwrite it to ur file path of binary/bash script
trigger request_module and run the binary/bash script you provided with root
Technique 2 - Out of bound free/write
https://elixir.bootlin.com/linux/v7.0/source/mm/slub.c#L404
1 | struct slab_sheaf { |
the size variable is used to control the index of object array
no boundary check for size , only check if the size is full
https://elixir.bootlin.com/linux/v7.0/source/mm/slub.c#L5763
1 | static __fastpath_inline |
by corrupting the size to make the slub allocator free where it pointing to
- example: out of bound free a object with fake
credstruct

Technique 3 - Out of bound alloc infoleak
if we can do oob free we can do oob alloc too by corrupting the size field and try oob alloc surround heap struct that contains kernel pointer
- example: if
fd_arrayis around the corrupted object , we can oob alloc one offile structand read thef_opfield which contains.rodatapointer to defeat KASLR

Technique 4 - Out of bound alloc leakless LPE
same primitive but write instead of read
by writing
- this example is basically as same as technqiue 3 but this time spraying
open("/etc/passwd", O_RDONLY)and heap oob alloc first
1 | for (i = 0; i < 512; i++) |
after that instead of read .rodata pointer we overwrite the f_mode which is the permission flag of that file to 0x40012: FMODE_WRITE | FMODE_PWRITE | FMODE_CAN_WRITE
so we can write /etc/passwd without root

References
https://zkltch.me/2026/09/03/Linux%20kernel%207.0%20Slub%20allocator%20analyze/
https://duasynt.com/blog/linux-kernel-heap-feng-shui-2022
https://slavin.cn/2024/05/06/Slub-allocator-%E5%88%86%E6%9E%90/
https://fosdem.org/2026/events/attachments/DPXVYJ-slub-sheaves-update/slides/267397/fosdem-sh_pvi6fpf.pdf
https://elixir.bootlin.com/linux/v7.0/source/mm/slub.c
https://elixir.bootlin.com/linux/v7.0/source/include/linux/slab.h
https://naup.mygo.tw/2026/08/22/Harvest-Season-For-Slub/