Skip to content

Add checks for RHEL8.8 #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
10 changes: 9 additions & 1 deletion memflow-kmod/mmap_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@

#include <linux/version.h>

#if LINUX_VERSION_CODE < KERNEL_VERSION(5,8,0)
#ifndef RHEL_RELEASE_CODE
#define RHEL_RELEASE_CODE 0
#endif

#ifndef RHEL_RELEASE_VERSION
#define RHEL_RELEASE_VERSION(a,b) 1
#endif

#if LINUX_VERSION_CODE < KERNEL_VERSION(5,8,0) && RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(8,8)
static inline void mmap_write_lock(struct mm_struct *mm)
{
down_write(&mm->mmap_sem);
Expand Down
8 changes: 4 additions & 4 deletions memflow-kmod/vmtools.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <linux/version.h>
#include "mmap_lock.h"

#if LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0) && RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(8,8)
#define kvm_for_each_memslot2(memslot, bkt, slots) (void)bkt; kvm_for_each_memslot(memslot, slots)
#else
#define kvm_for_each_memslot2 kvm_for_each_memslot
Expand Down Expand Up @@ -203,11 +203,11 @@ struct vm_mem_data {
#define PAGE_GET_FLAG 0
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)
#define RELEASE_PAGE put_page
#else
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,7,0) && RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(8,8)
#define PAGE_GET_FLAG 0
#define RELEASE_PAGE put_user_page
#else
#define RELEASE_PAGE put_page
#endif

static int memflow_vm_mem_release(struct inode *inode, struct file *file)
Expand Down