From b913b4bae0897475ad89eddb8d4e32f1d4ac56f6 Mon Sep 17 00:00:00 2001 From: Joe Lawrence Date: Mon, 12 Aug 2019 16:05:02 -0400 Subject: [PATCH] livepatch-patch-hook: skip klp_(un)register_patch() for RHEL-7.8+ kernels RHEL-7.8 backported upstream kernel commit 958ef1e39d24 ("livepatch: Simplify API by removing registration step"), so add it to the kernels using the simple registration API. Signed-off-by: Joe Lawrence --- kmod/patch/livepatch-patch-hook.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kmod/patch/livepatch-patch-hook.c b/kmod/patch/livepatch-patch-hook.c index ccc6ee8..2ddd153 100644 --- a/kmod/patch/livepatch-patch-hook.c +++ b/kmod/patch/livepatch-patch-hook.c @@ -64,7 +64,11 @@ # define HAVE_CALLBACKS #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) +#ifdef RHEL_RELEASE_CODE +# if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7, 8) +# define HAVE_SIMPLE_ENABLE +# endif +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) # define HAVE_SIMPLE_ENABLE #endif