Kernel root exploit & boot persistence research on Sony Bravia Android TV (MT5890): CVE-2022-22706 page-cache write, targeted setresuid hook, and persistent root console
Consumer embedded appliances routinely reach end-of-support while remaining active daily-driver devices in living rooms. The Sony Bravia XBR-65X850D (board platform SVP-DTV15, MediaTek MT5890 SoC) received its final system firmware upgrade to Android 8.0.0 Oreo (OPR2.170623.027.S16, release 6.827) in early 2020. The Android Security Patch Level (SPL) was frozen at 2020-01-01 and never patched again.
Standard device hardening enforces strict hardware and OS-level boundaries:
ro.boot.flash.locked=1, ro.secure=1, ro.debuggable=0, and kernel dm-verity cryptographically seal /system against offline modification./data is mounted nosuid, neutralizing classic setuid binary drops.enforcing mode across all domains (permissive=0). ┌─────────────────────────────────────────────────────────┐
│ SONY BRAVIA XBR-65X850D TRUST PERIMETER │
│ │
ADB TCP :5555 (uid 2000) ──►│ [Blocked] dm-verity: Read-only block storage (eMMC) │
│ [Blocked] nosuid mount on /data │
│ [Blocked] Recovery image signature verification │
│ [VULNERABLE] World-accessible /dev/mali0 (Midgard) │
└───────────────────────────┬─────────────────────────────┘
│
▼
CVE-2022-22706 Page-Cache Write Primitive
(Mutates memory without touching flash storage)
This repository documents the end-to-end vulnerability research, weaponization, and reboot-surviving persistence pipeline developed against this target. By exploiting CVE-2022-22706 in the unpatched ARM Mali kbase kernel driver, an arbitrary RAM page-cache write primitive was forged. This primitive was utilized to install a targeted syscall hook on libc.so (setresuid), allowing our probe application to retain uid 0 upon fork while preserving normal privilege drops for core Android TV services. Combined with a self-healing JobScheduler persistence loop, the exploit exposes a full interactive root shell over TCP port 4445 (LAN and Tailscale) that returns cleanly after every cold reboot without manual intervention.
The entire attack chain operates strictly in memory, leaving flash storage pristine and dm-verity validation 100% intact.
uid 2000 (u:r:shell:s0). Among 647 nodes in /dev, /dev/mali0 is world-accessible (crw-rw-rw-). The driver is ARM Mali Midgard r20p0-01rel0 (UK version 10.6), published in 2020 and unpatched against post-2020 CVEs.KBASE_REG_CPU_WR enabled but KBASE_REG_GPU_WR cleared. The target file (/system/lib/libc.so) is mapped read-only and mremap'd over the imported buffer. Submitting a soft-event-wait atom forces the kernel's get_user_pages() to pin the actual Linux page-cache page read-only while handing userspace a writable GPU alias. Writing through this alias mutates the shared executable memory of all system processes.setresuid Hook: The first 4 bytes of setresuid at offset 0x4a990 in libc.so are overwritten with an ARM branch b 0x25a90 (3e 6c ff ea). The branch lands in __ns_sprintrrf (an unused 7,724-byte DNS debug formatter). The hook checks r0 == 10014 (our probe app UID). If matched, it returns 0 (mov r0, #0; bx lr), bypassing the privilege drop. All other processes jump to the real syscall (mov r7, #208; svc #0; bx lr), preventing OS instability.BOOT_COMPLETED for sideloaded applications. Persistence is achieved via Android's JobScheduler (setPersisted(true), setMinimumLatency(1500)). The job runs under normal UID 10014, invokes JNI libpwn.so to re-apply the page-cache patch, schedules an AlarmManager wake-up (+3s), and kills its own process. The alarm triggers Zygote to fork a fresh process; setresuid intercepts the drop, and the application launches as uid=0(root).ConsoleService (a sticky foreground service) listening on TCP port 4445. It authenticates connections via token and executes shell commands as uid 0, bypassing Android framework permission gates.In Mali driver version r20p0-01rel0, user-space buffer memory imported via KBASE_IOCTL_MEM_IMPORT evaluates pinning flags inconsistently in mali_kbase_mem_linux.c:
/* Pinning logic in kernel driver: only GPU write flag governs FOLL_WRITE */
err = get_user_pages(current, current->mm,
reg->imported->user_buffer.ptr,
reg->imported->user_buffer.length >> PAGE_SHIFT,
reg->flags & KBASE_REG_GPU_WR ? FOLL_WRITE : 0, /* ← pin mode */
pages, NULL);
/* CPU mapping logic: governed by separate CPU write flag */
if (reg->flags & KBASE_REG_CPU_WR) {
/* allocates writable userspace CPU alias */
}
By requesting flags = KBASE_REG_CPU_RD | KBASE_REG_CPU_WR | KBASE_REG_GPU_RD (value 0x7), FOLL_WRITE is not passed to get_user_pages. The kernel pins the page without marking it dirty or triggering Copy-on-Write (COW).

Marco de pruebas de seguridad automatizado para aplicaciones móviles en Android, iOS y Windows. Realiza análisis estático y dinámico, detección de malware y pruebas de seguridad de API con integración CI/CD.

Herramienta de línea de comandos y GUI para descompilar archivos Android Dex y APK en código fuente Java legible, con capacidades de decodificación de recursos, desofuscación y depuración de Smali.

Una herramienta para la ingeniería inversa de archivos apk de Android.