diff --git a/module/pteditor.c b/module/pteditor.c index 0353ed0..e4e7ba1 100644 --- a/module/pteditor.c +++ b/module/pteditor.c @@ -224,13 +224,13 @@ invalidate_tlb_kernel(pid_t pid, void* addr) { #if defined(__i386__) || defined(__x86_64__) flush_tlb_mm_range_func(get_mm(pid), (unsigned long) addr, (unsigned long) addr + real_page_size, real_page_shift, false); #elif defined(__aarch64__) - struct vm_area_struct *vma = find_vma(current->mm, addr); + struct vm_area_struct *vma = find_vma(current->mm, (unsigned long)addr); tlb_page_t tlb_page; - if (unlikely(vma == NULL || addr < vma->vm_start)) { + if (unlikely(vma == NULL || (unsigned long)addr < vma->vm_start)) { return; } tlb_page.vma = vma; - tlb_page.addr = addr; + tlb_page.addr = (unsigned long)addr; on_each_cpu(_flush_tlb_page_smp, &tlb_page, 1); #endif } diff --git a/ptedit.c b/ptedit.c index 5987867..73c8e49 100644 --- a/ptedit.c +++ b/ptedit.c @@ -431,7 +431,11 @@ ptedit_fnc int ptedit_init() { fprintf(stderr, PTEDIT_COLOR_RED "[-]" PTEDIT_COLOR_RESET "Error: Could not open PTEditor device: %s\n", PTEDITOR_DEVICE_PATH); return -1; } +#if !defined(__aarch64__) ptedit_umem = open("/proc/umem", O_RDWR); +#else + ptedit_umem = 0; +#endif #else ptedit_fd = CreateFile(PTEDITOR_DEVICE_PATH, GENERIC_ALL, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM, 0); if (ptedit_fd == INVALID_HANDLE_VALUE) { diff --git a/ptedit_header.h b/ptedit_header.h index f3ca78e..9642380 100644 --- a/ptedit_header.h +++ b/ptedit_header.h @@ -1430,7 +1430,11 @@ ptedit_fnc int ptedit_init() { fprintf(stderr, PTEDIT_COLOR_RED "[-]" PTEDIT_COLOR_RESET "Error: Could not open PTEditor device: %s\n", PTEDITOR_DEVICE_PATH); return -1; } +#if !defined(__aarch64__) ptedit_umem = open("/proc/umem", O_RDWR); +#else + ptedit_umem = 0; +#endif #else ptedit_fd = CreateFile(PTEDITOR_DEVICE_PATH, GENERIC_ALL, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM, 0); if (ptedit_fd == INVALID_HANDLE_VALUE) {