Skip to content

Commit

Permalink
Merge pull request #19 from M-Allahham/main
Browse files Browse the repository at this point in the history
Fixing breakage for kernel version 6.10 or above
  • Loading branch information
ko1N authored Aug 30, 2024
2 parents adc24bf + 8cd9df8 commit c7d72fd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions memflow-kmod/vmtools.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,12 @@ static int memflow_vm_mem_mmap(struct file *file, struct vm_area_struct *vma)

static unsigned long memflow_vm_mem_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags)
{
struct vm_mem_data *data = file->private_data;
return get_unmapped_area(data->wrapped_vma->vm_file, addr, len, pgoff + data->wrapped_vma->vm_pgoff, flags);
struct vm_mem_data *data = file->private_data;
#if LINUX_VERSION_CODE < KERNEL_VERSION(6,10,0)
return get_unmapped_area(data->wrapped_vma->vm_file, addr, len, pgoff + data->wrapped_vma->vm_pgoff, flags);
#else
return mm_get_unmapped_area(data->wrapped_task->mm, data->wrapped_vma->vm_file, addr, len, pgoff + data->wrapped_vma->vm_pgoff, flags);
#endif
}

static const struct file_operations memflow_vm_mem_fops = {
Expand Down

0 comments on commit c7d72fd

Please sign in to comment.