# LSPrivilege (LSPosed/LSPrivilege)

> GhostLock is a one-tap Android app that runs the CVE-2026-43499 kernel exploit to grant uid 0 (root) on a matching vulnerable kernel, optionally loading a KernelSU-style module afterward.

- GitHub: https://github.com/LSPosed/LSPrivilege
- GitHub.Locker page: https://github.locker/LSPosed/LSPrivilege
- Stars: 3.3K
- Language: Kotlin
- License: Apache-2.0
- Last push: 2026-11-27

## Questions and answers

Written by GitHub.Locker from the README and the repository; check the README below for details.

**Is this a root exploit app or a root manager like Magisk?**

It is a standalone exploit-execution app, not a root manager: it drives the CVE-2026-43499 bug itself, and only hands off to KernelSU, ReSukiSU, or KowSU afterward to load a module; without one of those it still grants uid 0 but loads nothing.

**How do I run the exploit?**

Open the GhostLock app and tap Run; it automatically resolves a matching built-in kernel profile and executes the right route for your kernel.

**Do I need KernelSU or Shizuku installed first?**

No root manager is required for the exploit itself, but loading a module afterward needs KernelSU, ReSukiSU, or KowSU for its ksud component; steps marked 'Shizuku required' instead run via a shell UserService started through ADB.

**Will it work on any Android kernel?**

No. GhostLock checks the device kernel by exact 'uname -r' against its built-in profiles and refuses to run on anything it doesn't recognize or that is already patched, so a successful run never guarantees support on an untested device.

**What is CVE-2026-43499 exactly?**

It is a kernel futex primitive bug used as the exploit's backend, affecting a family of Linux kernel trees including 5.15, 6.1, and 6.6/6.12, each exploited through a slightly different race.

**Can I add support for a kernel that isn't in the built-in list?**

Yes — the tools/extractrs utility derives the needed offsets from a boot.img, a full OTA ZIP, or a URL to one, and produces a .conf profile you can import in-app without rebuilding GhostLock.

**How does the exploit race actually work on different kernels?**

It varies by kernel family: 6.6/6.12 kernels race select() against a thread that perturbs waiter priority, 6.1 kernels drive getsockopt(TCPZEROCOPYRECEIVE) through a punched-hole page, and 5.15 kernels use a multicast waiter instead.

**What happens if I try this on an already-patched kernel?**

The offset extractor disassembles the kernel's removewaiter() function first and exits with code 6 if the fix is present, so patched kernels are rejected before any exploit offsets are even extracted.


---

## README (checked against GitHub 2026-11-27)

Source: https://github.com/LSPosed/LSPrivilege/blob/main/README.md

# LSPrivilege

[中文](README_ZH.md)

LSPrivilege is a modular Android kernel privilege-escalation app for gaining temporary root on supported kernels and loading root managers such as KernelSU or APatch. It is designed to support multiple exploit backends rather than targeting a single vulnerability (currently shipping CVE-2026-43499, with additional backends planned).

## Use the app

1. Install a root manager APK from [KernelSU](https://github.com/tiann/KernelSU), [SukiSU Ultra](https://github.com/SukiSU-Ultra/SukiSU-Ultra), [BakaSU/ReSukiSU](https://github.com/Baka-SU/BakaSU), [KowSU](https://github.com/KOWX712/KernelSU), or [APatch](https://github.com/bmax121/APatch).
2. Install the LSPrivilege APK and open it.
3. Check that your kernel is supported, then tap **Run**.

Support requires an exact `uname -r` match. Check the [supported devices](docs/kernel_profiles/SUPPORTED_DEVICES.md) for your kernel build.

If Shizuku is enabled, start it with ADB before running LSPrivilege. Tap LSPrivilege's status card to grant access.

Any root manager that ships `libksud.so` or `libapd.so` provides `ksud`/`apd` for module loading. The built-in list (KernelSU, SukiSU Ultra, ReSukiSU, BakaSU, KowSU, APatch) is auto-detected, and other managers can be picked in **Settings → Root manager**. Without `ksud`/`apd`, W1/W2 still grant uid 0 but no module is loaded.

## Add a kernel profile

You can import a profile without rebuilding the app:

- **Parse OTA link** accepts a full OTA ZIP URL.
- **Parse local image** accepts `boot.img` and an optional `xbl_config.img`.
- **Import offsets.conf (v2)** accepts a HOCON profile. **Import offsets.json (v1)** converts an older JSON report in the app.

Extractor output is an unverified candidate. The app checks missing or invalid fields before execution. Generating a profile does not prove device support. See the [porting guide](docs/kernel_profiles/README.md) for validation and built-in registration.

See the [MediaTek guide](docs/kernel_profiles/MEDIATEK.md) for image-based address recovery and the rooted-device fallback.

## Command-line tools

<details>
<summary>Run the native binary with an exported profile</summary>

Requires the Android NDK, `make`, Gradle, and ADB. An adb shell run skips the app's seccomp bypass stage.

```sh
make -C src lsprivilege
./gradlew exportKernelProfiles
adb push build/native/lsprivilege /data/local/tmp/lsprivilege
adb push "build/kernel-profiles/<release>.bin" /data/local/tmp/profile.bin
adb shell chmod 755 /data/local/tmp/lsprivilege
adb shell /data/local/tmp/lsprivilege --load-prebuilt-profile /data/local/tmp/profile.bin
```

</details>

<details>
<summary>Build and run the offset extractor</summary>

Requires Rust. The extractor accepts a boot image, a full OTA ZIP, or an HTTP(S) URL.

```sh
(cd tools/extract_rs && cargo build --release)
build/extract/release/lsprivilege-extract boot.img --xbl-config xbl_config.img --format conf --out profile.conf
build/extract/release/lsprivilege-extract OTA.zip --format conf --out profile.conf
```

Import `profile.conf` in the app. Omit `--xbl-config` if you do not have that image. The extractor rejects a patched `remove_waiter()` with exit code `6`.

</details>

## Reference

- [Profile schema](docs/kernel_profiles/PROFILE_SCHEMA.md) and [execution defaults](docs/kernel_profiles/defaults.md)
- [Native core](src/core/README.md)
- [Add a component](docs/development/adding-a-component.md), [engineering rules](docs/development/engineering-standards.md), and [writing rules](docs/development/documentation-standards.md)

## Credits and license

Licensed under [Apache License 2.0](LICENSE). Based on:

- [NebuSec/CyberMeowfia](https://github.com/NebuSec/CyberMeowfia)
- [JoinChang/ghostlock-oneplus](https://github.com/JoinChang/ghostlock-oneplus)
- [x-spy/CVE-2026-43499-popsicle](https://github.com/x-spy/CVE-2026-43499-popsicle)

