Skip to content

Commit

Permalink
aarch64 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Schwarz committed Oct 30, 2024
1 parent 2965f83 commit eb16069
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions module/pteditor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 4 additions & 0 deletions ptedit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 4 additions & 0 deletions ptedit_header.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit eb16069

Please sign in to comment.