diff --git a/checkra1n/kpf/main.c b/checkra1n/kpf/main.c index 608aa80b..1d62c4be 100644 --- a/checkra1n/kpf/main.c +++ b/checkra1n/kpf/main.c @@ -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); @@ -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; } diff --git a/src/drivers/sep/sep.c b/src/drivers/sep/sep.c index 10d0a98d..d1767657 100644 --- a/src/drivers/sep/sep.c +++ b/src/drivers/sep/sep.c @@ -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) { diff --git a/src/kernel/mm.c b/src/kernel/mm.c index e1196c9d..48cd58c6 100644 --- a/src/kernel/mm.c +++ b/src/kernel/mm.c @@ -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 { @@ -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); diff --git a/src/kernel/task.c b/src/kernel/task.c index 0e6fa223..b957e160 100644 --- a/src/kernel/task.c +++ b/src/kernel/task.c @@ -26,6 +26,7 @@ */ #include #include +#include #include extern void task_load(struct task* to_task);