%global debug_package %{nil} %define kernel_version %(ver=`rpm -qa|grep kernel-devel`;echo ${ver#*kernel-devel-}) Name : dim Summary : Dynamic Integrity Measurement Version : 1.0.2 Release : 6 License : GPL-2.0 Source0 : %{name}-v%{version}.tar.gz BuildRequires: kernel-devel kernel-headers Requires : kernel Patch0001: Limit-the-max-line-number-of-policy-and-baseline-par.patch Patch0002: Use-jiffies64-interface-to-set-measure-interval.patch Patch0003: Add-the-owner-of-file-operations.patch Patch0004: backport-dim-add-test-code.patch Patch0005: backport-fix-the-magic-number.patch Patch0006: backport-some-word.patch Patch0007: backport-update-src-common-dim_baseline.c.patch Patch0008: backport-fix-build-error-in-kernel-6.6.patch Patch0009: backport-fix-build-error.patch Patch0010: backport-Refactor-the-measurement-code.patch Patch0011: backport-Refactor-dim_core-policy-and-support-the-action-poli.patch Patch0012: backport-Refactor-the-dim_core-static-baseline-implement.patch Patch0013: backport-Support-user-process-measurement-by-ELF-parsing.patch Patch0014: backport-Optimize-Makefile.patch Patch0015: backport-Dont-queue-measurement-task-when-baseline-failed.patch Patch0016: backport-Add-safe-wapper-for-some-memory-and-string-functions.patch Patch0017: backport-Fix-potential-integer-overflow.patch Patch0018: backport-Add-memory-debug-in-mem_pool.patch Patch0019: backport-Optimize-test-framework-and-add-testcases.patch Patch0020: backport-Add-warpper-for-strncmp-and-strncpy.patch Patch0021: backport-Use-warpper-dim_vzalloc-to-avoid-false-warning.patch Patch0022: backport-Set-dim_core_keyring-to-NULL-when-initialize-failed.patch Patch0023: backport-Disable-dfx-testcase-by-default.patch Patch0024: backport-Support-init-function-for-measure-tasks.patch %description Dynamic Integrity Measurement %prep %autosetup -n %{name}-v%{version} -p1 %build cd src sed -i 's#/lib/modules/$(shell uname -r)/build#/lib/modules/%{kernel_version}/build#' Makefile make %install mkdir -p $RPM_BUILD_ROOT/lib/modules/%{kernel_version}/extra/dim install -m 600 ./src/dim_core.ko $RPM_BUILD_ROOT/lib/modules/%{kernel_version}/extra/dim install -m 600 ./src/dim_monitor.ko $RPM_BUILD_ROOT/lib/modules/%{kernel_version}/extra/dim %pre %post depmod -a `uname -r` %preun %postun depmod -a %posttrans %clean rm -rf %{buildroot} %files %defattr(-,root,root) %attr(0400,root,root) /lib/modules/%{kernel_version}/extra/dim/dim_core.ko %attr(0400,root,root) /lib/modules/%{kernel_version}/extra/dim/dim_monitor.ko %changelog * Tue Apr 16 2024 jinlun 1.0.2-6 - backport some patches * Fri Jan 26 2024 jinlun 1.0.2-5 - The compilation error asused by the kernel upgrade is rectified. * Mon Sep 18 2023 jinlun 1.0.2-4 - Fix the concurrent issues with removing module and accessing interfaces. * Fri Sep 15 2023 luhuaxin 1.0.2-3 - Use jiffies64 interface to set measure interval * Thu Sep 14 2023 luhuaxin 1.0.2-2 - Limit the max line number of policy and baseline parsing * Mon Sep 4 2023 jinlun 1.0.2-1 - Init package