Introduction

This is a walkthrough of a privilege escalation on an Android device running a Corellium build of Linux 6.6.46 (6.6.46crlm, arm64, 4 KB pages, 39-bit virtual addresses, three translation levels). The bug is a one-line mistake in a custom character driver, /dev/vector: when a copy_from_user() fails during allocation, the driver frees the object but leaves the pointer to it in its table. From that dangling pointer the exploit gets a page that the kernel uses as a page table, writes its own page table entries into that page, and from there reads and writes any physical page it likes.

The technique is the Dirty Pagetable primitive, which is not new. This build differs from the textbook version in four places: the layout of the object, the slot that lands on the page table, how the kernel base is found without a leak, and the single byte that turns SELinux off. Each is covered below.

The claims below were checked against the binary (vmlinux with DWARF) and against the upstream 6.6.y source. Where a claim is only inferred from the code and not traced in a run, the text says so. The exploit is in exploit/exploit.c, and the constants it uses are taken from the same vmlinux.

The target build

The challenge kernel is 6.6.46crlm. Four properties of the build matter for this exploit, and they were checked from .config and the binary.

Property Value Why it matters
CONFIG_RANDOMIZE_BASE not set The kernel’s virtual base is fixed at 0xffffffc080000000. The offsets used in the exploit are constants, not leaks.
CONFIG_ARM64_4K_PAGES, CONFIG_ARM64_VA_BITS_39, CONFIG_PGTABLE_LEVELS=3 set Three translation levels, and one level-3 table covers 2 MB.
CONFIG_STATIC_USERMODEHELPER=y set modprobe_path cannot be used as a root trigger (covered later).
CONFIG_SECURITY_SELINUX_DEVELOP=y set selinux_state.enforcing is a real runtime variable that the access check reads.

Two symbols anchor every offset in the exploit. linux_banner is at 0xffffffc081377f28, which is _text + 0x1377f28. selinux_state is at 0xffffffc081b32fa0, which is _text + 0x1b32fa0. Both come from nm on the same vmlinux that the device runs.

The source tree shipped with the challenge contains only the driver, drivers/char/vector/vector.c. The generic kernel code (SLUB, the page allocator, page-table allocation, the SELinux access check) comes from the upstream linux-6.6.y branch. The branch head is not the v6.6.46 tag, so a small difference in backported fixes is possible. Where the binary and the upstream source disagree, the binary wins.

The driver

vector.c is a character device (registered with register_chrdev, a class, and a /dev/vector node) with one global mutex and a table of up to 0x500 (1280) slots. Each slot holds a pointer to a 256-byte object of type vector_t, allocated from a dedicated slab cache created with kmem_cache_create("vecache", 0x100, 0, SLAB_NO_MERGE, NULL). SLAB_NO_MERGE stops SLUB from sharing that cache with any other one, so the slab pages used for these objects only ever hold vector_t objects.

The object layout is in the DWARF of vmlinux:

typedef struct vector_t {
    void    (*destructor)(void *);   /* 0x00 */
    uint64_t inuse;                  /* 0x08 */
    uint64_t vec[30];                /* 0x10 .. 0xff */
} vector_t;

There are four ioctls. The user-visible argument is a small struct with an index, a slot number and a pointer or value.

Command What it does
ALLOCATE (0x1337001) Finds the first free slot, allocates a vector_t, copies 0xf0 bytes from the user pointer to obj+0x10, and returns the slot number.
UPDATE (0x1337002) Writes vec[idx] of slot fdx. Checks fdx <= 0x4ff and idx <= 29, and that the slot is non-NULL.
GET (0x1337003) Reads vec[idx], with the same checks. Not used by the exploit.
DESTROY (0x1337004) Sets inuse = 0, calls destructor(obj) (here vector_free_callback, which calls kmem_cache_free on a non-NULL argument), then sets vecs[fdx] = NULL.

The ALLOCATE path is where the bug is. Its code, paraphrased from vector.c lines 82 to 108, reads like this:

for (fdx = 0; fdx < 0x500; fdx++)
    if (!vecs[fdx]) break;
vecs[fdx] = kmem_cache_alloc(vecache_cache, GFP_KERNEL);
if (copy_from_user(&vecs[fdx]->vec, user_ptr, 0xf0)) {
    kmem_cache_free(vecache_cache, vecs[fdx]);   /* object freed */
    /* vecs[fdx] is NOT set to NULL */
    return -1;
}

The disassembly confirms the missing store. After the kmem_cache_free call there is no write to the slot, so the table keeps a pointer to memory that now belongs to SLUB.

Nothing in the driver checks inuse, and nothing else clears a stale slot. UPDATE and GET only check that the slot is non-NULL, so both happily operate on a freed object.

The bug in one picture

A vector_t object, byte by byte, with the UPDATE write window and the stale slot.

UPDATE writes at obj + 0x10 + 8*idx for idx in 0..29. The object is 256 bytes, so the writable window covers offsets 0x10 to 0xf7. While the object is free, SLUB stores its free pointer inside it. With no constructor, RCU, poisoning or redzone flags, upstream calculate_sizes places that pointer at ALIGN_DOWN(object_size / 2, 8), which is offset 0x80 (vec[14]), not offset 0. So a write through the stale slot can reach the free pointer while the object is free. The exploit’s writes happen only after the page has become a page table, so the chain is not affected. Offset 0 would apply only if a boot-time debug flag (poison, redzone or store-user) were set, and the kernel command line was not available to check that.

Turning a dangling object into a page

A dangling pointer to a 256-byte object is useful only if the object can become something larger, or something else. The exploit wants the whole slab page, not just the one object, because a page of a kernel-only cache can be returned to the page allocator, and from there reused for any order-0 allocation.

Step 1: free the object and keep the pointer

trigger_uaf first calls ALLOCATE with a NULL user pointer. The copy_from_user fails (the source is address 0, which is unmapped), so the driver frees the new object and returns -1. Slot 0 still points to the freed object, call it A.

The next ALLOCATE with a valid buffer scans from slot 0. Slot 0 is non-NULL, so the scan picks slot 1. SLUB’s per-CPU freelist hands back the object it just freed, so slot 1 now also points to A. The exploit keeps the offset between the two slots: g_dangling = first - 1, which is 0 in a fresh process. The bug is “the slot below the one we just filled is stale”, and it is always slot 0 here.

Reuse of A through the LIFO per-CPU freelist is an inference from the code, not something the run traced. It does not matter for the rest of the chain, because only the slot number and the page are used later.

Step 2: fill the slab page and free all of it

cross_cache_free fills 1200 slots with live objects: slot 1 is the alias of A, and slots 2 to 1200 are fresh objects that fill the rest of A’s page and the pages after it. It then destroys all 1200 in order. The first DESTROY frees A through slot 1, and the others free everything else.

The reason for freeing everything is how SLUB returns memory. A slab page is handed back to the page allocator only when its last in-use object is freed, and even then only under a further condition. For a slab that is not frozen (not the CPU’s current slab or on its per-CPU partial list), SLUB discards it only when the node’s partial list already holds at least min_partial slabs. For this cache min_partial is 5, so up to five empty slabs per node keep their pages. A partially used slab always keeps its page. The exploit therefore frees every object, which empties every slab it created. Whether the page of A is actually returned depends on whether its slab is among the retained ones, and that is a runtime question. The notes say the chain worked, but no run was traced to show that page’s return.

The object count is bounded by the driver: MAX_VECS is 0x500 (1280 slots), and the exploit uses 1200 of them, so the spray fits under that limit. The OBJS_PER_SLAB = 16 constant assumes that one 4 KB page holds 16 of these objects. That assumption holds only when the machine has fewer than eight CPUs, because SLUB chooses a larger order for more CPUs. The device CPU count is not recorded in the notes, so this is the first thing to recheck on a new target.

Four stages: a full slab page, all objects freed, the page on the per-CPU list, the page reused as a page table.

Step 3: the page goes back to the page allocator

When the last object of the slab is freed, SLUB calls __free_slab, which calls __free_pages for the order-0 page. In upstream 6.6 the order-0 free goes to the per-CPU page list of the CPU that frees it (free_unref_page in mm/page_alloc.c). That list is last in, first out. The freed page becomes the head of the list, and the next order-0 allocation of the same migratetype on that CPU takes it back.

The reuse path is predictable for two reasons:

  • Slab pages and page-table pages are both allocated as GFP_KERNEL-family, so both use the UNMOVABLE migratetype, and they share the same per-CPU list. GFP_PGTABLE_USER is GFP_KERNEL | __GFP_ZERO | __GFP_ACCOUNT, and neither includes a mobility flag.
  • Pinning the process to CPU 0 (pin_to_cpu0_and_raise_limits) keeps the freeing and the allocating on the same per-CPU list. If the task moved to another CPU between the frees and the spray, the page would sit on the wrong list.

Some of this is verified (the list operations and the flags), and some is inferred (how many pages are consumed before the target one is reached, which the code cannot tell). The spray is designed to consume enough pages to make the hit likely, and the next section explains how the exploit detects a hit.

Reclaiming the page as a page table

Why 256 regions

spray_page_tables maps 256 regions at 0x100000000 + i * 0x200000 (a 512 MB span), and touches one byte in each. Each first touch makes the kernel allocate a level-3 table, because each table covers exactly 2 MB.

The allocation path is verified in upstream 6.6:

do_pte_missing -> do_anonymous_page -> pte_alloc -> __pte_alloc
  -> pte_alloc_one (__pte_alloc_one with GFP_PGTABLE_USER)
  -> alloc_pages(gfp | __GFP_COMP, 0)

GFP_PGTABLE_USER includes __GFP_ZERO, so the allocator zeroes the page before the kernel uses it as a table. Any old content of the reclaimed slab page, including the object data, is cleared at that moment. The 482 entries that the exploit does not write are zero, which means they are invalid descriptors.

All 256 regions share one 1 GB span and therefore one level-2 table (the PMD table), which the kernel allocates once. Each region has its own level-3 table. So the spray produces 256 level-3 tables, and one of them may be the page that held A. Which one is not known in advance; the search below finds it.

Why the exploit can find the table without a map

The exploit does not know which of the 256 tables is the reclaimed one, and it does not need to. It writes its descriptors into the reclaimed table through A, then searches the regions for the table that now shows the kernel banner. The search is covered in the next sections.

What matters is where the writes land. The object A sits at slot k of its slab page, so its vec[] starts at byte 256*k + 0x10 of the page. The level-3 table reads its entries as 8-byte descriptors, so the entry index of vec[j] is:

entry = (256*k + 0x10 + 8*j) / 8 = 32*k + 2 + j      (j in 0..29)

So the writable entries are 32k+2 through 32k+31. The first of these is g_first_entry. The exploit recovers it at run time, not from k: it scans the region in steps of 8 to find an entry that holds the banner, then walks back one entry at a time to the first entry that still does. The walk stops at 32k+2 because the entry below it, 32k+1, is byte 8 of the slot, which was the object’s inuse field (1 while the object was allocated). The page was zeroed when it became a table, so that entry now reads 0 and is not a valid descriptor.

Every multiple of 8 in [32k+2, 32k+31] is within reach of the scan, so the scan always finds one of them, whatever k is.

The window

The reclaimed level-3 table: 30 writable entries, a window mapping, and the 256 regions above it.

The exploit calls the 30 writable entries its window. map_entry(slot, phys) writes descriptor vec[slot], which is table entry 32k+2+slot, and window_page(slot) reads the virtual address region + (g_first_entry + slot) * 0x1000, which goes through that same entry. The two indices agree, so writing a descriptor and then reading the page it maps are consistent.

Dirty Pagetable: the descriptor and the TLB

The page-table entry

The constant used for every window entry is 0x0060000000000f43. Decoded against the ARMv8 stage-1 page descriptor format and Linux’s pgtable-hwdef.h and pgtable-prot.h:

The PTE template 0x0060000000000f43, bit by bit.

Bits Value Meaning
0 1 valid
1 1 page descriptor (level 3)
4:2 000 AttrIndx 0: MAIR index 0
6 1 AP[1] = 1: accessible from EL0
7 0 AP[2] = 0: writable
9:8 11 inner shareable
10 1 AF: no access-flag fault
11 1 nG: ASID-tagged
53 1 PXN: no execution at EL1
54 1 UXN: no execution at EL0
47:12 0 output address, filled in by OR-ing the physical page

PT_ENTRY | (phys_page & ~0xfff) therefore gives a user-accessible, writable, non-executable page mapping of any physical page. Nothing here needs kernel code execution, and the page is not executable from either exception level.

The attribute index deserves a note, because it is easy to get wrong. AttrIndx=0 looks like device memory in some write-ups, but in this kernel it is not. __cpu_setup writes MAIR_EL1 = 0x00000004_0044ffff, so index 0 holds 0xff, which is Normal, Write-Back. The kernel’s own linear mapping of RAM is built from PAGE_KERNEL, which uses the same Normal memory type (inferred from the header, not traced in the binary), so the exploit’s alias should not conflict with the kernel’s view of the same page.

Why the TLB needs a flush

The MMU caches translations. After the exploit changes a descriptor, a read through the old translation can return stale data, and that happened in the early attempts. The fix is tlb_flush:

mprotect((void *)PT_BASE, PT_COUNT * PT_SPAN, PROT_READ);
mprotect((void *)PT_BASE, PT_COUNT * PT_SPAN, PROT_READ | PROT_WRITE);

mprotect walks the page tables of the span under an mmu gather, and the entries whose protection changes are flushed through the arm64 TLB helper. That invalidates this process’s ASID, which is what the code path implies (not traced at runtime). The forged descriptors are rewritten by the kernel’s own permission-change path on the way. That path keeps the AF, nG and SH bits, and the AP and XN bits come back the same (not traced at runtime). Earlier attempts used madvise(MADV_DONTNEED) for the same purpose, and that corrupted the forged entries, which is why it was dropped. The notes record the corruption, but this writeup did not reproduce it.

The physical read/write function

map_phys(phys) moves the window to the wanted page. It takes the next free slot, writes a descriptor for phys, and returns the address of the byte in the window. When all 30 slots are used, it flushes and starts again. Every read and write of physical memory in the exploit goes through this function.

Finding the kernel without a leak

The exploit needs the physical address of the kernel image to compute selinux_state. The image is not randomized, so only its physical location is unknown.

The candidate loop: 2 MB physical candidates, the test on the banner string, and the hit.

find_kernel_base tries candidates from 0x40000000 upward in 2 MB steps, up to 0xc0000000. That is 1024 candidates. For each candidate B:

  1. The 30 window slots are pointed at the page that would hold the banner if the kernel were at B: (B + 0x1377f28) & ~0xfff.
  2. tlb_flush makes the new mapping visible.
  3. locate_banner scans the 256 regions, looking at entry index p of each region (0, 8, 16, …, 504, which is 64 probes per region) for the 16-byte string Linux version 6. at page offset 0xf28.

The string is safe to use as a landmark because it is a fixed 16-byte prefix of linux_banner, which sits in .rodata, at a fixed offset from _text. It does not straddle a page boundary, because 0xf28 + 16 < 0x1000. A candidate that is not 2 MB aligned is never tested, and the kernel image is placed at a 2 MB aligned base by the boot protocol (booting.rst).

The cost per candidate is 30 descriptor writes, one tlb_flush (two mprotect calls over 512 MB), and at most 256 regions times 64 probes, which is 16,384 probes. The worst case, a sweep of all 1024 candidates, is therefore about 16 million probes and roughly 30,000 descriptor writes. A hit returns early, and the search stops at the first match. The run notes record that the device matched at the first candidate, 0x40000000, which is also the start of RAM. The local QEMU run matched at 0x40200000. Both are 2 MB aligned.

Two caveats. The check is 16 bytes long, and the search does not verify a second landmark, so a copy of the same 16 bytes at exactly the same offset would be a false positive. The probability is low, but it is not zero. And the search assumes RAM starts at 0x40000000, which the device’s /proc/zoneinfo confirmed (start_pfn 262144), but a different machine could differ.

Disabling SELinux with one byte

With a physical read/write primitive, SELinux is one write away. selinux_state is at 0xffffffc081b32fa0, and enforcing is a bool at offset 0 of that structure. The exploit writes 0 to the byte at the physical address text_phys + 0x1b32fa0.

The access check path for a file open, and the branch that the exploit’s write selects.

The check that reads it

avc_denied decides whether a denied access is refused. In vmlinux the decision reads the byte and tests it. Disassembled, the sequence is:

adrp  x4, 0xffffffc081b32000
ldrb  w4, [x4, #4000]     ; 0xffffffc081b32fa0 = selinux_state + 0 = enforcing
mov   w9, w1
tst   w4, #0xff
mov   w1, w3
and   w3, w5, #0xff
b.eq  0xffffffc0804af840  ; enforcing == 0 -> grant

The mov and and instructions between the load and the branch only prepare arguments for the grant path, so the test itself is the tst and b.eq pair.

The test is a byte compare with zero, not tbz #0. Since the field is a bool, 0 and 1 are the only values, so the result is the same. A 0 in the byte takes the permissive branch, and the access is granted, with the audit record still produced by the caller.

The upstream logic in security/selinux/avc.c agrees. avc_has_perm_noaudit looks up the access vector cache. On a miss, or a hit that lacks the permission, it calls avc_denied. avc_denied returns -EACCES only when enforcing_enabled() is true and the permission is not marked permissive. Otherwise it updates the cache to grant the bits and returns 0.

The cache matters. After the first permissive decision, the granted bits are cached, so later checks for the same access do not reach avc_denied at all. Clearing enforcing therefore takes effect for every access in the cache without further work.

What else the read needs

Root alone does not read /data/vendor/secret/flag.txt. Two other checks apply:

  • DAC. Root bypasses mode bits only with CAP_DAC_OVERRIDE or CAP_DAC_READ_SEARCH, and those are capability bits in cred. The root patch sets them (below).
  • MAC. The open goes through security_file_open and security_inode_permission, which reach the SELinux hooks, and from there avc_has_perm. This is the path the single byte changes.

Because the exploit clears enforcing before it patches the cred, the flag read is allowed under both checks. The notes record the flag being read by a root process after the patch, but no kernel-side SELinux denial log was kept for the successful run.

Root: the cred scan

The layout

The cred structure that holds a process’s credentials has 184 bytes, and the slab cache for it (cred_jar) is created with SLAB_HWCACHE_ALIGN. The offsets, from pahole on the same vmlinux:

The cred structure as an offset strip, with the bytes the exploit zeroes and sets.

Offset Field Exploit action
0 usage (refcount) read, must be between 1 and 0x1000000
8 uid zeroed
12 gid zeroed
16 suid zeroed
20 sgid zeroed
24 euid zeroed
28 egid zeroed
32 fsuid zeroed
36 fsgid zeroed
40 securebits untouched
48 cap_inheritable set to all ones
56 cap_permitted set to all ones
64 cap_effective set to all ones
72 cap_bset untouched

cred_matches_uid checks four of the u32 ids (uid, suid, euid, fsuid) equal to the target uid, plus the refcount range. make_cred_root zeroes bytes 8 to 39, which covers all eight ids, and sets the three effective capability masks to ones.

The cap_bset mask is left alone. It limits what an execve can grant, and the exploit does not need it, because the flag reader is already running in-process with full effective capabilities.

The scan

scan_and_root_creds(uid) reads every page of RAM between 0x40000000 and 0xc0000000, through the same window, and tests the 21 offsets at 192-byte stride within each page. The stride comes from rounding the 184-byte object up to a 64-byte cache line (SLAB_HWCACHE_ALIGN). That the cred objects sit at multiples of 192 within a slab page is an inference from the cache alignment, and the scan relies on it.

For each match it patches the object. Any process whose cred is one of those objects becomes root at its next getuid or open, because the kernel reads the cred on each check.

Why the workers fork before the scan

spawn_flag_readers(40) forks 40 children before the scan. A plain fork does not share the parent’s cred: upstream copy_creds calls prepare_creds for a non-thread clone, so each child gets its own cred object. The uid is the caller’s, which is 2000 when the exploit runs from the Android shell. Each one then matches the scan separately, and the scan roots all of them.

The children poll getuid() every 2 ms for up to 2000 tries, and read the flag as soon as they see uid 0. So the exploit does not need to know which child is patched first, or whether the parent has been patched yet.

The earlier attempt walked the task list from init_task to find the current task’s cred. It was unreliable past roughly 50 to 116 tasks, which is why the cred scan replaced it.

Mitigations and what they changed

Mitigation State Effect on this chain
KASLR (RANDOMIZE_BASE) off Constants are fixed. Only the physical base is searched.
SLAB_FREELIST_RANDOM on Shuffles objects within a slab page. Whole-page reuse still works.
SLAB_FREELIST_HARDENED on Encodes the free pointer, which sits at offset 0x80 of a free object. The stale-slot writes reach that offset only after the page is a page table, so no free-list corruption occurs.
SLUB_CPU_PARTIAL on Can keep empty slabs on per-CPU lists. The spray size and CPU pinning compensate.
HARDENED_USERCOPY on The driver’s copy is in bounds, so no trip.
STRICT_KERNEL_RWX on Does not affect the forged user mapping of a physical page.
PAGE_TABLE_CHECK off Forged descriptors are not checked.
STATIC_USERMODEHELPER on Overwriting modprobe_path does nothing (below).
PAN, SW_TTBR0_PAN, UNMAP_KERNEL_AT_EL0 on Constrain kernel and EL0 access, not the exploit’s own user mappings.
CFI, shadow call stack, BTI in kernel, PAC, MTE off No control-flow protection that a data-only chain would hit.
SECURITY_SELINUX on Enforcing bit is writable through the primitive. There is no SELINUX_DISABLE. SECURITY_SELINUX_DEVELOP=y allows a runtime switch to permissive through /sys/fs/selinux/enforce, subject to policy.

STATIC_USERMODEHELPER was the least obvious of the mitigations. With CONFIG_STATIC_USERMODEHELPER_PATH set, call_usermodehelper_setup in kernel/umh.c ignores the path it is given and always runs /sbin/usermode-helper. The disassembly of call_usermodehelper_setup shows the incoming path being clobbered and the static string being stored in its place. __request_module still reads modprobe_path[0] as a check, but the program it runs is fixed, so changing the variable changes nothing that executes. The root path is the cred scan, not a modprobe trick.

Most of the other mitigations are absent or do not apply to a data-only chain, which keeps the chain short.

What failed on the way

The run notes record these failures. The logs for them were not kept in full, so the descriptions below are what the notes say, not re-tested results.

  • Cross-cache with staggered frees. Freeing the objects in a staggered pattern left the target page in a per-CPU or partial slab, so it was never returned to the page allocator. Freeing everything in one batch fixed it.
  • pipe_buffer ring reclaim. The reclaim landed on data pages more often than on the wanted page. Switching to page-table reclaim fixed it.
  • msg_msg for the write. The write variant needs timing control that the device did not give. Not used.
  • modprobe_path overwrite. The write landed, and nothing ran, because of STATIC_USERMODEHELPER.
  • Task-list walk. Unreliable after roughly 50 to 116 tasks. Replaced by the cred scan.
  • ARM64 image header magic. The image contains the header signature at _text + 0x38, but the notes record that it could not be found in memory at run time. That absence was not re-checked here. The search moved to linux_banner.
  • Stale translations. Reads through a forged entry returned old data until the mprotect flush was added.
  • MADV_DONTNEED on forged pages. Corrupted the forged entries. Replaced by the mprotect round trip.

The one failure from a real console log in the notes is from an older build. It shows NULL dereferences and kmem_cache_free warnings, which fit a wrong-cache free. Those lines are not from the current exploit.

Running it

The exploit is a single C file with no dependencies beyond libc. It builds for the target with:

aarch64-linux-gnu-gcc -O2 -static -no-pie exploit.c -o exploit

The success lines are the printf messages in the source: [*] UAF + cross-cache ok (256 page tables), [+] kernel phys base = 0x..., [+] SELinux enforcing -> 0, [+] N cred(s) rooted, and then [FLAG] ... when the flag reader finds uid 0. The notes record a successful device run that printed the flag, but the console transcript itself was not saved, so this post shows the messages and not a captured output.

Limits of this writeup

  • The generic kernel code is checked against upstream linux-6.6.y, not the exact v6.6.46 tag. Corellium-specific changes are checked only where the binary was read.
  • The CPU count of the device is unknown. The 16-objects-per-slab assumption holds below eight CPUs.
  • The cross-cache return path, the LIFO reuse of object A, and the number of pages consumed before the target is reached are inferences. The code is consistent with them, but they were not traced in a run.
  • The SELinux flag-read path after the byte write is checked in the disassembly and the upstream source. The policy and the flag’s label were not available, so the final allow decision is inferred from the design.
  • The device physical base of 0x40000000 comes from the run notes, not from a captured log.

Conclusion

The bug is a missing NULL after a failed copy, and everything else follows from it: a freed object becomes a slab page, the page becomes a page table, the page table becomes a window on physical memory, and that window finds the kernel and clears SELinux. The root step is a data scan: nothing in this build blocks writes to kernel data through a user mapping, so no control-flow hijack is needed. The details that decide whether the chain works are small: which slot lands on which table entry, which slab order the cache gets, and how many CPUs the machine has.