From 7cff72ef8071dc7871eb1f39c528d8cf5e78c611 Mon Sep 17 00:00:00 2001 From: Armin Kuster Date: Mon, 20 Jun 2022 21:57:58 -0700 Subject: lkrg: update to 0.9.3 refresh patch Signed-off-by: Armin Kuster --- recipes-kernel/lkrg/files/makefile_cleanup.patch | 72 +++++++++--------------- recipes-kernel/lkrg/lkrg-module_0.9.2.bb | 33 ----------- recipes-kernel/lkrg/lkrg-module_0.9.3.bb | 34 +++++++++++ 3 files changed, 60 insertions(+), 79 deletions(-) delete mode 100644 recipes-kernel/lkrg/lkrg-module_0.9.2.bb create mode 100644 recipes-kernel/lkrg/lkrg-module_0.9.3.bb diff --git a/recipes-kernel/lkrg/files/makefile_cleanup.patch b/recipes-kernel/lkrg/files/makefile_cleanup.patch index 799b1a6..f29afbe 100644 --- a/recipes-kernel/lkrg/files/makefile_cleanup.patch +++ b/recipes-kernel/lkrg/files/makefile_cleanup.patch @@ -1,73 +1,53 @@ -Upstream-Status: Pending - -This needs more work. Its my starting point. - +Upstream-Status: Inappropriate [embedded specific] + Signed-off-by: Armin Kuster + Index: git/Makefile =================================================================== --- git.orig/Makefile +++ git/Makefile -@@ -4,28 +4,10 @@ - # Author: - # - Adam 'pi3' Zabrocki (http://pi3.com.pl) - ## -- --P_OUTPUT = output +@@ -7,15 +7,8 @@ + + P_OUTPUT = output P_PWD ?= $(shell pwd) -P_KVER ?= $(shell uname -r) --P_BOOTUP_SCRIPT ?= scripts/bootup/lkrg-bootup.sh --TARGET := p_lkrg + P_BOOTUP_SCRIPT ?= scripts/bootup/lkrg-bootup.sh + TARGET := p_lkrg -ifneq ($(KERNELRELEASE),) - KERNEL := /lib/modules/$(KERNELRELEASE)/build -else - ## KERNELRELEASE not set. - KERNEL := /lib/modules/$(P_KVER)/build -endif -- --# --# Uncomment for debug compilation --# --# ccflags-m := -ggdb -DP_LKRG_DEBUG_BUILD -finstrument-functions --# ccflags-y := ${ccflags-m} --# p_lkrg-objs += src/modules/print_log/p_lkrg_debug_log.o --obj-m += $(TARGET).o --$(TARGET)-objs += src/modules/ksyms/p_resolve_ksym.o \ -+obj-m := p_lkrg.o -+p_lkrg-y := src/modules/ksyms/p_resolve_ksym.o \ - src/modules/hashing/p_lkrg_fast_hash.o \ - src/modules/comm_channel/p_comm_channel.o \ - src/modules/integrity_timer/p_integrity_timer.o \ -@@ -92,23 +74,14 @@ $(TARGET)-objs += src/modules/ksyms/p_re + # + # Use DEBUG=on for debug build. +@@ -94,14 +87,13 @@ $(TARGET)-objs += src/modules/ksyms/p_re src/p_lkrg_main.o -all: -# $(MAKE) -C $(KERNEL) M=$(P_PWD) modules CONFIG_DEBUG_SECTION_MISMATCH=y - $(MAKE) -C $(KERNEL) M=$(P_PWD) modules -- mkdir -p $(P_OUTPUT) -- cp $(P_PWD)/$(TARGET).ko $(P_OUTPUT) -- --install: -- $(MAKE) -C $(KERNEL) M=$(P_PWD) modules_install -- depmod -a -- $(P_PWD)/$(P_BOOTUP_SCRIPT) install - --uninstall: -- $(P_PWD)/$(P_BOOTUP_SCRIPT) uninstall +modules: + $(MAKE) -C $(KERNEL_SRC) M=$(P_PWD) modules -+ -+modules_install: + mkdir -p $(P_OUTPUT) + cp $(P_PWD)/$(TARGET).ko $(P_OUTPUT) + +-install: +- $(MAKE) -C $(KERNEL) M=$(P_PWD) modules_install ++moduled_install: + $(MAKE) -C $(KERNEL_SRC) M=$(P_PWD) modules_install + depmod -a + $(P_PWD)/$(P_BOOTUP_SCRIPT) install + +@@ -109,7 +101,7 @@ uninstall: + $(P_PWD)/$(P_BOOTUP_SCRIPT) uninstall clean: - $(MAKE) -C $(KERNEL) M=$(P_PWD) clean -- $(RM) Module.markers modules.order -- $(RM) $(P_PWD)/src/modules/kmod/client/kmod/Module.markers -- $(RM) $(P_PWD)/src/modules/kmod/client/kmod/modules.order -- $(RM) -rf $(P_OUTPUT) -+ rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c -+ rm -f Module.markers Module.symvers modules.order -+ rm -rf .tmp_versions Modules.symvers ++ $(MAKE) -C $(KERNEL_SRC) M=$(P_PWD) clean + $(RM) Module.markers modules.order + $(RM) $(P_PWD)/src/modules/kmod/client/kmod/Module.markers + $(RM) $(P_PWD)/src/modules/kmod/client/kmod/modules.order diff --git a/recipes-kernel/lkrg/lkrg-module_0.9.2.bb b/recipes-kernel/lkrg/lkrg-module_0.9.2.bb deleted file mode 100644 index 85f7d44..0000000 --- a/recipes-kernel/lkrg/lkrg-module_0.9.2.bb +++ /dev/null @@ -1,33 +0,0 @@ -SUMMARY = "Linux Kernel Runtime Guard" -DESCRIPTION="LKRG performs runtime integrity checking of the Linux \ -kernel and detection of security vulnerability exploits against the kernel." -SECTION = "security" -HOMEPAGE = "https://www.openwall.com/lkrg/" -LICENSE = "GPL-2.0-only" - -LIC_FILES_CHKSUM = "file://LICENSE;md5=5105ead24b08a32954f34cbaa7112432" - -DEPENDS = "virtual/kernel elfutils" - -SRCREV = "43db5f19fca259feb1962f6db33382348cbc8320" - -SRC_URI = "git://github.com/lkrg-org/lkrg.git;protocol=https;branch=main \ - file://makefile_cleanup.patch " - -S = "${WORKDIR}/git" - -inherit module kernel-module-split - -MAKE_TARGETS = "modules" - -MODULE_NAME = "p_lkrg" - -module_do_install() { - install -d ${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME} - install -m 0644 ${MODULE_NAME}.ko \ - ${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}/${MODULE_NAME}.ko -} - -RPROVIDES:${PN} += "kernel-module-lkrg" - -COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux" diff --git a/recipes-kernel/lkrg/lkrg-module_0.9.3.bb b/recipes-kernel/lkrg/lkrg-module_0.9.3.bb new file mode 100644 index 0000000..2553974 --- /dev/null +++ b/recipes-kernel/lkrg/lkrg-module_0.9.3.bb @@ -0,0 +1,34 @@ +SUMMARY = "Linux Kernel Runtime Guard" +DESCRIPTION="LKRG performs runtime integrity checking of the Linux \ +kernel and detection of security vulnerability exploits against the kernel." +SECTION = "security" +HOMEPAGE = "https://www.openwall.com/lkrg/" +LICENSE = "GPL-2.0-only" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=5105ead24b08a32954f34cbaa7112432" + +DEPENDS = "virtual/kernel elfutils" + +SRC_URI = "git://github.com/lkrg-org/lkrg.git;protocol=https;branch=main \ + file://makefile_cleanup.patch \ +" + +SRCREV = "c578e9f786299b67ffd62057b4534b0bf4fb7ece" + +S = "${WORKDIR}/git" + +inherit module kernel-module-split + +MAKE_TARGETS = "modules" + +MODULE_NAME = "p_lkrg" + +module_do_install() { + install -d ${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME} + install -m 0644 ${MODULE_NAME}.ko \ + ${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}/${MODULE_NAME}.ko +} + +RPROVIDES:${PN} += "kernel-module-lkrg" + +COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux" -- cgit v1.2.3-54-g00ecf