Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2025-21479 — Temporary root exploit for vivo X Fold+ (CVE-2025-21479): GPU physical memory read/write, __do_sys_capset shellcode patch, seccomp/SELinux bypass and KernelSU activation. | Kitploit
Tools/GitHubGitHub/catxiaoshi/cve-2025-21479
Android SecurityPrivilege EscalationMemory ForensicsExploitationReverse EngineeringShellcodeMobile SecurityPayload DevelopmentBinary Exploitation
GitHubcatxiaoshi/cve-2025-21479

CVE-2025-21479

Temporary root exploit for vivo X Fold+ (CVE-2025-21479): GPU physical memory read/write, __do_sys_capset shellcode patch, seccomp/SELinux bypass and KernelSU activation.

Nov 15, 2026Not yet reviewed
Share
View Repository

Temporary root on vivo X Fold+ based on CVE-2025-21479

In the previous article, I achieved a temporary root shell using the cred method (see my previous post https://www.coolapk.com/feed/73490425?s=NjQ3OWQwNDMxOWJmMzk4ZzZhZjk1ZGNhega1670). However, due to seccomp restrictions, ksu could not be activated. Since I had no suitable approach, activating ksu was put on hold for the time being. Later, @曉曉恒 published a method for the same CPU and same kernel scheme, and that method can clear seccomp.

(Link: https://www.coolapk.com/feed/73486895?s=YjRmZWY2ZmExOWJmMzk4ZzZhYTU1MmJlega1651)

It also references @TNTHe's method.

(Link: https://blog.kinser.top/archives/1787279031701)

However, both of these schemes require patching the global __do_sys_capset

(Community version patch method concept diagram)


patch __do_sys_capset(全局生效)

    ↓

zygote 孵化应用时 specialize → 调用 capset() 降权

    ↓

★ 中招:执行 shellcode → commit_creds(prepare_kernel_cred(0))

    ↓

zygote 被提权成 root + seccomp 被清 + cred 被换成 init_cred 拷贝

(Flowchart of patch causing zygote exceptions)

In other words, this method, as long as it patches the global syscall, has an unavoidable timing race + hardcoded offset risk. zygote will inevitably be caught in the crossfire. And over time it may cause a kernel panic, but compared with the cred method, it can clear seccomp; for this reason, I added a safer recovery mechanism based on the patch method.


1. The Cred Method

1.1 What the Cred Method Can Do

GPU physical write task_struct->cred, modifying fields such as uid/gid/suid to escalate privileges. This path has always been successful.

1.2 The Fatal Flaw: Cache Consistency When Clearing seccomp

To clear seccomp, you must write the mode/filter fields of task_struct (0x848/0x850).

| Data | Access Frequency | Description |

| --- | --- | --- |

| cred | cold data | read only during permission checks |

| task_struct | extremely hot | accessed on every system call/scheduling/signal |

current->flags is being read and written by the CPU on every system call, and this page has a dirty line resident in L1/L2. The GPU is a non-coherent bus master; after it writes into DRAM, the CPU's next normal write-back swallows the entire line (64 bytes).

mode@0x848 and filter@0x850 happen to be in the same cache line, so they are overwritten together — all 8 retries result in 0x100000002.

1.3 A Worse Side Effect: SIGSYS

GPU writes occasionally take partial effect (the filter lands, but the mode does not), creating a self-contradictory state:


mode   = 2 (FILTER)   // 内核仍要走过滤器

filter = 坏值/NULL    // 指针已被破坏

The next system call enters __seccomp_filter() and executes the broken BPF → returns KILL → "Bad system call"


II. Principles of the Improved Patch Method

Friendly reminder: some new content, such as save, exists in my iterative version and may differ from the community version

2.1 Execution Flow

| Step | Action | Description |

| --- | --- | --- |

| 1 | GPU initialization | Gain physical address read/write capability |

| 2 | Disable SELinux | Physical write to selinux_state |

| 3 | kallsyms resolution | Read the 43MB kernel image and resolve symbols |

| 4 | Locate __do_sys_capset | VA → PA |

| 5 | Save the original code | Authoritative GPU read |

| 6 | Write gated shellcode | CPU window write + cache flush |

| 7 | Current process capset(NULL,NULL) | Trigger |

| 8 | Shellcode executes in kernel mode | prepare_kernel_cred(0) → commit_creds() |

| 9 | Restore the original code | CPU write + authoritative GPU verification |

| 10 | Tear down the fast_rw window | GPU write + verification |

| 11 | exec shell | — |

2.2 Why choose __do_sys_capset?

  1. Because this is the system call entry point, it can be precisely triggered from user space, and it is necessarily executed on every call

  2. The physical address is predictable: 0xa8000000 + 0x16c7bc = 0xa816c7bc (the kernel physical base address is fixed; KASLR only changes the virtual base address, and most in the community use this, with plenty of examples)

2.3 Address-fetching shortcut


uint64_t v = kernel_pread_u64(cheese, 0xa816c7bc);

if ((uint32_t)v == 0xd503233f)   /* paciasp = __do_sys_capset 首指令 */

    /* 不需要 kallsyms 就能定位! */

Only when prepare_kernel_cred / commit_creds are called from within the shellcode is the KASLR virtual base address required.


III. Gating Mechanism (Resolving zygote Corruption)

3.1 The Fatal Flaw of the Community Edition


zygote 在 specializeAppProcess 里

【每孵化一个 APP 都调 capset(&hdr,&data) 降权】

     ↓ 社区 shellcode 无条件执行

prepare_kernel_cred(0) → commit_creds()

     ↓ 每次命中

zygote 的 cred 被换掉 + cred_jar 泄漏一个 → 越用越崩 → 无法新开应用

"Anomalies increasing over time" is precisely the cumulative effect of the continuous cred_jar leak and the corrupted reference counting.

3.2 Improvements in This Version

To address this, this version adds a gating mechanism (solving the zygote breakage): only capset(NULL,NULL) triggers privilege escalation; when zygote passes a non-NULL pointer, it takes the skip path. The community edition escalates unconditionally, causing zygote to be mistakenly escalated every time it spawns an APP plus leak one cred → the more it is used, the more it crashes.

| Comparison Item | Community Edition | This Version |

| --- | --- | --- |

| zygote calls capset(&hdr,&data) | Unconditional escalation | Takes skip, returns 0 |

| cred allocation | Leaks one per spawn | No allocation, zero leak |

| App uid/gid | Affected | Unaffected (set by setuid/setgid) |

When overwriting contiguously in place, non-target paths must replay all N overwritten instructions before jumping back, while the shellcode itself has only N slots, which cannot hold "replay N instructions + gating + payload" — mathematically impossible, so an in-kernel trampoline is required.

Therefore the skip path returns 0. This is consistent with the community edition's behavior toward zygote (both are "capset returns 0"), but removes the privilege escalation and cred allocation; the APP's uid/gid is set via setuid / setgid (not capset), so app permissions are unaffected.


IV. Recovery Module (Core Innovation)

This is the most tortuous part of the entire process, only closed after many failures. Because validation was added and the process fixed, the privilege escalation time was also extended to 3~4 minutes.

4.0 Failure Overview

| No. | Failure | Symptom | Root Cause | Fix |

| --- | --- | --- | --- | --- |

| 1 | False success | Validation all green, DRAM untouched | CPU reads its own dirty cache line | Switched to authoritative GPU read |

| 2 | Wrong cache level | GPU cannot read new value | dc cvau only reaches PoU | Changed to dc cvac (reaches PoC) |

| 3 | No external validation | Cannot prove it has been written to disk | Missing GPU perspective | Added patch_verify_bytes_gpu() |

| 4 | fork breaks everything | restore inevitably fails | COW + GPU channel death | Privilege escalation no longer forks |

4.1 Failure One: False Success (CPU Reading Deceives Itself)


patch_verify_bytes() → fast_pread_u64()   // CPU 通过窗口读

As soon as the write finishes, it is read back with the CPU, and what is read is the cache line that was just dirtied by the write itself, which always equals the expected value. The logs stay green the whole way, and DRAM is never touched.

Hard evidence: on the second run, save reads back the shellcode rather than the original code.

4.2 Failure two: cache flushed at the wrong level


"dc cvau, %0"    // clean by VA to PoU(本核 L2/统一点)

GPU is an external bus master and accesses the PoC (DRAM). cvau cannot clean to DRAM.

Fix: dc cvau → dc cvac (clean to PoC).

4.3 Failure three: missing GPU authoritative verification

Download Tool

Related Tools

  • Mobile-Security-Framework-MobSF

    Automated mobile application security testing framework for Android, iOS, and Windows. Performs static and dynamic analysis, malware detection, and API security testing with CI/CD integration.

  • jadx

    Command-line and GUI tool for decompiling Android Dex and APK files into readable Java source code, with resource decoding, deobfuscation, and Smali debugging capabilities.

  • Apktool

    A tool for reverse engineering Android apk files

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    ghostlock-app

    yukonga/ghostlock-app

    One-tap Android kernel exploit app for CVE-2026-43499, providing privilege escalation via kernel module loading, with offset extraction and on-device analysis tools.

    750
  • 2

    IMSIcatcher

    28zaaky/imsicatcher

    IMSI Catcher platform that deploys a rogue GSM cell to intercept SMS, inject messages and track mobile devices

    739
  • 3

    Callisto

    jetp1ane/callisto

    Automated binary vulnerability analysis tool that decompiles executables via Ghidra, scans pseudo-C code with Semgrep, and validates findings using GPT-3.5-Turbo to reduce false positives.

    585
  • 4

    opencti

    opencti-platform/opencti

    Open Cyber Threat Intelligence Platform

    550
  • 5

    DFRoot

    a2333c/dfroot

    Android root tool for Samsung Galaxy S25 Ultra (SM-S938B) that chains DirtyFrag CVE-2026-43284 and CVE-2026-43499 to gain root automatically at boot via KernelSU.

    414
  • 6

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    409

Explore all tools

Browse our collection of tools

View all tools →