Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions checkra1n/kpf/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1657,10 +1657,8 @@ void command_kpf() {
xnu_pf_emit(xnu_data_const_patchset);
xnu_pf_apply(data_const_range, xnu_data_const_patchset);
xnu_pf_patchset_destroy(xnu_data_const_patchset);
bool is_unified = true;

if (!has_found_sbops) {
is_unified = false;
if (!plk_text_range) panic("no plk_text_range");
xnu_pf_patchset_t* xnu_plk_data_const_patchset = xnu_pf_patchset_create(XNU_PF_ACCESS_64BIT);
xnu_pf_ptr_to_data(xnu_plk_data_const_patchset, xnu_slide_value(hdr), plk_text_range, "Seatbelt sandbox policy", strlen("Seatbelt sandbox policy")+1, true, (void*)sb_ops_callback);
Expand Down Expand Up @@ -1890,11 +1888,8 @@ void kpf_autoboot() {

ramdisk_size = rdsksz + 0x10000;

char should_populate_kerninfo = 0;
struct kerninfo *info = (struct kerninfo*)(ramdisk_buf+rdsksz);
if (info->size == sizeof(struct kerninfo)) {
should_populate_kerninfo = 1;
} else {
if (info->size != sizeof(struct kerninfo)) {
printf("Detected corrupted kerninfo!\n");
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/sep/sep.c
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ struct sep_command {
void (*cb)(const char* cmd, char* args);
};

void sep_help();
void sep_help(const char* cmd, char* args);
#define SEP_COMMAND(_name, _desc, _cb) {.name = _name, .desc = _desc, .cb = _cb}
void sep_pwned_peek(const char* cmd, char* args) {
if(!sep_is_pwned) {
Expand Down
5 changes: 0 additions & 5 deletions src/kernel/mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,11 @@ err_t vm_allocate(struct vm_space* vmspace, uint64_t* addr, uint64_t size, vm_fl
uint32_t vm_scan_base = 0;
uint64_t vm_scan_size = (VM_SPACE_SIZE / PAGE_SIZE);
uint32_t found_pages = 0;
uint32_t vm_index_start = 0;

if (flags & VM_FLAGS_FIXED) {
uint64_t vm_offset = *addr - vmspace->vm_space_base;
if (vm_offset > vmspace->vm_space_end) vm_scan_size = 0;
else {
vm_index_start = vm_offset / PAGE_SIZE;
vm_scan_size = ((size + PAGE_MASK) & ~PAGE_MASK) / PAGE_SIZE;
}
} else {
Expand Down Expand Up @@ -931,18 +929,15 @@ void ttbpage_free_walk(uint64_t base, bool is_tt1) {
}
bool tte_walk_get(struct vm_space* vmspace, uint64_t va, uint64_t** tte_out) {
uint64_t bits = 64ULL;
bool is_tt1 = false;
uint64_t* ttb = NULL;
if (va & 0x7000000000000000) {
bits -= t1sz;
va -= (0xffffffffffffffff - ((1ULL << (65 - t1sz)) - 1));
va &= (1ULL << bits) - 1;
is_tt1 = true;
ttb = phystokv(vmspace->ttbr1);
} else {
bits -= t0sz;
va &= (1ULL << bits) - 1;
is_tt1 = false;
ttb = phystokv(vmspace->ttbr0);
}
uint32_t levels = ((bits - (tt_bits + 3ULL)) / tt_bits);
Expand Down
1 change: 1 addition & 0 deletions src/kernel/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/
#include <errno.h>
#include <stdlib.h>
#include <stdarg.h>
#include <pongo.h>

extern void task_load(struct task* to_task);
Expand Down