Exploit databaseDownload repository ZIP
GH-29e755ab02c968b347a7e04c962bbc6b
starriv/cve-2026-98260-xiaomi-17-pro-max
Sources for CVE-2026-98260
60 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files1
starriv/cve-2026-98260-xiaomi-17-pro-maxRevision e9d8d6a6779b
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
scripts/device/load-ksu-device.sh
Shell · 2,085 bytes#!/system/bin/sh
# Device-side KernelSU LKM late-load for the CURRENT boot (needs root now).
# Expects in /data/local/tmp: ksu.ko ko_patch finit ksud ko-names.txt
set -u
D=/data/local/tmp
REL=$(uname -r)
log() { echo "[ksu] $*"; }
[ "$(id -u)" = 0 ] || { log "not root"; exit 1; }
# 1) make kallsyms readable, build this boot's symbol table
OLD_KPTR=$(cat /proc/sys/kernel/kptr_restrict 2>/dev/null || echo 2)
echo 0 > /proc/sys/kernel/kptr_restrict 2>/dev/null || true
cat /proc/kallsyms > "$D/ksym.all"
awk 'NR==FNR{a[$1]=1;next} a[$3]{print $3" "$1}' "$D/ko-names.txt" "$D/ksym.all" > "$D/ko-syms.txt"
echo "$OLD_KPTR" > /tmp/.ksu_old_kptr 2>/dev/null || true
log "symbols=$(wc -l < "$D/ko-syms.txt")/226 release=$REL"
if grep -q '^kernelsu ' /proc/modules; then
log "kernelsu already live"
else
chmod 755 "$D/ko_patch" "$D/finit" 2>/dev/null || true
"$D/ko_patch" "$D/ksu.ko" "$D/ksu-patched.ko" "$D/ko-syms.txt" 0 "$REL" || { log "ko_patch failed"; exit 1; }
"$D/finit" "$D/ksu-patched.ko" allow_shell=1 || { log "finit failed"; exit 1; }
grep -q '^kernelsu ' /proc/modules || { log "module not live"; exit 1; }
fi
# 2) userspace
mkdir -p /data/adb/ksu/bin /data/adb/modules
cp -f "$D/ksud" /data/adb/ksud 2>/dev/null || true
chmod 755 /data/adb/ksud 2>/dev/null || true
/data/adb/ksud install 2>/dev/null || true
ln -sf /data/adb/ksud /data/adb/ksu/bin/su
ln -sf /data/adb/ksud /data/adb/ksu/bin/ksud
/data/adb/ksud feature set su_compat 1 >/dev/null 2>&1 || true
/data/adb/ksud feature set shell_su_adb_only 0 >/dev/null 2>&1 || true
# 3) only switch to Enforcing if KernelSU su verifiably works
if /system/bin/su -c id 2>/dev/null | grep -q 'uid=0'; then
echo 1 > /sys/fs/selinux/enforce 2>/dev/null || true
log "enforce=$(getenforce) su=$(/system/bin/su -c 'id -u' 2>/dev/null)"
else
log "KernelSU su not ready; leaving SELinux $(getenforce)"
fi
# 4) restore kptr_restrict
echo "${OLD_KPTR:-2}" > /proc/sys/kernel/kptr_restrict 2>/dev/null || true
log "module=$(grep -c '^kernelsu ' /proc/modules) enforce=$(getenforce)"
echo KSU_LOAD_OK