Commit 71a1e028 authored by Adam Blank's avatar Adam Blank
Browse files

Update exploit.c

parent e48f19dc
No related merge requests found
Showing with 15 additions and 0 deletions
+15 -0
...@@ -11,6 +11,21 @@ ...@@ -11,6 +11,21 @@
#include "util.h" #include "util.h"
static inline void *get_kernel_data_address() {
FILE *address_file;
address_file = fopen("/sys/kernel/kernel_data/address", "r");
if (address_file != NULL) {
uint64_t address;
if (fscanf(address_file, "%lx\n", &address) == 1) {
fclose(address_file);
return (void *) address;
}
fclose(address_file);
}
return 0;
}
// TODO: Copy your code from the previous stage and make the necessary edits to do_access() // TODO: Copy your code from the previous stage and make the necessary edits to do_access()
// Note that this code WILL NOT WORK on compute-cpu2. You must push it to gitlab to get it to run // Note that this code WILL NOT WORK on compute-cpu2. You must push it to gitlab to get it to run
// on one of the meltdown machines. // on one of the meltdown machines.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment