adb to root on a locked Android TV: kernel LPE with GhostLock (CVE-2026-43499) on the onn 4K Pro
Summary
CVE-2026-43499 is a use-after-free in the futex PI requeue path of the android14-5.15 GKI kernel. This article documents a kernel local privilege escalation (kernel LPE): a port of the public GhostLock exploit family onto the onn 4K Pro Google TV (board jarvis2), a locked consumer device: bootloader locked, verified boot green, dm-verity enforcing, no OEM unlock path. The chain: unprivileged adb shell (uid 2000) to uid 0, full caps, per boot. All measurements below were taken on owned hardware at the stock build with no system update installed at any point.
Findings:
- The stock kernel build (
ab14657224, patch level 2026-06-01) is exploitable end to end from an unprivileged adb shell (uid 2000). Result: uid 0, full caps, per-boot. - Hit rate: about one land per 2-3 fresh boots, every observed land inside the first 6 minutes of uptime. Fastest observed: 13 seconds after firing.
- A miss is always a kernel panic (fatal oops with a PI lock held) and an unclean reboot. On f2fs, 26 panics in one day wedged the filesystem into a corrupted-data boot loop that needed a factory reset from the recovery partition.
- The SELinux state write choice dominates the device outcome: the family stock zero-write disables binder registration; a pointer-write preserves it. See the SELinux section.
- Framework lifetime after a hit is bounded: system_server dies ~43 seconds post-hit on the fastest observed boot, minutes on others, on every boot observed. See post-hit framework lifetime.
- Persistence across reboot is not possible on this device without breaking verified boot. No unlock path, no factory images, anti-rollback enforced.
Target
| field | value |
|---|---|
| device | onn 4K Pro Google TV (Walmart house brand) |
| board | jarvis2, Amlogic SoC, ~3 GB RAM (2 GB usable) |
| kernel | 5.15.196-android14-11-g3d26c188ef7e-ab14657224 (built 2026-01-03) |
| build | onn/jarvis2/jarvis2:14/URO3.260203.035.A1/15640252:user/release-keys |
| patch level | 2026-06-01 |
| boot chain | verifiedbootstate=green, flash.locked=1, veritymode=enforcing |
No OEM unlock token ships for this device, and the Amlogic ROM enforces the bootloader. The "flash a patched boot image" genre of Android rooting does not apply. Root has to come from the running kernel, per boot, every boot.
Kernel cmdline:
init_on_alloc=0 kasan.page_alloc.sample=10 stack_depot_disable=on
kvm-arm.mode=none board=jarvis2
init_on_alloc=0: reallocated pages keep the previous contents, which is what lets the UAF walks find live data. The KASAN knobs are sampling-mode only, so the primitives do not die on first touch.
The bug
futex_requeue() moves waiters between lock wait queues. The pre-fix remove_waiter() and the requeue walk read waiter->task without pinning the task. Under enough controlled PI churn, a waiter is walked after the task it references is freed, and the walk dereferences freed task memory through task->pi_lock and task->pi_waiters.
The fix (waiter->task / waiter_task->pi_lock revalidation) is in the android14-5.15 GKI branch HEAD today. The device build predates it by about six months. This is a port of a public bug, not a variant discovery: the work is making the published primitive land on this build, this RAM geometry, this box.
Test constraints
- No bootloader unlock attempts, no flashing, no partition writes.
- No system updates during the work.
- One exploit roll per fresh boot. No unattended crasher loops.
- The device must remain usable as a TV. This last constraint is not met on this build; see post-hit framework lifetime.
Porting
Per-build offsets, cross-checked against the device's own symbols (method from the family repos). Offsets were derived from the boot image, then verified after the first root against a live /proc/kallsyms pull (19.5 MB, real addresses, kptr_restrict relaxed from the privileged context):
| symbol | value | verification |
|---|---|---|
selinux_state |
device table anchor +0x29e9078 |
AVC pair convention |
init_cred, init_user_ns |
per live symbol table | kallsyms |
| kernel phys load | 0x01810000 |
/proc/iomem |
The kallsyms pull and allocator statistics (slabinfo, buddyinfo, pagetypeinfo, zoneinfo, vmstat) that the reclaim tuning is derived from are re-pullable from any rooted session and are not published.
Leak stage
Before any write, the exploit needs the address of a chosen victim process's mm_struct (which pins the spray-page geometry the cred plan writes into) and the kernel slide (to address selinux_state and the cred targets). Both come from the KernelSnitch method in the family sources, with no kernel pointer read:
- Private-futex hash oracle. For a private futex, the wait-queue bucket index is
futex_hash(uaddr, mm_struct): a Jenkins hash mixing the userspace futex address and the owningmmpointer. - The exploit blocks threads on private futexes and probes bucket-chain occupancy for chosen probe addresses. A probe that collides with the victim's bucket constrains the
mmaddress, because the bucket index depends on it. - Scanning probes across the identity-mapped VA range (39-bit VA on this build,
0x20000000steps) recovers the victimmm_structaddress by brute force. The traversal is non-destructive; a wrong probe costs nothing. leak_kernel_basethen derives the slide.selinux_stateand the cred targets are slide plus table offsets, cross-checked against a livekallsymsafter the first root (see Porting).
Write primitive
The primitive is the GhostLock rb_erase technique: walks over rt_mutex_waiter entries reinterpreted as rbtree nodes, each walk writing through the pi_tree_entry pivot into a chosen target. Two shapes:
child != NULL: *TARGET = child; child->__rb_parent_color = parent|colour
(two-store shape, used by the cred-swap walks)
child == NULL: *TARGET = NULL, plus a colour walk if the victim pc is BLACK
(zero-write shape)
The cred swap is the family recipe: walk 1 writes task->cred, walk 2 writes task->real_cred, both pointing at a fake cred on a spray page, plus a repair write for the first-8-byte clobber the erase leaves behind. Both pointers must land before any exec: commit_creds BUG_ONs unless cred equals real_cred.
SELinux state write
The family stock recipe writes 8 bytes of NULL at selinux_state[0..7]: enforcing, checkreqprot, initialized, and five policy capability bytes in one stroke. initialized is the sidtab population flag. On this device that is the wrong trade:
| write | state bytes | binder registration | observed device state |
|---|---|---|---|
| zero-write (family stock) | enforcing=0, initialized=0 | broken: getpeercon() fails kernel-wide, servicemanager rejects new registrations |
permissive root, box unusable as a TV |
| pointer-write (this port) | enforcing=0x00, initialized nonzero | working | root, box stays a usable TV until the post-hit window closes |
setenforce 0 from daemon |
enforcing off, policy intact | working | full caps under stock policy; not shipped (see below) |
This port writes a pointer instead of zeros: the fake-cred address, spray page +0xE00, through the same child != NULL shape the cred walks use. The spray page is order-2 aligned, so byte 0 of the pointer is 0x00:
enforcing(+0) = 0x00 permissive
checkreqprot(+1) = 0x0e no effect under permissive
initialized(+2) = nonzero sidtab stays populated, binder keeps working
policycap[0..4] = junk no effect under permissive
Measured on device: after a pointer-write hit, services re-register binder endpoints correctly, AVC lines print real contexts, and the box keeps functioning as a TV while rooted. Zero-write boots did none of that.
The third option, setenforce 0 from the rooted daemon (policy intact, sidtab healthy), grants sysctl/mount/iptables under the stock policy. The runner does not ship it: every process on the box keeps running under a policy that changed underneath it, and the sidtab-invalidation mode described above is where that path ends if anything reloads or re-anchors the sidtab. The port ships the pointer-write.
Reclaim environment
The reclaim geometry, not the primitive, is what takes the time. Working environment on this box (2 GB usable):
CRED_ATTEMPTS=6 PREPARE_SLABS=32 MOVABLE_STORM_MB=128 \
PCP_DRAIN_BURST=24 PCP_COUNT_DRAIN_MB=8 DRAIN_KILLS=64
Rationale, from the box's own knobs:
min_free_kbytes=12288,watermark_scale_factor=80: reclaim watermarks are small relative to memory size, so thePCP_COUNT_DRAIN_MB=8drain bites immediately.percpu_pagelist_high_fraction=0: default pcp sizing, so the drain numbers are not fighting a raised high watermark.- THP is
madvise: the movable storm is pure migrate pressure, no collapse interference. sched_rt_period_us=1000000,sched_rt_runtime_us=950000: the walk timing has to land inside the unthrottled 95% of each RT period.
Panic behavior
A miss is a walk landing on garbage while a PI lock is held. The oops fires with preemption off; panic_on_oops=1 on this build, so a miss is an immediate unclean reboot. panic_on_oops=0 (set by the delivery script for later trips from the rooted context) does not help mid-roll.
The filesystem is f2fs. 26 panic reboots in one day wedged the box into a corrupted-data boot loop; the recovery partition had to factory-reset its way out. Operating rules that follow: one roll per fresh boot, 45 second settle between rolls, no unattended or scheduled crasher.
Delivery
The root shell daemon is a while loop around nc -L -p 13337 /system/bin/sh, detached with nohup and </dev/null, re-arming after every connection. Constraints discovered on this build:
- adbd runs
PR_SET_CHILD_SUBREAPER. The exploit, delivery script, and daemon all live in its tree, soctl.restart adbdSIGKILLs the whole delivery mid-write. Observed once before the subreaper line was found in the boot log. - No runtime policy reload. A
loadon selinuxfs rebuilds the sidtab and invalidates every live process's cached SID; system_server then runs unlabeled until the next reboot. A reboot restores stock; nothing else does. - toybox
rebootis a silent no-op on this build. Rawreboot(2)works.
Post-hit framework lifetime
About 40 seconds after a clean hit, with nothing running but the exploit and the daemon, system_server dies:
E ServiceManager: android.os.DeadObjectException
E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: NetworkStats
I kernel: SELinux: security_sid_to_context_core: called before
initial load_policy on unknown SID 1046
I binder: 702:900 transaction call to 233:0 failed ... -22
Chain of events:
- The SELinux write leaves
selinux_statepointing into the spray page. - The exploit process tree exits; the page is freed and reused.
- The state bytes flip as the page is reused: enforcing back on, initialized off.
getpeercon()fails kernel-wide. servicemanager is alive but returns EINVAL on binder transactions.- system_server's periodic NetworkStats poll takes the failure as a FATAL and the framework dies.
- init does not respawn it:
init.svc.*properties go stale ("running" against dead pids),ctl.*commands return rc=0 and spawn nothing.
Observed lifetime: +43 seconds on the fastest boot, several minutes on others, but every post-hit boot observed eventually loses system_server this way. On this build, root and a live launcher do not coexist past that window. The rooted box is fully usable as a headless appliance: daemon, ssh, full chroot toolchain. Power-cycle restores the stock TV.
Display path: the box has no /dev/fb0; DRM master is held by the composer HAL (vendor.hwcomposer-3), not surfaceflinger. Taking DRM master requires killing the HAL, and its death cascades: surfaceflinger exits, then system_server's statsd puller null-derefs on the dead SF and dies. A splash-screen painter was removed from the runner for this reason; each use costs the framework. The painter source is not published.
Persistence and OTA
The CVE-2026-43499 fix is in the branch HEAD that any kernel OTA for this box would ship. There is no downgrade: anti-rollback enforced, no unlock, no factory images. An accepted system update ends the exploit permanently on this device.
Boot partition patching is equally closed: verified boot green, dm-verity enforcing, no unlock token path. Any boot/system/vendor write fails verification at the next boot, which is a brick, not a miss. Per-boot root is the terminal model on this build.
Defenses in order of effect:
- Never accept updates. This is the whole protection.
- Router DNS sinkhole for
fes.google.com(GMS SystemUpdateService endpoints). Survives reboots; covers the unrooted windows. - Per-boot iptables REJECT rules for the resolved update IPs, applied from the root daemon each rooted session. The runner does this automatically.
Rule 3 without rule 2 is partial coverage only: every fresh boot and every panic reboot leaves a window where the updater is reachable and nobody has clicked the adb popup yet.
Scope of root
Not available at uid 0, full caps:
- TEE/TrustZone: Widevine L1 keys, keystore hardware keys, the
teepartition. Not readable from the normal world. /system,/vendor,/odmwrites: dm-verity enforces at mount. Reads are fine; writes corrupt the next boot.- Binder from the shell/kernel contexts:
pm,am,cmd notification,screencapare policy-locked on this TV build. APK installs go through the on-device Play Store or not at all. - Persistence across reboot. Nothing survives.
Available: raw partition reads, kallsyms, ptrace of live processes from the daemon, full network egress, and a full Linux userland through an Alpine chroot (/data/glroot, persists across reboots; bind mounts are per-boot; dropbear ssh on :22, pubkey-only, bash).
Two operational warnings:
- toybox
tarprints "had errors" on a fully successful rootfs extraction. Judge by the tree, not the message. - Never
rm -rf /data/glrootwith bind mounts attached. The rm recurses throughglroot/devinto the live tmpfs and deletes/dev;/dev/__properties__was wiped this way once, disablinggetpropuntil the next power cycle. Unmount first, then delete.
Reproduction
adb connect <device-ip>:5555 # click Allow on the TV popup
python3 ghostlock_poc.py --host <device-ip>:5555 --bin ghostlock
Expected run: 1-10 rolls with panic reboots survived between them, then a root daemon on :13337 and an interactive root shell through it. The box keeps answering on the network throughout; the framework dies on the schedule described above.
The runner (ghostlock_poc.py, stdlib only) has no kernel filter: the operator verifies the kernel build by hand, --bin must match uname -r. An unverified-offsets fire is a brick lottery. The daemon probe treats any successful TCP connect as "root alive", because the nc daemon serves one connection at a time and a busy daemon must never look dead; a second exploit instance must never be fired onto a box that answers on the port.
Artifacts
Everything runnable is in tokenbleed/ghostlock-tv: the runner, a readme with the reproduction rules and reclaim knobs, and the compiled exploit binary as a release asset, built for the ab14657224 kernel. A different device requires building from the GhostLock family sources with new offsets.
Related work
The GhostLock family repos this port builds on: NebuSec/CyberMeowfia (the original x86_64 landing, IonStack part II), k-o-n-t-o-r/ghostlock-sabrina (the closest device class to this box), XiaoBaiLovesStirring/ghostlock-k419-adapter (boot-window timing), and JoinChang/ghostlock-oneplus (the Path A UMH writeup, which this port's SELinux decision diverges from).
Status
The upstream fix exists and ships in the branch HEAD. This work is authorized research on owned hardware and documents the device-side state of a locked consumer TV before its OEM ships the fix.