From dd51ce4880042ccbe5195a7292193160a5253208 Mon Sep 17 00:00:00 2001 From: Pablo Alessandro Santos Hugen Date: Sun, 7 Dec 2025 19:22:35 -0300 Subject: [PATCH] test/integration: Remove unsupported RHEL releases Remove integration tests for the following end-of-life RHEL releases: - rhel-7.4 - rhel-7.5 - rhel-7.6 - rhel-7.7 - rhel-8.0 - rhel-8.1 Signed-off-by: Pablo Alessandro Santos Hugen --- .../rhel-7.4/bug-table-section.patch | 12 -- .../rhel-7.4/cmdline-string-LOADED.test | 3 - .../integration/rhel-7.4/cmdline-string.patch | 12 -- .../integration/rhel-7.4/data-new-LOADED.test | 3 - test/integration/rhel-7.4/data-new.patch | 28 --- .../rhel-7.4/data-read-mostly.patch.disabled | 11 -- test/integration/rhel-7.4/fixup-section.patch | 12 -- test/integration/rhel-7.4/gcc-constprop.patch | 13 -- test/integration/rhel-7.4/gcc-isra.patch | 11 -- test/integration/rhel-7.4/gcc-mangled-3.patch | 13 -- .../rhel-7.4/gcc-static-local-var-2.patch | 13 -- .../rhel-7.4/gcc-static-local-var-3.patch | 19 -- .../rhel-7.4/gcc-static-local-var-4.patch | 20 --- .../rhel-7.4/gcc-static-local-var-4.test | 8 - .../rhel-7.4/gcc-static-local-var-5.patch | 45 ----- .../rhel-7.4/gcc-static-local-var-6.patch | 23 --- .../rhel-7.4/gcc-static-local-var.patch | 25 --- .../rhel-7.4/macro-callbacks.patch | 160 ----------------- test/integration/rhel-7.4/macro-printk.patch | 147 ---------------- .../rhel-7.4/meminfo-init-FAIL.patch | 11 -- .../rhel-7.4/meminfo-init2-FAIL.patch | 19 -- .../rhel-7.4/meminfo-string-LOADED.test | 3 - .../integration/rhel-7.4/meminfo-string.patch | 12 -- .../rhel-7.4/module-call-external.patch | 33 ---- .../rhel-7.4/module-kvm-fixup.patch | 12 -- test/integration/rhel-7.4/module-shadow.patch | 24 --- test/integration/rhel-7.4/multiple.test | 7 - test/integration/rhel-7.4/new-function.patch | 25 --- test/integration/rhel-7.4/new-globals.patch | 34 ---- .../rhel-7.4/parainstructions-section.patch | 11 -- .../rhel-7.4/replace-section-references.patch | 12 -- .../rhel-7.4/shadow-newpid-LOADED.test | 3 - test/integration/rhel-7.4/shadow-newpid.patch | 69 -------- .../rhel-7.4/smp-locks-section.patch | 14 -- .../rhel-7.4/special-static-2.patch | 24 --- .../integration/rhel-7.4/special-static.patch | 22 --- .../rhel-7.4/tracepoints-section.patch | 13 -- .../rhel-7.4/warn-detect-FAIL.patch | 8 - .../rhel-7.5/bug-table-section.patch | 12 -- .../rhel-7.5/cmdline-string-LOADED.test | 3 - .../integration/rhel-7.5/cmdline-string.patch | 12 -- .../integration/rhel-7.5/data-new-LOADED.test | 3 - test/integration/rhel-7.5/data-new.patch | 28 --- .../rhel-7.5/data-read-mostly.patch.disabled | 11 -- test/integration/rhel-7.5/fixup-section.patch | 12 -- test/integration/rhel-7.5/gcc-constprop.patch | 13 -- test/integration/rhel-7.5/gcc-isra.patch | 11 -- test/integration/rhel-7.5/gcc-mangled-3.patch | 13 -- .../rhel-7.5/gcc-static-local-var-2.patch | 13 -- .../rhel-7.5/gcc-static-local-var-3.patch | 19 -- .../rhel-7.5/gcc-static-local-var-4.patch | 20 --- .../rhel-7.5/gcc-static-local-var-4.test | 8 - .../rhel-7.5/gcc-static-local-var-5.patch | 45 ----- .../rhel-7.5/gcc-static-local-var-6.patch | 23 --- .../rhel-7.5/gcc-static-local-var.patch | 25 --- .../rhel-7.5/macro-callbacks.patch | 160 ----------------- test/integration/rhel-7.5/macro-printk.patch | 147 ---------------- .../rhel-7.5/meminfo-init-FAIL.patch | 11 -- .../rhel-7.5/meminfo-init2-FAIL.patch | 19 -- .../rhel-7.5/meminfo-string-LOADED.test | 3 - .../integration/rhel-7.5/meminfo-string.patch | 12 -- .../rhel-7.5/module-call-external.patch | 33 ---- .../rhel-7.5/module-kvm-fixup.patch | 12 -- .../rhel-7.5/module-shadow.patch.disabled | 25 --- test/integration/rhel-7.5/multiple.test | 7 - test/integration/rhel-7.5/new-function.patch | 25 --- test/integration/rhel-7.5/new-globals.patch | 34 ---- .../rhel-7.5/parainstructions-section.patch | 11 -- .../rhel-7.5/replace-section-references.patch | 12 -- .../rhel-7.5/shadow-newpid-LOADED.test | 3 - test/integration/rhel-7.5/shadow-newpid.patch | 72 -------- .../rhel-7.5/smp-locks-section.patch | 14 -- .../rhel-7.5/special-static-2.patch | 24 --- .../integration/rhel-7.5/special-static.patch | 22 --- .../rhel-7.5/tracepoints-section.patch | 13 -- .../rhel-7.5/warn-detect-FAIL.patch | 8 - .../rhel-7.6/bug-table-section.patch | 13 -- .../rhel-7.6/cmdline-string-LOADED.test | 3 - .../integration/rhel-7.6/cmdline-string.patch | 12 -- .../integration/rhel-7.6/data-new-LOADED.test | 3 - test/integration/rhel-7.6/data-new.patch | 29 --- .../rhel-7.6/data-read-mostly.patch.disabled | 12 -- test/integration/rhel-7.6/fixup-section.patch | 12 -- .../rhel-7.6/gcc-constprop.patch.disabled | 13 -- test/integration/rhel-7.6/gcc-isra.patch | 12 -- test/integration/rhel-7.6/gcc-mangled-3.patch | 14 -- .../rhel-7.6/gcc-static-local-var-2.patch | 14 -- .../rhel-7.6/gcc-static-local-var-3.patch | 20 --- .../rhel-7.6/gcc-static-local-var-4.patch | 21 --- .../rhel-7.6/gcc-static-local-var-4.test | 8 - .../rhel-7.6/gcc-static-local-var-5.patch | 45 ----- .../rhel-7.6/gcc-static-local-var-6.patch | 23 --- .../rhel-7.6/macro-callbacks.patch | 160 ----------------- test/integration/rhel-7.6/macro-printk.patch | 151 ---------------- .../rhel-7.6/meminfo-init-FAIL.patch | 12 -- .../rhel-7.6/meminfo-init2-FAIL.patch | 20 --- .../rhel-7.6/meminfo-string-LOADED.test | 3 - .../integration/rhel-7.6/meminfo-string.patch | 12 -- .../rhel-7.6/module-call-external.patch | 40 ----- test/integration/rhel-7.6/multiple.test | 7 - test/integration/rhel-7.6/new-function.patch | 26 --- test/integration/rhel-7.6/new-globals.patch | 34 ---- .../rhel-7.6/parainstructions-section.patch | 11 -- .../rhel-7.6/shadow-newpid-LOADED.test | 3 - test/integration/rhel-7.6/shadow-newpid.patch | 72 -------- .../rhel-7.6/smp-locks-section.patch | 14 -- .../integration/rhel-7.6/special-static.patch | 23 --- .../rhel-7.6/symvers-disagreement-FAIL.patch | 51 ------ .../rhel-7.6/tracepoints-section.patch | 14 -- .../rhel-7.6/warn-detect-FAIL.patch | 8 - .../rhel-7.7/bug-table-section.patch | 13 -- .../rhel-7.7/cmdline-string-LOADED.test | 3 - .../integration/rhel-7.7/cmdline-string.patch | 13 -- .../integration/rhel-7.7/data-new-LOADED.test | 3 - test/integration/rhel-7.7/data-new.patch | 29 --- .../rhel-7.7/data-read-mostly.patch.disabled | 12 -- test/integration/rhel-7.7/fixup-section.patch | 12 -- .../rhel-7.7/gcc-constprop.patch.disabled | 13 -- test/integration/rhel-7.7/gcc-isra.patch | 12 -- test/integration/rhel-7.7/gcc-mangled-3.patch | 14 -- .../rhel-7.7/gcc-static-local-var-2.patch | 14 -- .../rhel-7.7/gcc-static-local-var-3.patch | 20 --- .../rhel-7.7/gcc-static-local-var-4.patch | 21 --- .../rhel-7.7/gcc-static-local-var-4.test | 8 - .../rhel-7.7/gcc-static-local-var-5.patch | 46 ----- .../rhel-7.7/gcc-static-local-var-6.patch | 23 --- .../rhel-7.7/macro-callbacks.patch | 166 ------------------ test/integration/rhel-7.7/macro-printk.patch | 151 ---------------- .../rhel-7.7/meminfo-init-FAIL.patch | 12 -- .../rhel-7.7/meminfo-init2-FAIL.patch | 20 --- .../rhel-7.7/meminfo-string-LOADED.test | 3 - .../integration/rhel-7.7/meminfo-string.patch | 13 -- .../rhel-7.7/module-call-external.patch | 40 ----- test/integration/rhel-7.7/multiple.test | 7 - test/integration/rhel-7.7/new-function.patch | 26 --- test/integration/rhel-7.7/new-globals.patch | 36 ---- .../rhel-7.7/parainstructions-section.patch | 12 -- .../rhel-7.7/shadow-newpid-LOADED.test | 3 - test/integration/rhel-7.7/shadow-newpid.patch | 72 -------- .../rhel-7.7/smp-locks-section.patch | 15 -- .../integration/rhel-7.7/special-static.patch | 23 --- .../rhel-7.7/symvers-disagreement-FAIL.patch | 51 ------ .../rhel-7.7/tracepoints-section.patch | 14 -- .../rhel-7.7/warn-detect-FAIL.patch | 9 - test/integration/rhel-8.0/README | 1 - .../rhel-8.0/bug-table-section.patch | 13 -- .../rhel-8.0/cmdline-string-LOADED.test | 3 - .../integration/rhel-8.0/cmdline-string.patch | 14 -- .../integration/rhel-8.0/data-new-LOADED.test | 3 - test/integration/rhel-8.0/data-new.patch | 21 --- .../rhel-8.0/data-read-mostly.patch.disabled | 14 -- test/integration/rhel-8.0/fixup-section.patch | 12 -- .../rhel-8.0/gcc-constprop.patch.disabled | 14 -- test/integration/rhel-8.0/gcc-isra.patch | 12 -- test/integration/rhel-8.0/gcc-mangled-3.patch | 14 -- .../rhel-8.0/gcc-static-local-var-2.patch | 14 -- .../rhel-8.0/gcc-static-local-var-3.patch | 20 --- .../gcc-static-local-var-4.patch.disabled | 25 --- .../gcc-static-local-var-4.test.disabled | 8 - .../rhel-8.0/gcc-static-local-var-5.patch | 46 ----- .../rhel-8.0/gcc-static-local-var-6.patch | 23 --- .../rhel-8.0/macro-callbacks.patch | 158 ----------------- .../rhel-8.0/macro-printk.patch.disabled | 151 ---------------- .../rhel-8.0/meminfo-init-FAIL.patch | 12 -- .../rhel-8.0/meminfo-init2-FAIL.patch | 20 --- .../rhel-8.0/meminfo-string-LOADED.test | 3 - .../integration/rhel-8.0/meminfo-string.patch | 13 -- .../rhel-8.0/module-call-external.patch | 35 ---- test/integration/rhel-8.0/multiple.test | 7 - test/integration/rhel-8.0/new-function.patch | 26 --- test/integration/rhel-8.0/new-globals.patch | 36 ---- .../rhel-8.0/parainstructions-section.patch | 12 -- .../rhel-8.0/shadow-newpid-LOADED.test | 3 - .../rhel-8.0/shadow-newpid.patch.disabled | 80 --------- .../rhel-8.0/smp-locks-section.patch | 14 -- .../integration/rhel-8.0/special-static.patch | 23 --- .../rhel-8.0/symvers-disagreement-FAIL.patch | 51 ------ .../rhel-8.0/tracepoints-section.patch | 14 -- .../rhel-8.0/warn-detect-FAIL.patch | 9 - .../rhel-8.1/bug-table-section.patch | 12 -- .../rhel-8.1/cmdline-string-LOADED.test | 3 - .../integration/rhel-8.1/cmdline-string.patch | 13 -- .../integration/rhel-8.1/data-new-LOADED.test | 3 - test/integration/rhel-8.1/data-new.patch | 20 --- .../rhel-8.1/data-read-mostly.patch.disabled | 13 -- test/integration/rhel-8.1/fixup-section.patch | 11 -- .../rhel-8.1/gcc-constprop.patch.disabled | 13 -- test/integration/rhel-8.1/gcc-isra.patch | 11 -- test/integration/rhel-8.1/gcc-mangled-3.patch | 13 -- .../rhel-8.1/gcc-static-local-var-2.patch | 13 -- .../rhel-8.1/gcc-static-local-var-3.patch | 19 -- .../gcc-static-local-var-4.patch.disabled | 24 --- .../gcc-static-local-var-4.test.disabled | 8 - .../rhel-8.1/gcc-static-local-var-5.patch | 45 ----- .../rhel-8.1/gcc-static-local-var-6.patch | 22 --- .../rhel-8.1/macro-callbacks.patch | 155 ---------------- .../rhel-8.1/macro-printk.patch.disabled | 148 ---------------- .../rhel-8.1/meminfo-init-FAIL.patch | 11 -- .../rhel-8.1/meminfo-init2-FAIL.patch | 19 -- .../rhel-8.1/meminfo-string-LOADED.test | 3 - .../integration/rhel-8.1/meminfo-string.patch | 12 -- test/integration/rhel-8.1/module-LOADED.test | 13 -- test/integration/rhel-8.1/module.patch | 90 ---------- test/integration/rhel-8.1/multiple.test | 7 - test/integration/rhel-8.1/new-function.patch | 25 --- test/integration/rhel-8.1/new-globals.patch | 34 ---- .../rhel-8.1/parainstructions-section.patch | 11 -- .../shadow-newpid-LOADED.test.disabled | 3 - .../rhel-8.1/shadow-newpid.patch.disabled | 77 -------- .../rhel-8.1/smp-locks-section.patch | 13 -- .../rhel-8.1/special-static.patch.disabled | 22 --- .../rhel-8.1/symvers-disagreement-FAIL.patch | 51 ------ .../rhel-8.1/tracepoints-section.patch | 13 -- .../rhel-8.1/warn-detect-FAIL.patch | 8 - 214 files changed, 5598 deletions(-) delete mode 100644 test/integration/rhel-7.4/bug-table-section.patch delete mode 100755 test/integration/rhel-7.4/cmdline-string-LOADED.test delete mode 100644 test/integration/rhel-7.4/cmdline-string.patch delete mode 100755 test/integration/rhel-7.4/data-new-LOADED.test delete mode 100644 test/integration/rhel-7.4/data-new.patch delete mode 100644 test/integration/rhel-7.4/data-read-mostly.patch.disabled delete mode 100644 test/integration/rhel-7.4/fixup-section.patch delete mode 100644 test/integration/rhel-7.4/gcc-constprop.patch delete mode 100644 test/integration/rhel-7.4/gcc-isra.patch delete mode 100644 test/integration/rhel-7.4/gcc-mangled-3.patch delete mode 100644 test/integration/rhel-7.4/gcc-static-local-var-2.patch delete mode 100644 test/integration/rhel-7.4/gcc-static-local-var-3.patch delete mode 100644 test/integration/rhel-7.4/gcc-static-local-var-4.patch delete mode 100755 test/integration/rhel-7.4/gcc-static-local-var-4.test delete mode 100644 test/integration/rhel-7.4/gcc-static-local-var-5.patch delete mode 100644 test/integration/rhel-7.4/gcc-static-local-var-6.patch delete mode 100644 test/integration/rhel-7.4/gcc-static-local-var.patch delete mode 100644 test/integration/rhel-7.4/macro-callbacks.patch delete mode 100644 test/integration/rhel-7.4/macro-printk.patch delete mode 100644 test/integration/rhel-7.4/meminfo-init-FAIL.patch delete mode 100644 test/integration/rhel-7.4/meminfo-init2-FAIL.patch delete mode 100755 test/integration/rhel-7.4/meminfo-string-LOADED.test delete mode 100644 test/integration/rhel-7.4/meminfo-string.patch delete mode 100644 test/integration/rhel-7.4/module-call-external.patch delete mode 100644 test/integration/rhel-7.4/module-kvm-fixup.patch delete mode 100644 test/integration/rhel-7.4/module-shadow.patch delete mode 100755 test/integration/rhel-7.4/multiple.test delete mode 100644 test/integration/rhel-7.4/new-function.patch delete mode 100644 test/integration/rhel-7.4/new-globals.patch delete mode 100644 test/integration/rhel-7.4/parainstructions-section.patch delete mode 100644 test/integration/rhel-7.4/replace-section-references.patch delete mode 100755 test/integration/rhel-7.4/shadow-newpid-LOADED.test delete mode 100644 test/integration/rhel-7.4/shadow-newpid.patch delete mode 100644 test/integration/rhel-7.4/smp-locks-section.patch delete mode 100644 test/integration/rhel-7.4/special-static-2.patch delete mode 100644 test/integration/rhel-7.4/special-static.patch delete mode 100644 test/integration/rhel-7.4/tracepoints-section.patch delete mode 100644 test/integration/rhel-7.4/warn-detect-FAIL.patch delete mode 100644 test/integration/rhel-7.5/bug-table-section.patch delete mode 100755 test/integration/rhel-7.5/cmdline-string-LOADED.test delete mode 100644 test/integration/rhel-7.5/cmdline-string.patch delete mode 100755 test/integration/rhel-7.5/data-new-LOADED.test delete mode 100644 test/integration/rhel-7.5/data-new.patch delete mode 100644 test/integration/rhel-7.5/data-read-mostly.patch.disabled delete mode 100644 test/integration/rhel-7.5/fixup-section.patch delete mode 100644 test/integration/rhel-7.5/gcc-constprop.patch delete mode 100644 test/integration/rhel-7.5/gcc-isra.patch delete mode 100644 test/integration/rhel-7.5/gcc-mangled-3.patch delete mode 100644 test/integration/rhel-7.5/gcc-static-local-var-2.patch delete mode 100644 test/integration/rhel-7.5/gcc-static-local-var-3.patch delete mode 100644 test/integration/rhel-7.5/gcc-static-local-var-4.patch delete mode 100755 test/integration/rhel-7.5/gcc-static-local-var-4.test delete mode 100644 test/integration/rhel-7.5/gcc-static-local-var-5.patch delete mode 100644 test/integration/rhel-7.5/gcc-static-local-var-6.patch delete mode 100644 test/integration/rhel-7.5/gcc-static-local-var.patch delete mode 100644 test/integration/rhel-7.5/macro-callbacks.patch delete mode 100644 test/integration/rhel-7.5/macro-printk.patch delete mode 100644 test/integration/rhel-7.5/meminfo-init-FAIL.patch delete mode 100644 test/integration/rhel-7.5/meminfo-init2-FAIL.patch delete mode 100755 test/integration/rhel-7.5/meminfo-string-LOADED.test delete mode 100644 test/integration/rhel-7.5/meminfo-string.patch delete mode 100644 test/integration/rhel-7.5/module-call-external.patch delete mode 100644 test/integration/rhel-7.5/module-kvm-fixup.patch delete mode 100644 test/integration/rhel-7.5/module-shadow.patch.disabled delete mode 100755 test/integration/rhel-7.5/multiple.test delete mode 100644 test/integration/rhel-7.5/new-function.patch delete mode 100644 test/integration/rhel-7.5/new-globals.patch delete mode 100644 test/integration/rhel-7.5/parainstructions-section.patch delete mode 100644 test/integration/rhel-7.5/replace-section-references.patch delete mode 100755 test/integration/rhel-7.5/shadow-newpid-LOADED.test delete mode 100644 test/integration/rhel-7.5/shadow-newpid.patch delete mode 100644 test/integration/rhel-7.5/smp-locks-section.patch delete mode 100644 test/integration/rhel-7.5/special-static-2.patch delete mode 100644 test/integration/rhel-7.5/special-static.patch delete mode 100644 test/integration/rhel-7.5/tracepoints-section.patch delete mode 100644 test/integration/rhel-7.5/warn-detect-FAIL.patch delete mode 100644 test/integration/rhel-7.6/bug-table-section.patch delete mode 100755 test/integration/rhel-7.6/cmdline-string-LOADED.test delete mode 100644 test/integration/rhel-7.6/cmdline-string.patch delete mode 100755 test/integration/rhel-7.6/data-new-LOADED.test delete mode 100644 test/integration/rhel-7.6/data-new.patch delete mode 100644 test/integration/rhel-7.6/data-read-mostly.patch.disabled delete mode 100644 test/integration/rhel-7.6/fixup-section.patch delete mode 100644 test/integration/rhel-7.6/gcc-constprop.patch.disabled delete mode 100644 test/integration/rhel-7.6/gcc-isra.patch delete mode 100644 test/integration/rhel-7.6/gcc-mangled-3.patch delete mode 100644 test/integration/rhel-7.6/gcc-static-local-var-2.patch delete mode 100644 test/integration/rhel-7.6/gcc-static-local-var-3.patch delete mode 100644 test/integration/rhel-7.6/gcc-static-local-var-4.patch delete mode 100755 test/integration/rhel-7.6/gcc-static-local-var-4.test delete mode 100644 test/integration/rhel-7.6/gcc-static-local-var-5.patch delete mode 100644 test/integration/rhel-7.6/gcc-static-local-var-6.patch delete mode 100644 test/integration/rhel-7.6/macro-callbacks.patch delete mode 100644 test/integration/rhel-7.6/macro-printk.patch delete mode 100644 test/integration/rhel-7.6/meminfo-init-FAIL.patch delete mode 100644 test/integration/rhel-7.6/meminfo-init2-FAIL.patch delete mode 100755 test/integration/rhel-7.6/meminfo-string-LOADED.test delete mode 100644 test/integration/rhel-7.6/meminfo-string.patch delete mode 100644 test/integration/rhel-7.6/module-call-external.patch delete mode 100755 test/integration/rhel-7.6/multiple.test delete mode 100644 test/integration/rhel-7.6/new-function.patch delete mode 100644 test/integration/rhel-7.6/new-globals.patch delete mode 100644 test/integration/rhel-7.6/parainstructions-section.patch delete mode 100755 test/integration/rhel-7.6/shadow-newpid-LOADED.test delete mode 100644 test/integration/rhel-7.6/shadow-newpid.patch delete mode 100644 test/integration/rhel-7.6/smp-locks-section.patch delete mode 100644 test/integration/rhel-7.6/special-static.patch delete mode 100644 test/integration/rhel-7.6/symvers-disagreement-FAIL.patch delete mode 100644 test/integration/rhel-7.6/tracepoints-section.patch delete mode 100644 test/integration/rhel-7.6/warn-detect-FAIL.patch delete mode 100644 test/integration/rhel-7.7/bug-table-section.patch delete mode 100755 test/integration/rhel-7.7/cmdline-string-LOADED.test delete mode 100644 test/integration/rhel-7.7/cmdline-string.patch delete mode 100755 test/integration/rhel-7.7/data-new-LOADED.test delete mode 100644 test/integration/rhel-7.7/data-new.patch delete mode 100644 test/integration/rhel-7.7/data-read-mostly.patch.disabled delete mode 100644 test/integration/rhel-7.7/fixup-section.patch delete mode 100644 test/integration/rhel-7.7/gcc-constprop.patch.disabled delete mode 100644 test/integration/rhel-7.7/gcc-isra.patch delete mode 100644 test/integration/rhel-7.7/gcc-mangled-3.patch delete mode 100644 test/integration/rhel-7.7/gcc-static-local-var-2.patch delete mode 100644 test/integration/rhel-7.7/gcc-static-local-var-3.patch delete mode 100644 test/integration/rhel-7.7/gcc-static-local-var-4.patch delete mode 100755 test/integration/rhel-7.7/gcc-static-local-var-4.test delete mode 100644 test/integration/rhel-7.7/gcc-static-local-var-5.patch delete mode 100644 test/integration/rhel-7.7/gcc-static-local-var-6.patch delete mode 100644 test/integration/rhel-7.7/macro-callbacks.patch delete mode 100644 test/integration/rhel-7.7/macro-printk.patch delete mode 100644 test/integration/rhel-7.7/meminfo-init-FAIL.patch delete mode 100644 test/integration/rhel-7.7/meminfo-init2-FAIL.patch delete mode 100755 test/integration/rhel-7.7/meminfo-string-LOADED.test delete mode 100644 test/integration/rhel-7.7/meminfo-string.patch delete mode 100644 test/integration/rhel-7.7/module-call-external.patch delete mode 100755 test/integration/rhel-7.7/multiple.test delete mode 100644 test/integration/rhel-7.7/new-function.patch delete mode 100644 test/integration/rhel-7.7/new-globals.patch delete mode 100644 test/integration/rhel-7.7/parainstructions-section.patch delete mode 100755 test/integration/rhel-7.7/shadow-newpid-LOADED.test delete mode 100644 test/integration/rhel-7.7/shadow-newpid.patch delete mode 100644 test/integration/rhel-7.7/smp-locks-section.patch delete mode 100644 test/integration/rhel-7.7/special-static.patch delete mode 100644 test/integration/rhel-7.7/symvers-disagreement-FAIL.patch delete mode 100644 test/integration/rhel-7.7/tracepoints-section.patch delete mode 100644 test/integration/rhel-7.7/warn-detect-FAIL.patch delete mode 100644 test/integration/rhel-8.0/README delete mode 100644 test/integration/rhel-8.0/bug-table-section.patch delete mode 100755 test/integration/rhel-8.0/cmdline-string-LOADED.test delete mode 100644 test/integration/rhel-8.0/cmdline-string.patch delete mode 100755 test/integration/rhel-8.0/data-new-LOADED.test delete mode 100644 test/integration/rhel-8.0/data-new.patch delete mode 100644 test/integration/rhel-8.0/data-read-mostly.patch.disabled delete mode 100644 test/integration/rhel-8.0/fixup-section.patch delete mode 100644 test/integration/rhel-8.0/gcc-constprop.patch.disabled delete mode 100644 test/integration/rhel-8.0/gcc-isra.patch delete mode 100644 test/integration/rhel-8.0/gcc-mangled-3.patch delete mode 100644 test/integration/rhel-8.0/gcc-static-local-var-2.patch delete mode 100644 test/integration/rhel-8.0/gcc-static-local-var-3.patch delete mode 100644 test/integration/rhel-8.0/gcc-static-local-var-4.patch.disabled delete mode 100755 test/integration/rhel-8.0/gcc-static-local-var-4.test.disabled delete mode 100644 test/integration/rhel-8.0/gcc-static-local-var-5.patch delete mode 100644 test/integration/rhel-8.0/gcc-static-local-var-6.patch delete mode 100644 test/integration/rhel-8.0/macro-callbacks.patch delete mode 100644 test/integration/rhel-8.0/macro-printk.patch.disabled delete mode 100644 test/integration/rhel-8.0/meminfo-init-FAIL.patch delete mode 100644 test/integration/rhel-8.0/meminfo-init2-FAIL.patch delete mode 100755 test/integration/rhel-8.0/meminfo-string-LOADED.test delete mode 100644 test/integration/rhel-8.0/meminfo-string.patch delete mode 100644 test/integration/rhel-8.0/module-call-external.patch delete mode 100755 test/integration/rhel-8.0/multiple.test delete mode 100644 test/integration/rhel-8.0/new-function.patch delete mode 100644 test/integration/rhel-8.0/new-globals.patch delete mode 100644 test/integration/rhel-8.0/parainstructions-section.patch delete mode 100755 test/integration/rhel-8.0/shadow-newpid-LOADED.test delete mode 100644 test/integration/rhel-8.0/shadow-newpid.patch.disabled delete mode 100644 test/integration/rhel-8.0/smp-locks-section.patch delete mode 100644 test/integration/rhel-8.0/special-static.patch delete mode 100644 test/integration/rhel-8.0/symvers-disagreement-FAIL.patch delete mode 100644 test/integration/rhel-8.0/tracepoints-section.patch delete mode 100644 test/integration/rhel-8.0/warn-detect-FAIL.patch delete mode 100644 test/integration/rhel-8.1/bug-table-section.patch delete mode 100755 test/integration/rhel-8.1/cmdline-string-LOADED.test delete mode 100644 test/integration/rhel-8.1/cmdline-string.patch delete mode 100755 test/integration/rhel-8.1/data-new-LOADED.test delete mode 100644 test/integration/rhel-8.1/data-new.patch delete mode 100644 test/integration/rhel-8.1/data-read-mostly.patch.disabled delete mode 100644 test/integration/rhel-8.1/fixup-section.patch delete mode 100644 test/integration/rhel-8.1/gcc-constprop.patch.disabled delete mode 100644 test/integration/rhel-8.1/gcc-isra.patch delete mode 100644 test/integration/rhel-8.1/gcc-mangled-3.patch delete mode 100644 test/integration/rhel-8.1/gcc-static-local-var-2.patch delete mode 100644 test/integration/rhel-8.1/gcc-static-local-var-3.patch delete mode 100644 test/integration/rhel-8.1/gcc-static-local-var-4.patch.disabled delete mode 100755 test/integration/rhel-8.1/gcc-static-local-var-4.test.disabled delete mode 100644 test/integration/rhel-8.1/gcc-static-local-var-5.patch delete mode 100644 test/integration/rhel-8.1/gcc-static-local-var-6.patch delete mode 100644 test/integration/rhel-8.1/macro-callbacks.patch delete mode 100644 test/integration/rhel-8.1/macro-printk.patch.disabled delete mode 100644 test/integration/rhel-8.1/meminfo-init-FAIL.patch delete mode 100644 test/integration/rhel-8.1/meminfo-init2-FAIL.patch delete mode 100755 test/integration/rhel-8.1/meminfo-string-LOADED.test delete mode 100644 test/integration/rhel-8.1/meminfo-string.patch delete mode 100755 test/integration/rhel-8.1/module-LOADED.test delete mode 100644 test/integration/rhel-8.1/module.patch delete mode 100755 test/integration/rhel-8.1/multiple.test delete mode 100644 test/integration/rhel-8.1/new-function.patch delete mode 100644 test/integration/rhel-8.1/new-globals.patch delete mode 100644 test/integration/rhel-8.1/parainstructions-section.patch delete mode 100755 test/integration/rhel-8.1/shadow-newpid-LOADED.test.disabled delete mode 100644 test/integration/rhel-8.1/shadow-newpid.patch.disabled delete mode 100644 test/integration/rhel-8.1/smp-locks-section.patch delete mode 100644 test/integration/rhel-8.1/special-static.patch.disabled delete mode 100644 test/integration/rhel-8.1/symvers-disagreement-FAIL.patch delete mode 100644 test/integration/rhel-8.1/tracepoints-section.patch delete mode 100644 test/integration/rhel-8.1/warn-detect-FAIL.patch diff --git a/test/integration/rhel-7.4/bug-table-section.patch b/test/integration/rhel-7.4/bug-table-section.patch deleted file mode 100644 index 71f8c1bfa..000000000 --- a/test/integration/rhel-7.4/bug-table-section.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nupr src.orig/fs/proc/proc_sysctl.c src/fs/proc/proc_sysctl.c ---- src.orig/fs/proc/proc_sysctl.c 2017-09-22 15:27:21.698056175 -0400 -+++ src/fs/proc/proc_sysctl.c 2017-09-22 15:27:21.769056469 -0400 -@@ -266,6 +266,8 @@ void sysctl_head_put(struct ctl_table_he - - static struct ctl_table_header *sysctl_head_grab(struct ctl_table_header *head) - { -+ if (jiffies == 0) -+ printk("kpatch-test: testing __bug_table section changes\n"); - BUG_ON(!head); - spin_lock(&sysctl_lock); - if (!use_table(head)) diff --git a/test/integration/rhel-7.4/cmdline-string-LOADED.test b/test/integration/rhel-7.4/cmdline-string-LOADED.test deleted file mode 100755 index a8e0a0817..000000000 --- a/test/integration/rhel-7.4/cmdline-string-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep kpatch=1 /proc/cmdline diff --git a/test/integration/rhel-7.4/cmdline-string.patch b/test/integration/rhel-7.4/cmdline-string.patch deleted file mode 100644 index 749861fc4..000000000 --- a/test/integration/rhel-7.4/cmdline-string.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nupr src.orig/fs/proc/cmdline.c src/fs/proc/cmdline.c ---- src.orig/fs/proc/cmdline.c 2017-09-22 15:27:21.698056175 -0400 -+++ src/fs/proc/cmdline.c 2017-09-22 15:27:22.955061380 -0400 -@@ -5,7 +5,7 @@ - - static int cmdline_proc_show(struct seq_file *m, void *v) - { -- seq_printf(m, "%s\n", saved_command_line); -+ seq_printf(m, "%s kpatch=1\n", saved_command_line); - return 0; - } - diff --git a/test/integration/rhel-7.4/data-new-LOADED.test b/test/integration/rhel-7.4/data-new-LOADED.test deleted file mode 100755 index 598b6bb77..000000000 --- a/test/integration/rhel-7.4/data-new-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep "kpatch: 5" /proc/meminfo diff --git a/test/integration/rhel-7.4/data-new.patch b/test/integration/rhel-7.4/data-new.patch deleted file mode 100644 index 879828cbb..000000000 --- a/test/integration/rhel-7.4/data-new.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c ---- src.orig/fs/proc/meminfo.c 2017-09-22 15:27:21.699056179 -0400 -+++ src/fs/proc/meminfo.c 2017-09-22 15:27:24.102066130 -0400 -@@ -20,6 +20,8 @@ void __attribute__((weak)) arch_report_m - { - } - -+static int foo = 5; -+ - static int meminfo_proc_show(struct seq_file *m, void *v) - { - struct sysinfo i; -@@ -106,6 +108,7 @@ static int meminfo_proc_show(struct seq_ - #ifdef CONFIG_TRANSPARENT_HUGEPAGE - "AnonHugePages: %8lu kB\n" - #endif -+ "kpatch: %d" - , - K(i.totalram), - K(i.freeram), -@@ -167,6 +170,7 @@ static int meminfo_proc_show(struct seq_ - ,K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) * - HPAGE_PMD_NR) - #endif -+ ,foo - ); - - hugetlb_report_meminfo(m); diff --git a/test/integration/rhel-7.4/data-read-mostly.patch.disabled b/test/integration/rhel-7.4/data-read-mostly.patch.disabled deleted file mode 100644 index 611662f83..000000000 --- a/test/integration/rhel-7.4/data-read-mostly.patch.disabled +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nupr src.orig/net/core/dev.c src/net/core/dev.c ---- src.orig/net/core/dev.c 2017-09-22 15:27:21.759056428 -0400 -+++ src/net/core/dev.c 2017-09-22 15:27:25.244070859 -0400 -@@ -4012,6 +4012,7 @@ ncls: - case RX_HANDLER_PASS: - break; - default: -+ printk("BUG!\n"); - BUG(); - } - } diff --git a/test/integration/rhel-7.4/fixup-section.patch b/test/integration/rhel-7.4/fixup-section.patch deleted file mode 100644 index 0e2022e75..000000000 --- a/test/integration/rhel-7.4/fixup-section.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/fs/readdir.c b/fs/readdir.c -index fee38e04fae4..bce1e5ce74e5 100644 ---- a/fs/readdir.c -+++ b/fs/readdir.c -@@ -166,6 +166,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, - goto efault; - } - dirent = buf->current_dir; -+ asm("nop"); - if (__put_user(d_ino, &dirent->d_ino)) - goto efault; - if (__put_user(reclen, &dirent->d_reclen)) diff --git a/test/integration/rhel-7.4/gcc-constprop.patch b/test/integration/rhel-7.4/gcc-constprop.patch deleted file mode 100644 index 63ba45d5c..000000000 --- a/test/integration/rhel-7.4/gcc-constprop.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -Nupr src.orig/kernel/time/timekeeping.c src/kernel/time/timekeeping.c ---- src.orig/kernel/time/timekeeping.c 2017-09-22 15:27:21.602055778 -0400 -+++ src/kernel/time/timekeeping.c 2017-09-22 15:27:27.522080292 -0400 -@@ -877,6 +877,9 @@ void do_gettimeofday(struct timeval *tv) - { - struct timespec64 now; - -+ if (!tv) -+ return; -+ - getnstimeofday64(&now); - tv->tv_sec = now.tv_sec; - tv->tv_usec = now.tv_nsec/1000; diff --git a/test/integration/rhel-7.4/gcc-isra.patch b/test/integration/rhel-7.4/gcc-isra.patch deleted file mode 100644 index a869797ee..000000000 --- a/test/integration/rhel-7.4/gcc-isra.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nupr src.orig/fs/proc/proc_sysctl.c src/fs/proc/proc_sysctl.c ---- src.orig/fs/proc/proc_sysctl.c 2017-09-22 15:27:21.698056175 -0400 -+++ src/fs/proc/proc_sysctl.c 2017-09-22 15:27:28.670085046 -0400 -@@ -24,6 +24,7 @@ void proc_sys_poll_notify(struct ctl_tab - if (!poll) - return; - -+ printk("kpatch-test: testing gcc .isra function name mangling\n"); - atomic_inc(&poll->event); - wake_up_interruptible(&poll->wait); - } diff --git a/test/integration/rhel-7.4/gcc-mangled-3.patch b/test/integration/rhel-7.4/gcc-mangled-3.patch deleted file mode 100644 index 582868048..000000000 --- a/test/integration/rhel-7.4/gcc-mangled-3.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -Nupr src.orig/mm/slub.c src/mm/slub.c ---- src.orig/mm/slub.c 2017-09-22 15:27:21.618055844 -0400 -+++ src/mm/slub.c 2017-09-22 15:27:29.830089850 -0400 -@@ -5528,6 +5528,9 @@ void get_slabinfo(struct kmem_cache *s, - unsigned long nr_free = 0; - int node; - -+ if (!jiffies) -+ printk("slabinfo\n"); -+ - for_each_online_node(node) { - struct kmem_cache_node *n = get_node(s, node); - diff --git a/test/integration/rhel-7.4/gcc-static-local-var-2.patch b/test/integration/rhel-7.4/gcc-static-local-var-2.patch deleted file mode 100644 index 4f653d7e5..000000000 --- a/test/integration/rhel-7.4/gcc-static-local-var-2.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -Nupr src.orig/mm/mmap.c src/mm/mmap.c ---- src.orig/mm/mmap.c 2017-09-22 15:27:21.618055844 -0400 -+++ src/mm/mmap.c 2017-09-22 15:27:31.024094794 -0400 -@@ -1687,6 +1688,9 @@ unsigned long mmap_region(struct file *f - struct rb_node **rb_link, *rb_parent; - unsigned long charged = 0; - -+ if (!jiffies) -+ printk("kpatch mmap foo\n"); -+ - /* Check against address space limit. */ - if (!may_expand_vm(mm, len >> PAGE_SHIFT)) { - unsigned long nr_pages; diff --git a/test/integration/rhel-7.4/gcc-static-local-var-3.patch b/test/integration/rhel-7.4/gcc-static-local-var-3.patch deleted file mode 100644 index d87677b5d..000000000 --- a/test/integration/rhel-7.4/gcc-static-local-var-3.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -Nupr src.orig/kernel/sys.c src/kernel/sys.c ---- src.orig/kernel/sys.c 2017-09-22 15:27:21.601055773 -0400 -+++ src/kernel/sys.c 2017-09-22 15:27:32.170099540 -0400 -@@ -554,8 +554,15 @@ SYSCALL_DEFINE4(reboot, int, magic1, int - return ret; - } - -+void kpatch_bar(void) -+{ -+ if (!jiffies) -+ printk("kpatch_foo\n"); -+} -+ - static void deferred_cad(struct work_struct *dummy) - { -+ kpatch_bar(); - kernel_restart(NULL); - } - diff --git a/test/integration/rhel-7.4/gcc-static-local-var-4.patch b/test/integration/rhel-7.4/gcc-static-local-var-4.patch deleted file mode 100644 index e22ead770..000000000 --- a/test/integration/rhel-7.4/gcc-static-local-var-4.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -Nupr src.orig/fs/aio.c src/fs/aio.c ---- src.orig/fs/aio.c 2017-09-22 15:27:21.702056192 -0400 -+++ src/fs/aio.c 2017-09-22 15:27:33.299104215 -0400 -@@ -219,9 +219,16 @@ static int __init aio_setup(void) - } - __initcall(aio_setup); - -+void kpatch_aio_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch aio foo\n"); -+} -+ - static void put_aio_ring_file(struct kioctx *ctx) - { - struct file *aio_ring_file = ctx->aio_ring_file; -+ kpatch_aio_foo(); - if (aio_ring_file) { - truncate_setsize(aio_ring_file->f_inode, 0); - diff --git a/test/integration/rhel-7.4/gcc-static-local-var-4.test b/test/integration/rhel-7.4/gcc-static-local-var-4.test deleted file mode 100755 index e085f9345..000000000 --- a/test/integration/rhel-7.4/gcc-static-local-var-4.test +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -set -o pipefail -if ! $(eu-readelf --wide --symbols test-gcc-static-local-var-4.ko | awk '$NF == "free_ioctx" { exit 1 }'); then - exit 1 -else - exit 0 -fi diff --git a/test/integration/rhel-7.4/gcc-static-local-var-5.patch b/test/integration/rhel-7.4/gcc-static-local-var-5.patch deleted file mode 100644 index 540affaf8..000000000 --- a/test/integration/rhel-7.4/gcc-static-local-var-5.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff -Nupr src.orig/kernel/audit.c src/kernel/audit.c ---- src.orig/kernel/audit.c 2017-09-22 15:27:21.602055778 -0400 -+++ src/kernel/audit.c 2017-09-22 15:27:34.429108894 -0400 -@@ -205,6 +205,12 @@ void audit_panic(const char *message) - } - } - -+void kpatch_audit_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch audit foo\n"); -+} -+ - static inline int audit_rate_check(void) - { - static unsigned long last_check = 0; -@@ -215,6 +221,7 @@ static inline int audit_rate_check(void) - unsigned long elapsed; - int retval = 0; - -+ kpatch_audit_foo(); - if (!audit_rate_limit) return 1; - - spin_lock_irqsave(&lock, flags); -@@ -234,6 +241,11 @@ static inline int audit_rate_check(void) - return retval; - } - -+noinline void kpatch_audit_check(void) -+{ -+ audit_rate_check(); -+} -+ - /** - * audit_log_lost - conditionally log lost audit message event - * @message: the message stating reason for lost audit message -@@ -282,6 +294,8 @@ static int audit_log_config_change(char - struct audit_buffer *ab; - int rc = 0; - -+ kpatch_audit_check(); -+ - ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE); - if (unlikely(!ab)) - return rc; diff --git a/test/integration/rhel-7.4/gcc-static-local-var-6.patch b/test/integration/rhel-7.4/gcc-static-local-var-6.patch deleted file mode 100644 index bd5493c0b..000000000 --- a/test/integration/rhel-7.4/gcc-static-local-var-6.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c -index a9d587a..23336ed 100644 ---- a/net/ipv6/netfilter.c -+++ b/net/ipv6/netfilter.c -@@ -106,6 +106,8 @@ static int nf_ip6_reroute(struct sk_buff *skb, - return 0; - } - -+#include "kpatch-macros.h" -+ - static int nf_ip6_route(struct net *net, struct dst_entry **dst, - struct flowi *fl, bool strict) - { -@@ -119,6 +121,9 @@ static int nf_ip6_route(struct net *net, struct dst_entry **dst, - struct dst_entry *result; - int err; - -+ if (!jiffies) -+ printk("kpatch nf_ip6_route foo\n"); -+ - result = ip6_route_output(net, sk, &fl->u.ip6); - err = result->error; - if (err) diff --git a/test/integration/rhel-7.4/gcc-static-local-var.patch b/test/integration/rhel-7.4/gcc-static-local-var.patch deleted file mode 100644 index 2dab9dbbf..000000000 --- a/test/integration/rhel-7.4/gcc-static-local-var.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -Nupr src.orig/arch/x86/kernel/ldt.c src/arch/x86/kernel/ldt.c ---- src.orig/arch/x86/kernel/ldt.c 2017-09-22 15:27:20.847052651 -0400 -+++ src/arch/x86/kernel/ldt.c 2017-09-22 15:27:35.573113632 -0400 -@@ -98,6 +98,12 @@ static inline int copy_ldt(mm_context_t - return 0; - } - -+void hi_there(void) -+{ -+ if (!jiffies) -+ printk("hi there\n"); -+} -+ - /* - * we do not have to muck with descriptors here, that is - * done in switch_mm() as needed. -@@ -107,6 +113,8 @@ int init_new_context(struct task_struct - struct mm_struct *old_mm; - int retval = 0; - -+ hi_there(); -+ - mutex_init(&mm->context.lock); - mm->context.size = 0; - old_mm = current->mm; diff --git a/test/integration/rhel-7.4/macro-callbacks.patch b/test/integration/rhel-7.4/macro-callbacks.patch deleted file mode 100644 index 0d6831b66..000000000 --- a/test/integration/rhel-7.4/macro-callbacks.patch +++ /dev/null @@ -1,160 +0,0 @@ -kpatch/livepatch callback test patch: - - vmlinux - pcspkr (mod) - joydev (mod) - -Note: update joydev's pre-patch callback to return -ENODEV to test failure path - ---- src.old/fs/aio.c 2018-02-26 11:07:51.522610407 -0500 -+++ src/fs/aio.c 2018-03-05 11:17:21.560015449 -0500 -@@ -42,6 +42,50 @@ - #include - #include - -+#include -+#include "kpatch-macros.h" -+ -+static const char *const module_state[] = { -+ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", -+ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", -+ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", -+ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", -+}; -+ -+static void callback_info(const char *callback, patch_object *obj) -+{ -+ if (obj->mod) -+ pr_info("%s: %s -> %s\n", callback, obj->mod->name, -+ module_state[obj->mod->state]); -+ else -+ pr_info("%s: vmlinux\n", callback); -+} -+ -+static int pre_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+ return 0; -+} -+KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); -+ -+static void post_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_PATCH_CALLBACK(post_patch_callback); -+ -+static void pre_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); -+ -+static void post_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); -+ - #define AIO_RING_MAGIC 0xa10a10a1 - #define AIO_RING_COMPAT_FEATURES 1 - #define AIO_RING_INCOMPAT_FEATURES 0 ---- src.old/drivers/input/joydev.c 2018-02-26 11:07:49.470610407 -0500 -+++ src/drivers/input/joydev.c 2018-03-05 11:18:13.998015449 -0500 -@@ -954,3 +954,47 @@ static void __exit joydev_exit(void) - - module_init(joydev_init); - module_exit(joydev_exit); -+ -+#include -+#include "kpatch-macros.h" -+ -+static const char *const module_state[] = { -+ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", -+ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", -+ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", -+ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", -+}; -+ -+static void callback_info(const char *callback, patch_object *obj) -+{ -+ if (obj->mod) -+ pr_info("%s: %s -> %s\n", callback, obj->mod->name, -+ module_state[obj->mod->state]); -+ else -+ pr_info("%s: vmlinux\n", callback); -+} -+ -+static int pre_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+ return 0; /* return -ENODEV; */ -+} -+KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); -+ -+static void post_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_PATCH_CALLBACK(post_patch_callback); -+ -+static void pre_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); -+ -+static void post_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); ---- src.old/drivers/input/misc/pcspkr.c 2018-02-26 11:07:49.477610407 -0500 -+++ src/drivers/input/misc/pcspkr.c 2018-03-05 11:18:23.411015449 -0500 -@@ -136,3 +136,46 @@ static struct platform_driver pcspkr_pla - }; - module_platform_driver(pcspkr_platform_driver); - -+#include -+#include "kpatch-macros.h" -+ -+static const char *const module_state[] = { -+ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", -+ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", -+ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", -+ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", -+}; -+ -+static void callback_info(const char *callback, patch_object *obj) -+{ -+ if (obj->mod) -+ pr_info("%s: %s -> %s\n", callback, obj->mod->name, -+ module_state[obj->mod->state]); -+ else -+ pr_info("%s: vmlinux\n", callback); -+} -+ -+static int pre_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+ return 0; -+} -+KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); -+ -+static void post_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_PATCH_CALLBACK(post_patch_callback); -+ -+static void pre_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); -+ -+static void post_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); diff --git a/test/integration/rhel-7.4/macro-printk.patch b/test/integration/rhel-7.4/macro-printk.patch deleted file mode 100644 index 9f591f4c0..000000000 --- a/test/integration/rhel-7.4/macro-printk.patch +++ /dev/null @@ -1,147 +0,0 @@ -diff -Nupr src.orig/net/ipv4/fib_frontend.c src/net/ipv4/fib_frontend.c ---- src.orig/net/ipv4/fib_frontend.c 2017-09-22 16:52:10.646110299 -0400 -+++ src/net/ipv4/fib_frontend.c 2017-09-22 16:55:14.395870305 -0400 -@@ -633,6 +633,7 @@ errout: - return err; - } - -+#include "kpatch-macros.h" - static int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh) - { - struct net *net = sock_net(skb->sk); -@@ -651,6 +652,7 @@ static int inet_rtm_newroute(struct sk_b - } - - err = fib_table_insert(net, tb, &cfg); -+ KPATCH_PRINTK("[inet_rtm_newroute]: err is %d\n", err); - errout: - return err; - } -diff -Nupr src.orig/net/ipv4/fib_semantics.c src/net/ipv4/fib_semantics.c ---- src.orig/net/ipv4/fib_semantics.c 2017-09-22 16:52:10.645110295 -0400 -+++ src/net/ipv4/fib_semantics.c 2017-09-22 16:54:05.175584004 -0400 -@@ -925,6 +925,7 @@ fib_convert_metrics(struct fib_info *fi, - return 0; - } - -+#include "kpatch-macros.h" - struct fib_info *fib_create_info(struct fib_config *cfg) - { - int err; -@@ -949,6 +950,7 @@ struct fib_info *fib_create_info(struct - #endif - - err = -ENOBUFS; -+ KPATCH_PRINTK("[fib_create_info]: create error err is %d\n",err); - if (fib_info_cnt >= fib_info_hash_size) { - unsigned int new_size = fib_info_hash_size << 1; - struct hlist_head *new_info_hash; -@@ -969,6 +971,7 @@ struct fib_info *fib_create_info(struct - if (!fib_info_hash_size) - goto failure; - } -+ KPATCH_PRINTK("[fib_create_info]: 2 create error err is %d\n",err); - - fi = kzalloc(sizeof(*fi)+nhs*sizeof(struct fib_nh), GFP_KERNEL); - if (fi == NULL) -@@ -980,6 +983,7 @@ struct fib_info *fib_create_info(struct - } else - fi->fib_metrics = (u32 *) dst_default_metrics; - fib_info_cnt++; -+ KPATCH_PRINTK("[fib_create_info]: 3 create error err is %d\n",err); - - fi->fib_net = net; - fi->fib_protocol = cfg->fc_protocol; -@@ -996,8 +1000,10 @@ struct fib_info *fib_create_info(struct - if (!nexthop_nh->nh_pcpu_rth_output) - goto failure; - } endfor_nexthops(fi) -+ KPATCH_PRINTK("[fib_create_info]: 4 create error err is %d\n",err); - - err = fib_convert_metrics(fi, cfg); -+ KPATCH_PRINTK("[fib_create_info]: 5 create error err is %d\n",err); - if (err) - goto failure; - -@@ -1048,6 +1054,7 @@ struct fib_info *fib_create_info(struct - nh->nh_weight = 1; - #endif - } -+ KPATCH_PRINTK("[fib_create_info]: 6 create error err is %d\n",err); - - if (fib_props[cfg->fc_type].error) { - if (cfg->fc_gw || cfg->fc_oif || cfg->fc_mp) -@@ -1065,6 +1072,7 @@ struct fib_info *fib_create_info(struct - goto err_inval; - } - } -+ KPATCH_PRINTK("[fib_create_info]: 7 create error err is %d\n",err); - - if (cfg->fc_scope > RT_SCOPE_HOST) - goto err_inval; -@@ -1087,6 +1095,7 @@ struct fib_info *fib_create_info(struct - goto failure; - } endfor_nexthops(fi) - } -+ KPATCH_PRINTK("[fib_create_info]: 8 create error err is %d\n",err); - - if (fi->fib_prefsrc) { - if (cfg->fc_type != RTN_LOCAL || !cfg->fc_dst || -@@ -1099,6 +1108,7 @@ struct fib_info *fib_create_info(struct - fib_info_update_nh_saddr(net, nexthop_nh); - fib_add_weight(fi, nexthop_nh); - } endfor_nexthops(fi) -+ KPATCH_PRINTK("[fib_create_info]: 9 create error err is %d\n",err); - - fib_rebalance(fi); - -@@ -1110,6 +1120,7 @@ link_it: - ofi->fib_treeref++; - return ofi; - } -+ KPATCH_PRINTK("[fib_create_info]: 10 create error err is %d\n",err); - - fi->fib_treeref++; - atomic_inc(&fi->fib_clntref); -@@ -1133,6 +1144,7 @@ link_it: - hlist_add_head(&nexthop_nh->nh_hash, head); - } endfor_nexthops(fi) - spin_unlock_bh(&fib_info_lock); -+ KPATCH_PRINTK("[fib_create_info]: 11 create error err is %d\n",err); - return fi; - - err_inval: -@@ -1143,6 +1155,7 @@ failure: - fi->fib_dead = 1; - free_fib_info(fi); - } -+ KPATCH_PRINTK("[fib_create_info]: 12 create error err is %d\n",err); - - return ERR_PTR(err); - } -diff -Nupr src.orig/net/ipv4/fib_trie.c src/net/ipv4/fib_trie.c ---- src.orig/net/ipv4/fib_trie.c 2017-09-22 16:52:10.645110295 -0400 -+++ src/net/ipv4/fib_trie.c 2017-09-22 16:55:39.940975963 -0400 -@@ -1191,6 +1191,7 @@ static int fib_insert_alias(struct trie - } - - /* Caller must hold RTNL. */ -+#include "kpatch-macros.h" - int fib_table_insert(struct net *net, struct fib_table *tb, - struct fib_config *cfg) - { -@@ -1216,11 +1217,14 @@ int fib_table_insert(struct net *net, st - if ((plen < KEYLENGTH) && (key << plen)) - return -EINVAL; - -+ KPATCH_PRINTK("[fib_table_insert]: start\n"); - fi = fib_create_info(cfg); - if (IS_ERR(fi)) { - err = PTR_ERR(fi); -+ KPATCH_PRINTK("[fib_table_insert]: create error err is %d\n",err); - goto err; - } -+ KPATCH_PRINTK("[fib_table_insert]: cross\n"); - - l = fib_find_node(t, &tp, key); - fa = l ? fib_find_alias(&l->leaf, slen, tos, fi->fib_priority) : NULL; diff --git a/test/integration/rhel-7.4/meminfo-init-FAIL.patch b/test/integration/rhel-7.4/meminfo-init-FAIL.patch deleted file mode 100644 index 5df52251d..000000000 --- a/test/integration/rhel-7.4/meminfo-init-FAIL.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c ---- src.orig/fs/proc/meminfo.c 2017-09-22 15:27:21.699056179 -0400 -+++ src/fs/proc/meminfo.c 2017-09-22 15:27:40.130132502 -0400 -@@ -191,6 +191,7 @@ static const struct file_operations memi - - static int __init proc_meminfo_init(void) - { -+ printk("a\n"); - proc_create("meminfo", 0, NULL, &meminfo_proc_fops); - return 0; - } diff --git a/test/integration/rhel-7.4/meminfo-init2-FAIL.patch b/test/integration/rhel-7.4/meminfo-init2-FAIL.patch deleted file mode 100644 index c030f6190..000000000 --- a/test/integration/rhel-7.4/meminfo-init2-FAIL.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c ---- src.orig/fs/proc/meminfo.c 2017-09-22 15:27:21.699056179 -0400 -+++ src/fs/proc/meminfo.c 2017-09-22 15:27:38.972127707 -0400 -@@ -30,6 +30,7 @@ static int meminfo_proc_show(struct seq_ - unsigned long pages[NR_LRU_LISTS]; - int lru; - -+ printk("a\n"); - /* - * display in kilobytes. - */ -@@ -191,6 +192,7 @@ static const struct file_operations memi - - static int __init proc_meminfo_init(void) - { -+ printk("a\n"); - proc_create("meminfo", 0, NULL, &meminfo_proc_fops); - return 0; - } diff --git a/test/integration/rhel-7.4/meminfo-string-LOADED.test b/test/integration/rhel-7.4/meminfo-string-LOADED.test deleted file mode 100755 index 10dc20b3d..000000000 --- a/test/integration/rhel-7.4/meminfo-string-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep VMALLOCCHUNK /proc/meminfo diff --git a/test/integration/rhel-7.4/meminfo-string.patch b/test/integration/rhel-7.4/meminfo-string.patch deleted file mode 100644 index afdc5d016..000000000 --- a/test/integration/rhel-7.4/meminfo-string.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c ---- src.orig/fs/proc/meminfo.c 2017-09-22 15:27:21.699056179 -0400 -+++ src/fs/proc/meminfo.c 2017-09-22 15:27:41.274137239 -0400 -@@ -99,7 +99,7 @@ static int meminfo_proc_show(struct seq_ - "Committed_AS: %8lu kB\n" - "VmallocTotal: %8lu kB\n" - "VmallocUsed: %8lu kB\n" -- "VmallocChunk: %8lu kB\n" -+ "VMALLOCCHUNK: %8lu kB\n" - #ifdef CONFIG_MEMORY_FAILURE - "HardwareCorrupted: %5lu kB\n" - #endif diff --git a/test/integration/rhel-7.4/module-call-external.patch b/test/integration/rhel-7.4/module-call-external.patch deleted file mode 100644 index 754d72597..000000000 --- a/test/integration/rhel-7.4/module-call-external.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff -Nupr src.orig/fs/nfsd/export.c src/fs/nfsd/export.c ---- src.orig/fs/nfsd/export.c 2017-09-22 15:27:21.705056204 -0400 -+++ src/fs/nfsd/export.c 2017-09-22 15:27:42.411141948 -0400 -@@ -1184,6 +1184,8 @@ static void exp_flags(struct seq_file *m - } - } - -+extern char *kpatch_string(void); -+ - static int e_show(struct seq_file *m, void *p) - { - struct cache_head *cp = p; -@@ -1193,6 +1195,7 @@ static int e_show(struct seq_file *m, vo - if (p == SEQ_START_TOKEN) { - seq_puts(m, "# Version 1.1\n"); - seq_puts(m, "# Path Client(Flags) # IPs\n"); -+ seq_puts(m, kpatch_string()); - return 0; - } - -diff -Nupr src.orig/net/netlink/af_netlink.c src/net/netlink/af_netlink.c ---- src.orig/net/netlink/af_netlink.c 2017-09-22 15:27:21.754056407 -0400 -+++ src/net/netlink/af_netlink.c 2017-09-22 15:27:42.412141952 -0400 -@@ -3260,4 +3260,9 @@ panic: - panic("netlink_init: Cannot allocate nl_table\n"); - } - -+char *kpatch_string(void) -+{ -+ return "# kpatch\n"; -+} -+ - core_initcall(netlink_proto_init); diff --git a/test/integration/rhel-7.4/module-kvm-fixup.patch b/test/integration/rhel-7.4/module-kvm-fixup.patch deleted file mode 100644 index 174ad6564..000000000 --- a/test/integration/rhel-7.4/module-kvm-fixup.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nupr src.orig/arch/x86/kvm/vmx.c src/arch/x86/kvm/vmx.c ---- src.orig/arch/x86/kvm/vmx.c 2017-09-22 15:27:20.853052676 -0400 -+++ src/arch/x86/kvm/vmx.c 2017-09-22 15:27:43.583146801 -0400 -@@ -10597,6 +10597,8 @@ static int vmx_check_intercept(struct kv - struct x86_instruction_info *info, - enum x86_intercept_stage stage) - { -+ if (!jiffies) -+ printk("kpatch vmx_check_intercept\n"); - return X86EMUL_CONTINUE; - } - diff --git a/test/integration/rhel-7.4/module-shadow.patch b/test/integration/rhel-7.4/module-shadow.patch deleted file mode 100644 index c7da353c8..000000000 --- a/test/integration/rhel-7.4/module-shadow.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -Nupr src.orig/arch/x86/kvm/vmx.c src/arch/x86/kvm/vmx.c ---- src.orig/arch/x86/kvm/vmx.c 2017-09-22 15:27:20.853052676 -0400 -+++ src/arch/x86/kvm/vmx.c 2017-09-22 15:27:44.742151601 -0400 -@@ -10581,10 +10581,20 @@ static void vmx_leave_nested(struct kvm_ - * It should only be called before L2 actually succeeded to run, and when - * vmcs01 is current (it doesn't leave_guest_mode() or switch vmcss). - */ -+#include "kpatch.h" - static void nested_vmx_entry_failure(struct kvm_vcpu *vcpu, - struct vmcs12 *vmcs12, - u32 reason, unsigned long qualification) - { -+ int *kpatch; -+ -+ kpatch = kpatch_shadow_alloc(vcpu, "kpatch", sizeof(*kpatch), -+ GFP_KERNEL); -+ if (kpatch) { -+ kpatch_shadow_get(vcpu, "kpatch"); -+ kpatch_shadow_free(vcpu, "kpatch"); -+ } -+ - load_vmcs12_host_state(vcpu, vmcs12); - vmcs12->vm_exit_reason = reason | VMX_EXIT_REASONS_FAILED_VMENTRY; - vmcs12->exit_qualification = qualification; diff --git a/test/integration/rhel-7.4/multiple.test b/test/integration/rhel-7.4/multiple.test deleted file mode 100755 index 7e4b3525c..000000000 --- a/test/integration/rhel-7.4/multiple.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -SCRIPTDIR="$(readlink -f $(dirname $(type -p $0)))" - -declare -a blacklist=(meminfo-string-LOADED.test) - -source ${SCRIPTDIR}/../common/multiple.template diff --git a/test/integration/rhel-7.4/new-function.patch b/test/integration/rhel-7.4/new-function.patch deleted file mode 100644 index cf47c8355..000000000 --- a/test/integration/rhel-7.4/new-function.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -Nupr src.orig/drivers/tty/n_tty.c src/drivers/tty/n_tty.c ---- src.orig/drivers/tty/n_tty.c 2017-09-22 15:27:21.084053633 -0400 -+++ src/drivers/tty/n_tty.c 2017-09-22 15:27:45.888156346 -0400 -@@ -2016,7 +2016,7 @@ do_it_again: - * lock themselves) - */ - --static ssize_t n_tty_write(struct tty_struct *tty, struct file *file, -+static ssize_t noinline kpatch_n_tty_write(struct tty_struct *tty, struct file *file, - const unsigned char *buf, size_t nr) - { - const unsigned char *b = buf; -@@ -2098,6 +2098,12 @@ break_out: - return (b - buf) ? b - buf : retval; - } - -+static ssize_t n_tty_write(struct tty_struct *tty, struct file *file, -+ const unsigned char *buf, size_t nr) -+{ -+ return kpatch_n_tty_write(tty, file, buf, nr); -+} -+ - /** - * n_tty_poll - poll method for N_TTY - * @tty: terminal device diff --git a/test/integration/rhel-7.4/new-globals.patch b/test/integration/rhel-7.4/new-globals.patch deleted file mode 100644 index 3d9d34940..000000000 --- a/test/integration/rhel-7.4/new-globals.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff -Nupr src.orig/fs/proc/cmdline.c src/fs/proc/cmdline.c ---- src.orig/fs/proc/cmdline.c 2017-09-22 15:27:21.698056175 -0400 -+++ src/fs/proc/cmdline.c 2017-09-22 15:27:47.028161067 -0400 -@@ -27,3 +27,10 @@ static int __init proc_cmdline_init(void - return 0; - } - module_init(proc_cmdline_init); -+ -+#include -+void kpatch_print_message(void) -+{ -+ if (!jiffies) -+ printk("hello there!\n"); -+} -diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c ---- src.orig/fs/proc/meminfo.c 2017-09-22 15:27:21.699056179 -0400 -+++ src/fs/proc/meminfo.c 2017-09-22 15:27:47.029161071 -0400 -@@ -16,6 +16,8 @@ - #include - #include "internal.h" - -+void kpatch_print_message(void); -+ - void __attribute__((weak)) arch_report_meminfo(struct seq_file *m) - { - } -@@ -53,6 +55,7 @@ static int meminfo_proc_show(struct seq_ - /* - * Tagged format, for easy grepping and expansion. - */ -+ kpatch_print_message(); - seq_printf(m, - "MemTotal: %8lu kB\n" - "MemFree: %8lu kB\n" diff --git a/test/integration/rhel-7.4/parainstructions-section.patch b/test/integration/rhel-7.4/parainstructions-section.patch deleted file mode 100644 index 809dce4b9..000000000 --- a/test/integration/rhel-7.4/parainstructions-section.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nupr src.orig/fs/proc/generic.c src/fs/proc/generic.c ---- src.orig/fs/proc/generic.c 2017-09-22 15:27:21.698056175 -0400 -+++ src/fs/proc/generic.c 2017-09-22 15:27:48.190165879 -0400 -@@ -194,6 +194,7 @@ int proc_alloc_inum(unsigned int *inum) - unsigned int i; - int error; - -+ printk("kpatch-test: testing change to .parainstructions section\n"); - retry: - if (!ida_pre_get(&proc_inum_ida, GFP_KERNEL)) - return -ENOMEM; diff --git a/test/integration/rhel-7.4/replace-section-references.patch b/test/integration/rhel-7.4/replace-section-references.patch deleted file mode 100644 index e41bba929..000000000 --- a/test/integration/rhel-7.4/replace-section-references.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nupr src.orig/arch/x86/kvm/x86.c src/arch/x86/kvm/x86.c ---- src.orig/arch/x86/kvm/x86.c 2017-09-22 15:27:20.852052672 -0400 -+++ src/arch/x86/kvm/x86.c 2017-09-22 15:27:49.362170732 -0400 -@@ -248,6 +248,8 @@ static void shared_msr_update(unsigned s - - void kvm_define_shared_msr(unsigned slot, u32 msr) - { -+ if (!jiffies) -+ printk("kpatch kvm define shared msr\n"); - BUG_ON(slot >= KVM_NR_SHARED_MSRS); - shared_msrs_global.msrs[slot] = msr; - if (slot >= shared_msrs_global.nr) diff --git a/test/integration/rhel-7.4/shadow-newpid-LOADED.test b/test/integration/rhel-7.4/shadow-newpid-LOADED.test deleted file mode 100755 index c07d11205..000000000 --- a/test/integration/rhel-7.4/shadow-newpid-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep -q newpid: /proc/$$/status diff --git a/test/integration/rhel-7.4/shadow-newpid.patch b/test/integration/rhel-7.4/shadow-newpid.patch deleted file mode 100644 index cde181016..000000000 --- a/test/integration/rhel-7.4/shadow-newpid.patch +++ /dev/null @@ -1,69 +0,0 @@ -diff -Nupr src.orig/fs/proc/array.c src/fs/proc/array.c ---- src.orig/fs/proc/array.c 2017-09-22 16:52:10.597110096 -0400 -+++ src/fs/proc/array.c 2017-09-22 16:59:40.799972178 -0400 -@@ -359,13 +359,20 @@ static inline void task_seccomp(struct s - #endif - } - -+#include "kpatch.h" - static inline void task_context_switch_counts(struct seq_file *m, - struct task_struct *p) - { -+ int *newpid; -+ - seq_printf(m, "voluntary_ctxt_switches:\t%lu\n" - "nonvoluntary_ctxt_switches:\t%lu\n", - p->nvcsw, - p->nivcsw); -+ -+ newpid = kpatch_shadow_get(p, "newpid"); -+ if (newpid) -+ seq_printf(m, "newpid:\t%d\n", *newpid); - } - - static void task_cpus_allowed(struct seq_file *m, struct task_struct *task) -diff -Nupr src.orig/kernel/exit.c src/kernel/exit.c ---- src.orig/kernel/exit.c 2017-09-22 16:52:10.506109720 -0400 -+++ src/kernel/exit.c 2017-09-22 16:59:40.799972178 -0400 -@@ -715,6 +715,7 @@ static void check_stack_usage(void) - static inline void check_stack_usage(void) {} - #endif - -+#include "kpatch.h" - void do_exit(long code) - { - struct task_struct *tsk = current; -@@ -812,6 +813,8 @@ void do_exit(long code) - check_stack_usage(); - exit_thread(); - -+ kpatch_shadow_free(tsk, "newpid"); -+ - /* - * Flush inherited counters to the parent - before the parent - * gets woken up by child-exit notifications. -diff -Nupr src.orig/kernel/fork.c src/kernel/fork.c ---- src.orig/kernel/fork.c 2017-09-22 16:52:10.504109711 -0400 -+++ src/kernel/fork.c 2017-09-22 17:00:44.938237460 -0400 -@@ -1700,6 +1700,7 @@ struct task_struct *fork_idle(int cpu) - * It copies the process, and if successful kick-starts - * it and waits for it to finish using the VM if required. - */ -+#include "kpatch.h" - long do_fork(unsigned long clone_flags, - unsigned long stack_start, - unsigned long stack_size, -@@ -1737,6 +1738,13 @@ long do_fork(unsigned long clone_flags, - if (!IS_ERR(p)) { - struct completion vfork; - struct pid *pid; -+ int *newpid; -+ static int ctr = 0; -+ -+ newpid = kpatch_shadow_alloc(p, "newpid", sizeof(*newpid), -+ GFP_KERNEL); -+ if (newpid) -+ *newpid = ctr++; - - trace_sched_process_fork(current, p); - diff --git a/test/integration/rhel-7.4/smp-locks-section.patch b/test/integration/rhel-7.4/smp-locks-section.patch deleted file mode 100644 index 6f39d53f9..000000000 --- a/test/integration/rhel-7.4/smp-locks-section.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -Nupr src.orig/drivers/tty/tty_buffer.c src/drivers/tty/tty_buffer.c ---- src.orig/drivers/tty/tty_buffer.c 2017-09-22 15:27:21.077053604 -0400 -+++ src/drivers/tty/tty_buffer.c 2017-09-22 15:27:50.542175618 -0400 -@@ -217,6 +217,10 @@ int tty_buffer_request_room(struct tty_p - /* OPTIMISATION: We could keep a per tty "zero" sized buffer to - remove this conditional if its worth it. This would be invisible - to the callers */ -+ -+ if (!size) -+ printk("kpatch-test: testing .smp_locks section changes\n"); -+ - b = buf->tail; - if (b != NULL) - left = b->size - b->used; diff --git a/test/integration/rhel-7.4/special-static-2.patch b/test/integration/rhel-7.4/special-static-2.patch deleted file mode 100644 index 146d5b514..000000000 --- a/test/integration/rhel-7.4/special-static-2.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -Nupr src.orig/arch/x86/kvm/x86.c src/arch/x86/kvm/x86.c ---- src.orig/arch/x86/kvm/x86.c 2017-09-22 15:27:20.852052672 -0400 -+++ src/arch/x86/kvm/x86.c 2017-09-22 15:27:51.744180596 -0400 -@@ -2093,12 +2093,20 @@ static void record_steal_time(struct kvm - &vcpu->arch.st.steal, sizeof(struct kvm_steal_time)); - } - -+void kpatch_kvm_x86_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch kvm x86 foo\n"); -+} -+ - int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) - { - bool pr = false; - u32 msr = msr_info->index; - u64 data = msr_info->data; - -+ kpatch_kvm_x86_foo(); -+ - switch (msr) { - case MSR_AMD64_NB_CFG: - case MSR_IA32_UCODE_REV: diff --git a/test/integration/rhel-7.4/special-static.patch b/test/integration/rhel-7.4/special-static.patch deleted file mode 100644 index 84647ec26..000000000 --- a/test/integration/rhel-7.4/special-static.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -Nupr src.orig/kernel/fork.c src/kernel/fork.c ---- src.orig/kernel/fork.c 2017-09-22 15:27:21.600055769 -0400 -+++ src/kernel/fork.c 2017-09-22 15:27:53.052186012 -0400 -@@ -1129,10 +1129,18 @@ static void posix_cpu_timers_init_group( - INIT_LIST_HEAD(&sig->cpu_timers[2]); - } - -+void kpatch_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch copy signal\n"); -+} -+ - static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) - { - struct signal_struct *sig; - -+ kpatch_foo(); -+ - if (clone_flags & CLONE_THREAD) - return 0; - diff --git a/test/integration/rhel-7.4/tracepoints-section.patch b/test/integration/rhel-7.4/tracepoints-section.patch deleted file mode 100644 index b770f9e2d..000000000 --- a/test/integration/rhel-7.4/tracepoints-section.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -Nupr src.orig/kernel/timer.c src/kernel/timer.c ---- src.orig/kernel/timer.c 2017-09-22 15:27:21.600055769 -0400 -+++ src/kernel/timer.c 2017-09-22 15:27:54.288191131 -0400 -@@ -1390,6 +1390,9 @@ static void run_timer_softirq(struct sof - { - struct tvec_base *base = __this_cpu_read(tvec_bases); - -+ if (!base) -+ printk("kpatch-test: testing __tracepoints section changes\n"); -+ - if (time_after_eq(jiffies, base->timer_jiffies)) - __run_timers(base); - } diff --git a/test/integration/rhel-7.4/warn-detect-FAIL.patch b/test/integration/rhel-7.4/warn-detect-FAIL.patch deleted file mode 100644 index 8efa78232..000000000 --- a/test/integration/rhel-7.4/warn-detect-FAIL.patch +++ /dev/null @@ -1,8 +0,0 @@ -diff -Nupr src.orig/arch/x86/kvm/x86.c src/arch/x86/kvm/x86.c ---- src.orig/arch/x86/kvm/x86.c 2017-09-22 15:27:20.852052672 -0400 -+++ src/arch/x86/kvm/x86.c 2017-09-22 15:27:55.489196104 -0400 -@@ -1,3 +1,4 @@ -+ - /* - * Kernel-based Virtual Machine driver for Linux - * diff --git a/test/integration/rhel-7.5/bug-table-section.patch b/test/integration/rhel-7.5/bug-table-section.patch deleted file mode 100644 index 71f8c1bfa..000000000 --- a/test/integration/rhel-7.5/bug-table-section.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nupr src.orig/fs/proc/proc_sysctl.c src/fs/proc/proc_sysctl.c ---- src.orig/fs/proc/proc_sysctl.c 2017-09-22 15:27:21.698056175 -0400 -+++ src/fs/proc/proc_sysctl.c 2017-09-22 15:27:21.769056469 -0400 -@@ -266,6 +266,8 @@ void sysctl_head_put(struct ctl_table_he - - static struct ctl_table_header *sysctl_head_grab(struct ctl_table_header *head) - { -+ if (jiffies == 0) -+ printk("kpatch-test: testing __bug_table section changes\n"); - BUG_ON(!head); - spin_lock(&sysctl_lock); - if (!use_table(head)) diff --git a/test/integration/rhel-7.5/cmdline-string-LOADED.test b/test/integration/rhel-7.5/cmdline-string-LOADED.test deleted file mode 100755 index a8e0a0817..000000000 --- a/test/integration/rhel-7.5/cmdline-string-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep kpatch=1 /proc/cmdline diff --git a/test/integration/rhel-7.5/cmdline-string.patch b/test/integration/rhel-7.5/cmdline-string.patch deleted file mode 100644 index 749861fc4..000000000 --- a/test/integration/rhel-7.5/cmdline-string.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nupr src.orig/fs/proc/cmdline.c src/fs/proc/cmdline.c ---- src.orig/fs/proc/cmdline.c 2017-09-22 15:27:21.698056175 -0400 -+++ src/fs/proc/cmdline.c 2017-09-22 15:27:22.955061380 -0400 -@@ -5,7 +5,7 @@ - - static int cmdline_proc_show(struct seq_file *m, void *v) - { -- seq_printf(m, "%s\n", saved_command_line); -+ seq_printf(m, "%s kpatch=1\n", saved_command_line); - return 0; - } - diff --git a/test/integration/rhel-7.5/data-new-LOADED.test b/test/integration/rhel-7.5/data-new-LOADED.test deleted file mode 100755 index 598b6bb77..000000000 --- a/test/integration/rhel-7.5/data-new-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep "kpatch: 5" /proc/meminfo diff --git a/test/integration/rhel-7.5/data-new.patch b/test/integration/rhel-7.5/data-new.patch deleted file mode 100644 index 879828cbb..000000000 --- a/test/integration/rhel-7.5/data-new.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c ---- src.orig/fs/proc/meminfo.c 2017-09-22 15:27:21.699056179 -0400 -+++ src/fs/proc/meminfo.c 2017-09-22 15:27:24.102066130 -0400 -@@ -20,6 +20,8 @@ void __attribute__((weak)) arch_report_m - { - } - -+static int foo = 5; -+ - static int meminfo_proc_show(struct seq_file *m, void *v) - { - struct sysinfo i; -@@ -106,6 +108,7 @@ static int meminfo_proc_show(struct seq_ - #ifdef CONFIG_TRANSPARENT_HUGEPAGE - "AnonHugePages: %8lu kB\n" - #endif -+ "kpatch: %d" - , - K(i.totalram), - K(i.freeram), -@@ -167,6 +170,7 @@ static int meminfo_proc_show(struct seq_ - ,K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) * - HPAGE_PMD_NR) - #endif -+ ,foo - ); - - hugetlb_report_meminfo(m); diff --git a/test/integration/rhel-7.5/data-read-mostly.patch.disabled b/test/integration/rhel-7.5/data-read-mostly.patch.disabled deleted file mode 100644 index 611662f83..000000000 --- a/test/integration/rhel-7.5/data-read-mostly.patch.disabled +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nupr src.orig/net/core/dev.c src/net/core/dev.c ---- src.orig/net/core/dev.c 2017-09-22 15:27:21.759056428 -0400 -+++ src/net/core/dev.c 2017-09-22 15:27:25.244070859 -0400 -@@ -4012,6 +4012,7 @@ ncls: - case RX_HANDLER_PASS: - break; - default: -+ printk("BUG!\n"); - BUG(); - } - } diff --git a/test/integration/rhel-7.5/fixup-section.patch b/test/integration/rhel-7.5/fixup-section.patch deleted file mode 100644 index 18d13b5cd..000000000 --- a/test/integration/rhel-7.5/fixup-section.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/fs/readdir.c b/fs/readdir.c -index febd02dfbe2d..064db7bd70d0 100644 ---- a/fs/readdir.c -+++ b/fs/readdir.c -@@ -176,6 +176,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, - goto efault; - } - dirent = buf->current_dir; -+ asm("nop"); - if (__put_user(d_ino, &dirent->d_ino)) - goto efault; - if (__put_user(reclen, &dirent->d_reclen)) diff --git a/test/integration/rhel-7.5/gcc-constprop.patch b/test/integration/rhel-7.5/gcc-constprop.patch deleted file mode 100644 index 63ba45d5c..000000000 --- a/test/integration/rhel-7.5/gcc-constprop.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -Nupr src.orig/kernel/time/timekeeping.c src/kernel/time/timekeeping.c ---- src.orig/kernel/time/timekeeping.c 2017-09-22 15:27:21.602055778 -0400 -+++ src/kernel/time/timekeeping.c 2017-09-22 15:27:27.522080292 -0400 -@@ -877,6 +877,9 @@ void do_gettimeofday(struct timeval *tv) - { - struct timespec64 now; - -+ if (!tv) -+ return; -+ - getnstimeofday64(&now); - tv->tv_sec = now.tv_sec; - tv->tv_usec = now.tv_nsec/1000; diff --git a/test/integration/rhel-7.5/gcc-isra.patch b/test/integration/rhel-7.5/gcc-isra.patch deleted file mode 100644 index a869797ee..000000000 --- a/test/integration/rhel-7.5/gcc-isra.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nupr src.orig/fs/proc/proc_sysctl.c src/fs/proc/proc_sysctl.c ---- src.orig/fs/proc/proc_sysctl.c 2017-09-22 15:27:21.698056175 -0400 -+++ src/fs/proc/proc_sysctl.c 2017-09-22 15:27:28.670085046 -0400 -@@ -24,6 +24,7 @@ void proc_sys_poll_notify(struct ctl_tab - if (!poll) - return; - -+ printk("kpatch-test: testing gcc .isra function name mangling\n"); - atomic_inc(&poll->event); - wake_up_interruptible(&poll->wait); - } diff --git a/test/integration/rhel-7.5/gcc-mangled-3.patch b/test/integration/rhel-7.5/gcc-mangled-3.patch deleted file mode 100644 index 582868048..000000000 --- a/test/integration/rhel-7.5/gcc-mangled-3.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -Nupr src.orig/mm/slub.c src/mm/slub.c ---- src.orig/mm/slub.c 2017-09-22 15:27:21.618055844 -0400 -+++ src/mm/slub.c 2017-09-22 15:27:29.830089850 -0400 -@@ -5528,6 +5528,9 @@ void get_slabinfo(struct kmem_cache *s, - unsigned long nr_free = 0; - int node; - -+ if (!jiffies) -+ printk("slabinfo\n"); -+ - for_each_online_node(node) { - struct kmem_cache_node *n = get_node(s, node); - diff --git a/test/integration/rhel-7.5/gcc-static-local-var-2.patch b/test/integration/rhel-7.5/gcc-static-local-var-2.patch deleted file mode 100644 index 4f653d7e5..000000000 --- a/test/integration/rhel-7.5/gcc-static-local-var-2.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -Nupr src.orig/mm/mmap.c src/mm/mmap.c ---- src.orig/mm/mmap.c 2017-09-22 15:27:21.618055844 -0400 -+++ src/mm/mmap.c 2017-09-22 15:27:31.024094794 -0400 -@@ -1687,6 +1688,9 @@ unsigned long mmap_region(struct file *f - struct rb_node **rb_link, *rb_parent; - unsigned long charged = 0; - -+ if (!jiffies) -+ printk("kpatch mmap foo\n"); -+ - /* Check against address space limit. */ - if (!may_expand_vm(mm, len >> PAGE_SHIFT)) { - unsigned long nr_pages; diff --git a/test/integration/rhel-7.5/gcc-static-local-var-3.patch b/test/integration/rhel-7.5/gcc-static-local-var-3.patch deleted file mode 100644 index d87677b5d..000000000 --- a/test/integration/rhel-7.5/gcc-static-local-var-3.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -Nupr src.orig/kernel/sys.c src/kernel/sys.c ---- src.orig/kernel/sys.c 2017-09-22 15:27:21.601055773 -0400 -+++ src/kernel/sys.c 2017-09-22 15:27:32.170099540 -0400 -@@ -554,8 +554,15 @@ SYSCALL_DEFINE4(reboot, int, magic1, int - return ret; - } - -+void kpatch_bar(void) -+{ -+ if (!jiffies) -+ printk("kpatch_foo\n"); -+} -+ - static void deferred_cad(struct work_struct *dummy) - { -+ kpatch_bar(); - kernel_restart(NULL); - } - diff --git a/test/integration/rhel-7.5/gcc-static-local-var-4.patch b/test/integration/rhel-7.5/gcc-static-local-var-4.patch deleted file mode 100644 index e22ead770..000000000 --- a/test/integration/rhel-7.5/gcc-static-local-var-4.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -Nupr src.orig/fs/aio.c src/fs/aio.c ---- src.orig/fs/aio.c 2017-09-22 15:27:21.702056192 -0400 -+++ src/fs/aio.c 2017-09-22 15:27:33.299104215 -0400 -@@ -219,9 +219,16 @@ static int __init aio_setup(void) - } - __initcall(aio_setup); - -+void kpatch_aio_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch aio foo\n"); -+} -+ - static void put_aio_ring_file(struct kioctx *ctx) - { - struct file *aio_ring_file = ctx->aio_ring_file; -+ kpatch_aio_foo(); - if (aio_ring_file) { - truncate_setsize(aio_ring_file->f_inode, 0); - diff --git a/test/integration/rhel-7.5/gcc-static-local-var-4.test b/test/integration/rhel-7.5/gcc-static-local-var-4.test deleted file mode 100755 index e085f9345..000000000 --- a/test/integration/rhel-7.5/gcc-static-local-var-4.test +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -set -o pipefail -if ! $(eu-readelf --wide --symbols test-gcc-static-local-var-4.ko | awk '$NF == "free_ioctx" { exit 1 }'); then - exit 1 -else - exit 0 -fi diff --git a/test/integration/rhel-7.5/gcc-static-local-var-5.patch b/test/integration/rhel-7.5/gcc-static-local-var-5.patch deleted file mode 100644 index 540affaf8..000000000 --- a/test/integration/rhel-7.5/gcc-static-local-var-5.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff -Nupr src.orig/kernel/audit.c src/kernel/audit.c ---- src.orig/kernel/audit.c 2017-09-22 15:27:21.602055778 -0400 -+++ src/kernel/audit.c 2017-09-22 15:27:34.429108894 -0400 -@@ -205,6 +205,12 @@ void audit_panic(const char *message) - } - } - -+void kpatch_audit_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch audit foo\n"); -+} -+ - static inline int audit_rate_check(void) - { - static unsigned long last_check = 0; -@@ -215,6 +221,7 @@ static inline int audit_rate_check(void) - unsigned long elapsed; - int retval = 0; - -+ kpatch_audit_foo(); - if (!audit_rate_limit) return 1; - - spin_lock_irqsave(&lock, flags); -@@ -234,6 +241,11 @@ static inline int audit_rate_check(void) - return retval; - } - -+noinline void kpatch_audit_check(void) -+{ -+ audit_rate_check(); -+} -+ - /** - * audit_log_lost - conditionally log lost audit message event - * @message: the message stating reason for lost audit message -@@ -282,6 +294,8 @@ static int audit_log_config_change(char - struct audit_buffer *ab; - int rc = 0; - -+ kpatch_audit_check(); -+ - ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE); - if (unlikely(!ab)) - return rc; diff --git a/test/integration/rhel-7.5/gcc-static-local-var-6.patch b/test/integration/rhel-7.5/gcc-static-local-var-6.patch deleted file mode 100644 index bd5493c0b..000000000 --- a/test/integration/rhel-7.5/gcc-static-local-var-6.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c -index a9d587a..23336ed 100644 ---- a/net/ipv6/netfilter.c -+++ b/net/ipv6/netfilter.c -@@ -106,6 +106,8 @@ static int nf_ip6_reroute(struct sk_buff *skb, - return 0; - } - -+#include "kpatch-macros.h" -+ - static int nf_ip6_route(struct net *net, struct dst_entry **dst, - struct flowi *fl, bool strict) - { -@@ -119,6 +121,9 @@ static int nf_ip6_route(struct net *net, struct dst_entry **dst, - struct dst_entry *result; - int err; - -+ if (!jiffies) -+ printk("kpatch nf_ip6_route foo\n"); -+ - result = ip6_route_output(net, sk, &fl->u.ip6); - err = result->error; - if (err) diff --git a/test/integration/rhel-7.5/gcc-static-local-var.patch b/test/integration/rhel-7.5/gcc-static-local-var.patch deleted file mode 100644 index 2dab9dbbf..000000000 --- a/test/integration/rhel-7.5/gcc-static-local-var.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -Nupr src.orig/arch/x86/kernel/ldt.c src/arch/x86/kernel/ldt.c ---- src.orig/arch/x86/kernel/ldt.c 2017-09-22 15:27:20.847052651 -0400 -+++ src/arch/x86/kernel/ldt.c 2017-09-22 15:27:35.573113632 -0400 -@@ -98,6 +98,12 @@ static inline int copy_ldt(mm_context_t - return 0; - } - -+void hi_there(void) -+{ -+ if (!jiffies) -+ printk("hi there\n"); -+} -+ - /* - * we do not have to muck with descriptors here, that is - * done in switch_mm() as needed. -@@ -107,6 +113,8 @@ int init_new_context(struct task_struct - struct mm_struct *old_mm; - int retval = 0; - -+ hi_there(); -+ - mutex_init(&mm->context.lock); - mm->context.size = 0; - old_mm = current->mm; diff --git a/test/integration/rhel-7.5/macro-callbacks.patch b/test/integration/rhel-7.5/macro-callbacks.patch deleted file mode 100644 index 0d6831b66..000000000 --- a/test/integration/rhel-7.5/macro-callbacks.patch +++ /dev/null @@ -1,160 +0,0 @@ -kpatch/livepatch callback test patch: - - vmlinux - pcspkr (mod) - joydev (mod) - -Note: update joydev's pre-patch callback to return -ENODEV to test failure path - ---- src.old/fs/aio.c 2018-02-26 11:07:51.522610407 -0500 -+++ src/fs/aio.c 2018-03-05 11:17:21.560015449 -0500 -@@ -42,6 +42,50 @@ - #include - #include - -+#include -+#include "kpatch-macros.h" -+ -+static const char *const module_state[] = { -+ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", -+ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", -+ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", -+ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", -+}; -+ -+static void callback_info(const char *callback, patch_object *obj) -+{ -+ if (obj->mod) -+ pr_info("%s: %s -> %s\n", callback, obj->mod->name, -+ module_state[obj->mod->state]); -+ else -+ pr_info("%s: vmlinux\n", callback); -+} -+ -+static int pre_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+ return 0; -+} -+KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); -+ -+static void post_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_PATCH_CALLBACK(post_patch_callback); -+ -+static void pre_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); -+ -+static void post_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); -+ - #define AIO_RING_MAGIC 0xa10a10a1 - #define AIO_RING_COMPAT_FEATURES 1 - #define AIO_RING_INCOMPAT_FEATURES 0 ---- src.old/drivers/input/joydev.c 2018-02-26 11:07:49.470610407 -0500 -+++ src/drivers/input/joydev.c 2018-03-05 11:18:13.998015449 -0500 -@@ -954,3 +954,47 @@ static void __exit joydev_exit(void) - - module_init(joydev_init); - module_exit(joydev_exit); -+ -+#include -+#include "kpatch-macros.h" -+ -+static const char *const module_state[] = { -+ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", -+ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", -+ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", -+ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", -+}; -+ -+static void callback_info(const char *callback, patch_object *obj) -+{ -+ if (obj->mod) -+ pr_info("%s: %s -> %s\n", callback, obj->mod->name, -+ module_state[obj->mod->state]); -+ else -+ pr_info("%s: vmlinux\n", callback); -+} -+ -+static int pre_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+ return 0; /* return -ENODEV; */ -+} -+KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); -+ -+static void post_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_PATCH_CALLBACK(post_patch_callback); -+ -+static void pre_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); -+ -+static void post_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); ---- src.old/drivers/input/misc/pcspkr.c 2018-02-26 11:07:49.477610407 -0500 -+++ src/drivers/input/misc/pcspkr.c 2018-03-05 11:18:23.411015449 -0500 -@@ -136,3 +136,46 @@ static struct platform_driver pcspkr_pla - }; - module_platform_driver(pcspkr_platform_driver); - -+#include -+#include "kpatch-macros.h" -+ -+static const char *const module_state[] = { -+ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", -+ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", -+ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", -+ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", -+}; -+ -+static void callback_info(const char *callback, patch_object *obj) -+{ -+ if (obj->mod) -+ pr_info("%s: %s -> %s\n", callback, obj->mod->name, -+ module_state[obj->mod->state]); -+ else -+ pr_info("%s: vmlinux\n", callback); -+} -+ -+static int pre_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+ return 0; -+} -+KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); -+ -+static void post_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_PATCH_CALLBACK(post_patch_callback); -+ -+static void pre_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); -+ -+static void post_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); diff --git a/test/integration/rhel-7.5/macro-printk.patch b/test/integration/rhel-7.5/macro-printk.patch deleted file mode 100644 index 9f591f4c0..000000000 --- a/test/integration/rhel-7.5/macro-printk.patch +++ /dev/null @@ -1,147 +0,0 @@ -diff -Nupr src.orig/net/ipv4/fib_frontend.c src/net/ipv4/fib_frontend.c ---- src.orig/net/ipv4/fib_frontend.c 2017-09-22 16:52:10.646110299 -0400 -+++ src/net/ipv4/fib_frontend.c 2017-09-22 16:55:14.395870305 -0400 -@@ -633,6 +633,7 @@ errout: - return err; - } - -+#include "kpatch-macros.h" - static int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh) - { - struct net *net = sock_net(skb->sk); -@@ -651,6 +652,7 @@ static int inet_rtm_newroute(struct sk_b - } - - err = fib_table_insert(net, tb, &cfg); -+ KPATCH_PRINTK("[inet_rtm_newroute]: err is %d\n", err); - errout: - return err; - } -diff -Nupr src.orig/net/ipv4/fib_semantics.c src/net/ipv4/fib_semantics.c ---- src.orig/net/ipv4/fib_semantics.c 2017-09-22 16:52:10.645110295 -0400 -+++ src/net/ipv4/fib_semantics.c 2017-09-22 16:54:05.175584004 -0400 -@@ -925,6 +925,7 @@ fib_convert_metrics(struct fib_info *fi, - return 0; - } - -+#include "kpatch-macros.h" - struct fib_info *fib_create_info(struct fib_config *cfg) - { - int err; -@@ -949,6 +950,7 @@ struct fib_info *fib_create_info(struct - #endif - - err = -ENOBUFS; -+ KPATCH_PRINTK("[fib_create_info]: create error err is %d\n",err); - if (fib_info_cnt >= fib_info_hash_size) { - unsigned int new_size = fib_info_hash_size << 1; - struct hlist_head *new_info_hash; -@@ -969,6 +971,7 @@ struct fib_info *fib_create_info(struct - if (!fib_info_hash_size) - goto failure; - } -+ KPATCH_PRINTK("[fib_create_info]: 2 create error err is %d\n",err); - - fi = kzalloc(sizeof(*fi)+nhs*sizeof(struct fib_nh), GFP_KERNEL); - if (fi == NULL) -@@ -980,6 +983,7 @@ struct fib_info *fib_create_info(struct - } else - fi->fib_metrics = (u32 *) dst_default_metrics; - fib_info_cnt++; -+ KPATCH_PRINTK("[fib_create_info]: 3 create error err is %d\n",err); - - fi->fib_net = net; - fi->fib_protocol = cfg->fc_protocol; -@@ -996,8 +1000,10 @@ struct fib_info *fib_create_info(struct - if (!nexthop_nh->nh_pcpu_rth_output) - goto failure; - } endfor_nexthops(fi) -+ KPATCH_PRINTK("[fib_create_info]: 4 create error err is %d\n",err); - - err = fib_convert_metrics(fi, cfg); -+ KPATCH_PRINTK("[fib_create_info]: 5 create error err is %d\n",err); - if (err) - goto failure; - -@@ -1048,6 +1054,7 @@ struct fib_info *fib_create_info(struct - nh->nh_weight = 1; - #endif - } -+ KPATCH_PRINTK("[fib_create_info]: 6 create error err is %d\n",err); - - if (fib_props[cfg->fc_type].error) { - if (cfg->fc_gw || cfg->fc_oif || cfg->fc_mp) -@@ -1065,6 +1072,7 @@ struct fib_info *fib_create_info(struct - goto err_inval; - } - } -+ KPATCH_PRINTK("[fib_create_info]: 7 create error err is %d\n",err); - - if (cfg->fc_scope > RT_SCOPE_HOST) - goto err_inval; -@@ -1087,6 +1095,7 @@ struct fib_info *fib_create_info(struct - goto failure; - } endfor_nexthops(fi) - } -+ KPATCH_PRINTK("[fib_create_info]: 8 create error err is %d\n",err); - - if (fi->fib_prefsrc) { - if (cfg->fc_type != RTN_LOCAL || !cfg->fc_dst || -@@ -1099,6 +1108,7 @@ struct fib_info *fib_create_info(struct - fib_info_update_nh_saddr(net, nexthop_nh); - fib_add_weight(fi, nexthop_nh); - } endfor_nexthops(fi) -+ KPATCH_PRINTK("[fib_create_info]: 9 create error err is %d\n",err); - - fib_rebalance(fi); - -@@ -1110,6 +1120,7 @@ link_it: - ofi->fib_treeref++; - return ofi; - } -+ KPATCH_PRINTK("[fib_create_info]: 10 create error err is %d\n",err); - - fi->fib_treeref++; - atomic_inc(&fi->fib_clntref); -@@ -1133,6 +1144,7 @@ link_it: - hlist_add_head(&nexthop_nh->nh_hash, head); - } endfor_nexthops(fi) - spin_unlock_bh(&fib_info_lock); -+ KPATCH_PRINTK("[fib_create_info]: 11 create error err is %d\n",err); - return fi; - - err_inval: -@@ -1143,6 +1155,7 @@ failure: - fi->fib_dead = 1; - free_fib_info(fi); - } -+ KPATCH_PRINTK("[fib_create_info]: 12 create error err is %d\n",err); - - return ERR_PTR(err); - } -diff -Nupr src.orig/net/ipv4/fib_trie.c src/net/ipv4/fib_trie.c ---- src.orig/net/ipv4/fib_trie.c 2017-09-22 16:52:10.645110295 -0400 -+++ src/net/ipv4/fib_trie.c 2017-09-22 16:55:39.940975963 -0400 -@@ -1191,6 +1191,7 @@ static int fib_insert_alias(struct trie - } - - /* Caller must hold RTNL. */ -+#include "kpatch-macros.h" - int fib_table_insert(struct net *net, struct fib_table *tb, - struct fib_config *cfg) - { -@@ -1216,11 +1217,14 @@ int fib_table_insert(struct net *net, st - if ((plen < KEYLENGTH) && (key << plen)) - return -EINVAL; - -+ KPATCH_PRINTK("[fib_table_insert]: start\n"); - fi = fib_create_info(cfg); - if (IS_ERR(fi)) { - err = PTR_ERR(fi); -+ KPATCH_PRINTK("[fib_table_insert]: create error err is %d\n",err); - goto err; - } -+ KPATCH_PRINTK("[fib_table_insert]: cross\n"); - - l = fib_find_node(t, &tp, key); - fa = l ? fib_find_alias(&l->leaf, slen, tos, fi->fib_priority) : NULL; diff --git a/test/integration/rhel-7.5/meminfo-init-FAIL.patch b/test/integration/rhel-7.5/meminfo-init-FAIL.patch deleted file mode 100644 index 5df52251d..000000000 --- a/test/integration/rhel-7.5/meminfo-init-FAIL.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c ---- src.orig/fs/proc/meminfo.c 2017-09-22 15:27:21.699056179 -0400 -+++ src/fs/proc/meminfo.c 2017-09-22 15:27:40.130132502 -0400 -@@ -191,6 +191,7 @@ static const struct file_operations memi - - static int __init proc_meminfo_init(void) - { -+ printk("a\n"); - proc_create("meminfo", 0, NULL, &meminfo_proc_fops); - return 0; - } diff --git a/test/integration/rhel-7.5/meminfo-init2-FAIL.patch b/test/integration/rhel-7.5/meminfo-init2-FAIL.patch deleted file mode 100644 index c030f6190..000000000 --- a/test/integration/rhel-7.5/meminfo-init2-FAIL.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c ---- src.orig/fs/proc/meminfo.c 2017-09-22 15:27:21.699056179 -0400 -+++ src/fs/proc/meminfo.c 2017-09-22 15:27:38.972127707 -0400 -@@ -30,6 +30,7 @@ static int meminfo_proc_show(struct seq_ - unsigned long pages[NR_LRU_LISTS]; - int lru; - -+ printk("a\n"); - /* - * display in kilobytes. - */ -@@ -191,6 +192,7 @@ static const struct file_operations memi - - static int __init proc_meminfo_init(void) - { -+ printk("a\n"); - proc_create("meminfo", 0, NULL, &meminfo_proc_fops); - return 0; - } diff --git a/test/integration/rhel-7.5/meminfo-string-LOADED.test b/test/integration/rhel-7.5/meminfo-string-LOADED.test deleted file mode 100755 index 10dc20b3d..000000000 --- a/test/integration/rhel-7.5/meminfo-string-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep VMALLOCCHUNK /proc/meminfo diff --git a/test/integration/rhel-7.5/meminfo-string.patch b/test/integration/rhel-7.5/meminfo-string.patch deleted file mode 100644 index afdc5d016..000000000 --- a/test/integration/rhel-7.5/meminfo-string.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c ---- src.orig/fs/proc/meminfo.c 2017-09-22 15:27:21.699056179 -0400 -+++ src/fs/proc/meminfo.c 2017-09-22 15:27:41.274137239 -0400 -@@ -99,7 +99,7 @@ static int meminfo_proc_show(struct seq_ - "Committed_AS: %8lu kB\n" - "VmallocTotal: %8lu kB\n" - "VmallocUsed: %8lu kB\n" -- "VmallocChunk: %8lu kB\n" -+ "VMALLOCCHUNK: %8lu kB\n" - #ifdef CONFIG_MEMORY_FAILURE - "HardwareCorrupted: %5lu kB\n" - #endif diff --git a/test/integration/rhel-7.5/module-call-external.patch b/test/integration/rhel-7.5/module-call-external.patch deleted file mode 100644 index 754d72597..000000000 --- a/test/integration/rhel-7.5/module-call-external.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff -Nupr src.orig/fs/nfsd/export.c src/fs/nfsd/export.c ---- src.orig/fs/nfsd/export.c 2017-09-22 15:27:21.705056204 -0400 -+++ src/fs/nfsd/export.c 2017-09-22 15:27:42.411141948 -0400 -@@ -1184,6 +1184,8 @@ static void exp_flags(struct seq_file *m - } - } - -+extern char *kpatch_string(void); -+ - static int e_show(struct seq_file *m, void *p) - { - struct cache_head *cp = p; -@@ -1193,6 +1195,7 @@ static int e_show(struct seq_file *m, vo - if (p == SEQ_START_TOKEN) { - seq_puts(m, "# Version 1.1\n"); - seq_puts(m, "# Path Client(Flags) # IPs\n"); -+ seq_puts(m, kpatch_string()); - return 0; - } - -diff -Nupr src.orig/net/netlink/af_netlink.c src/net/netlink/af_netlink.c ---- src.orig/net/netlink/af_netlink.c 2017-09-22 15:27:21.754056407 -0400 -+++ src/net/netlink/af_netlink.c 2017-09-22 15:27:42.412141952 -0400 -@@ -3260,4 +3260,9 @@ panic: - panic("netlink_init: Cannot allocate nl_table\n"); - } - -+char *kpatch_string(void) -+{ -+ return "# kpatch\n"; -+} -+ - core_initcall(netlink_proto_init); diff --git a/test/integration/rhel-7.5/module-kvm-fixup.patch b/test/integration/rhel-7.5/module-kvm-fixup.patch deleted file mode 100644 index 174ad6564..000000000 --- a/test/integration/rhel-7.5/module-kvm-fixup.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nupr src.orig/arch/x86/kvm/vmx.c src/arch/x86/kvm/vmx.c ---- src.orig/arch/x86/kvm/vmx.c 2017-09-22 15:27:20.853052676 -0400 -+++ src/arch/x86/kvm/vmx.c 2017-09-22 15:27:43.583146801 -0400 -@@ -10597,6 +10597,8 @@ static int vmx_check_intercept(struct kv - struct x86_instruction_info *info, - enum x86_intercept_stage stage) - { -+ if (!jiffies) -+ printk("kpatch vmx_check_intercept\n"); - return X86EMUL_CONTINUE; - } - diff --git a/test/integration/rhel-7.5/module-shadow.patch.disabled b/test/integration/rhel-7.5/module-shadow.patch.disabled deleted file mode 100644 index e4821c98a..000000000 --- a/test/integration/rhel-7.5/module-shadow.patch.disabled +++ /dev/null @@ -1,25 +0,0 @@ -Index: src/arch/x86/kvm/vmx.c -=================================================================== ---- src.orig/arch/x86/kvm/vmx.c -+++ src/arch/x86/kvm/vmx.c -@@ -11168,10 +11168,20 @@ static void vmx_leave_nested(struct kvm_ - * It should only be called before L2 actually succeeded to run, and when - * vmcs01 is current (it doesn't leave_guest_mode() or switch vmcss). - */ -+#include - static void nested_vmx_entry_failure(struct kvm_vcpu *vcpu, - struct vmcs12 *vmcs12, - u32 reason, unsigned long qualification) - { -+ int *kpatch; -+ -+ kpatch = klp_shadow_alloc(vcpu, 0, NULL, sizeof(*kpatch), -+ GFP_KERNEL); -+ if (kpatch) { -+ klp_shadow_get(vcpu, 0); -+ klp_shadow_free(vcpu, 0); -+ } -+ - load_vmcs12_host_state(vcpu, vmcs12); - vmcs12->vm_exit_reason = reason | VMX_EXIT_REASONS_FAILED_VMENTRY; - vmcs12->exit_qualification = qualification; diff --git a/test/integration/rhel-7.5/multiple.test b/test/integration/rhel-7.5/multiple.test deleted file mode 100755 index 7e4b3525c..000000000 --- a/test/integration/rhel-7.5/multiple.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -SCRIPTDIR="$(readlink -f $(dirname $(type -p $0)))" - -declare -a blacklist=(meminfo-string-LOADED.test) - -source ${SCRIPTDIR}/../common/multiple.template diff --git a/test/integration/rhel-7.5/new-function.patch b/test/integration/rhel-7.5/new-function.patch deleted file mode 100644 index bef6803ac..000000000 --- a/test/integration/rhel-7.5/new-function.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -Nupr src.orig/drivers/tty/n_tty.c src/drivers/tty/n_tty.c ---- src.orig/drivers/tty/n_tty.c 2017-09-22 15:27:21.084053633 -0400 -+++ src/drivers/tty/n_tty.c 2017-09-22 15:27:45.888156346 -0400 -@@ -2016,7 +2016,7 @@ do_it_again: - * lock themselves) - */ - --static ssize_t n_tty_write(struct tty_struct *tty, struct file *file, -+static ssize_t noinline kpatch_n_tty_write(struct tty_struct *tty, struct file *file, - const unsigned char *buf, size_t nr) - { - const unsigned char *b = buf; -@@ -2098,6 +2098,12 @@ break_out: - return (b - buf) ? b - buf : retval; - } - -+static ssize_t __attribute__((optimize("-fno-optimize-sibling-calls"))) n_tty_write(struct tty_struct *tty, struct file *file, -+ const unsigned char *buf, size_t nr) -+{ -+ return kpatch_n_tty_write(tty, file, buf, nr); -+} -+ - /** - * n_tty_poll - poll method for N_TTY - * @tty: terminal device diff --git a/test/integration/rhel-7.5/new-globals.patch b/test/integration/rhel-7.5/new-globals.patch deleted file mode 100644 index 3d9d34940..000000000 --- a/test/integration/rhel-7.5/new-globals.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff -Nupr src.orig/fs/proc/cmdline.c src/fs/proc/cmdline.c ---- src.orig/fs/proc/cmdline.c 2017-09-22 15:27:21.698056175 -0400 -+++ src/fs/proc/cmdline.c 2017-09-22 15:27:47.028161067 -0400 -@@ -27,3 +27,10 @@ static int __init proc_cmdline_init(void - return 0; - } - module_init(proc_cmdline_init); -+ -+#include -+void kpatch_print_message(void) -+{ -+ if (!jiffies) -+ printk("hello there!\n"); -+} -diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c ---- src.orig/fs/proc/meminfo.c 2017-09-22 15:27:21.699056179 -0400 -+++ src/fs/proc/meminfo.c 2017-09-22 15:27:47.029161071 -0400 -@@ -16,6 +16,8 @@ - #include - #include "internal.h" - -+void kpatch_print_message(void); -+ - void __attribute__((weak)) arch_report_meminfo(struct seq_file *m) - { - } -@@ -53,6 +55,7 @@ static int meminfo_proc_show(struct seq_ - /* - * Tagged format, for easy grepping and expansion. - */ -+ kpatch_print_message(); - seq_printf(m, - "MemTotal: %8lu kB\n" - "MemFree: %8lu kB\n" diff --git a/test/integration/rhel-7.5/parainstructions-section.patch b/test/integration/rhel-7.5/parainstructions-section.patch deleted file mode 100644 index 809dce4b9..000000000 --- a/test/integration/rhel-7.5/parainstructions-section.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nupr src.orig/fs/proc/generic.c src/fs/proc/generic.c ---- src.orig/fs/proc/generic.c 2017-09-22 15:27:21.698056175 -0400 -+++ src/fs/proc/generic.c 2017-09-22 15:27:48.190165879 -0400 -@@ -194,6 +194,7 @@ int proc_alloc_inum(unsigned int *inum) - unsigned int i; - int error; - -+ printk("kpatch-test: testing change to .parainstructions section\n"); - retry: - if (!ida_pre_get(&proc_inum_ida, GFP_KERNEL)) - return -ENOMEM; diff --git a/test/integration/rhel-7.5/replace-section-references.patch b/test/integration/rhel-7.5/replace-section-references.patch deleted file mode 100644 index e41bba929..000000000 --- a/test/integration/rhel-7.5/replace-section-references.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nupr src.orig/arch/x86/kvm/x86.c src/arch/x86/kvm/x86.c ---- src.orig/arch/x86/kvm/x86.c 2017-09-22 15:27:20.852052672 -0400 -+++ src/arch/x86/kvm/x86.c 2017-09-22 15:27:49.362170732 -0400 -@@ -248,6 +248,8 @@ static void shared_msr_update(unsigned s - - void kvm_define_shared_msr(unsigned slot, u32 msr) - { -+ if (!jiffies) -+ printk("kpatch kvm define shared msr\n"); - BUG_ON(slot >= KVM_NR_SHARED_MSRS); - shared_msrs_global.msrs[slot] = msr; - if (slot >= shared_msrs_global.nr) diff --git a/test/integration/rhel-7.5/shadow-newpid-LOADED.test b/test/integration/rhel-7.5/shadow-newpid-LOADED.test deleted file mode 100755 index c07d11205..000000000 --- a/test/integration/rhel-7.5/shadow-newpid-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep -q newpid: /proc/$$/status diff --git a/test/integration/rhel-7.5/shadow-newpid.patch b/test/integration/rhel-7.5/shadow-newpid.patch deleted file mode 100644 index ff2019cab..000000000 --- a/test/integration/rhel-7.5/shadow-newpid.patch +++ /dev/null @@ -1,72 +0,0 @@ -Index: src/fs/proc/array.c -=================================================================== ---- src.orig/fs/proc/array.c -+++ src/fs/proc/array.c -@@ -394,13 +394,20 @@ static inline void task_seccomp(struct s - seq_putc(m, '\n'); - } - -+#include - static inline void task_context_switch_counts(struct seq_file *m, - struct task_struct *p) - { -+ int *newpid; -+ - seq_printf(m, "voluntary_ctxt_switches:\t%lu\n" - "nonvoluntary_ctxt_switches:\t%lu\n", - p->nvcsw, - p->nivcsw); -+ -+ newpid = klp_shadow_get(p, 0); -+ if (newpid) -+ seq_printf(m, "newpid:\t%d\n", *newpid); - } - - static void task_cpus_allowed(struct seq_file *m, struct task_struct *task) -Index: src/kernel/exit.c -=================================================================== ---- src.orig/kernel/exit.c -+++ src/kernel/exit.c -@@ -715,6 +715,7 @@ static void check_stack_usage(void) - static inline void check_stack_usage(void) {} - #endif - -+#include - void do_exit(long code) - { - struct task_struct *tsk = current; -@@ -812,6 +813,8 @@ void do_exit(long code) - check_stack_usage(); - exit_thread(); - -+ klp_shadow_free(tsk, 0); -+ - /* - * Flush inherited counters to the parent - before the parent - * gets woken up by child-exit notifications. -Index: src/kernel/fork.c -=================================================================== ---- src.orig/kernel/fork.c -+++ src/kernel/fork.c -@@ -1751,6 +1751,7 @@ struct task_struct *fork_idle(int cpu) - * It copies the process, and if successful kick-starts - * it and waits for it to finish using the VM if required. - */ -+#include - long do_fork(unsigned long clone_flags, - unsigned long stack_start, - unsigned long stack_size, -@@ -1788,6 +1789,13 @@ long do_fork(unsigned long clone_flags, - if (!IS_ERR(p)) { - struct completion vfork; - struct pid *pid; -+ int *newpid; -+ static int ctr = 0; -+ -+ newpid = klp_shadow_get_or_alloc(p, 0, NULL, sizeof(*newpid), -+ GFP_KERNEL); -+ if (newpid) -+ *newpid = ctr++; - - trace_sched_process_fork(current, p); - diff --git a/test/integration/rhel-7.5/smp-locks-section.patch b/test/integration/rhel-7.5/smp-locks-section.patch deleted file mode 100644 index 6f39d53f9..000000000 --- a/test/integration/rhel-7.5/smp-locks-section.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -Nupr src.orig/drivers/tty/tty_buffer.c src/drivers/tty/tty_buffer.c ---- src.orig/drivers/tty/tty_buffer.c 2017-09-22 15:27:21.077053604 -0400 -+++ src/drivers/tty/tty_buffer.c 2017-09-22 15:27:50.542175618 -0400 -@@ -217,6 +217,10 @@ int tty_buffer_request_room(struct tty_p - /* OPTIMISATION: We could keep a per tty "zero" sized buffer to - remove this conditional if its worth it. This would be invisible - to the callers */ -+ -+ if (!size) -+ printk("kpatch-test: testing .smp_locks section changes\n"); -+ - b = buf->tail; - if (b != NULL) - left = b->size - b->used; diff --git a/test/integration/rhel-7.5/special-static-2.patch b/test/integration/rhel-7.5/special-static-2.patch deleted file mode 100644 index 146d5b514..000000000 --- a/test/integration/rhel-7.5/special-static-2.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -Nupr src.orig/arch/x86/kvm/x86.c src/arch/x86/kvm/x86.c ---- src.orig/arch/x86/kvm/x86.c 2017-09-22 15:27:20.852052672 -0400 -+++ src/arch/x86/kvm/x86.c 2017-09-22 15:27:51.744180596 -0400 -@@ -2093,12 +2093,20 @@ static void record_steal_time(struct kvm - &vcpu->arch.st.steal, sizeof(struct kvm_steal_time)); - } - -+void kpatch_kvm_x86_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch kvm x86 foo\n"); -+} -+ - int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) - { - bool pr = false; - u32 msr = msr_info->index; - u64 data = msr_info->data; - -+ kpatch_kvm_x86_foo(); -+ - switch (msr) { - case MSR_AMD64_NB_CFG: - case MSR_IA32_UCODE_REV: diff --git a/test/integration/rhel-7.5/special-static.patch b/test/integration/rhel-7.5/special-static.patch deleted file mode 100644 index 84647ec26..000000000 --- a/test/integration/rhel-7.5/special-static.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -Nupr src.orig/kernel/fork.c src/kernel/fork.c ---- src.orig/kernel/fork.c 2017-09-22 15:27:21.600055769 -0400 -+++ src/kernel/fork.c 2017-09-22 15:27:53.052186012 -0400 -@@ -1129,10 +1129,18 @@ static void posix_cpu_timers_init_group( - INIT_LIST_HEAD(&sig->cpu_timers[2]); - } - -+void kpatch_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch copy signal\n"); -+} -+ - static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) - { - struct signal_struct *sig; - -+ kpatch_foo(); -+ - if (clone_flags & CLONE_THREAD) - return 0; - diff --git a/test/integration/rhel-7.5/tracepoints-section.patch b/test/integration/rhel-7.5/tracepoints-section.patch deleted file mode 100644 index b770f9e2d..000000000 --- a/test/integration/rhel-7.5/tracepoints-section.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -Nupr src.orig/kernel/timer.c src/kernel/timer.c ---- src.orig/kernel/timer.c 2017-09-22 15:27:21.600055769 -0400 -+++ src/kernel/timer.c 2017-09-22 15:27:54.288191131 -0400 -@@ -1390,6 +1390,9 @@ static void run_timer_softirq(struct sof - { - struct tvec_base *base = __this_cpu_read(tvec_bases); - -+ if (!base) -+ printk("kpatch-test: testing __tracepoints section changes\n"); -+ - if (time_after_eq(jiffies, base->timer_jiffies)) - __run_timers(base); - } diff --git a/test/integration/rhel-7.5/warn-detect-FAIL.patch b/test/integration/rhel-7.5/warn-detect-FAIL.patch deleted file mode 100644 index 8efa78232..000000000 --- a/test/integration/rhel-7.5/warn-detect-FAIL.patch +++ /dev/null @@ -1,8 +0,0 @@ -diff -Nupr src.orig/arch/x86/kvm/x86.c src/arch/x86/kvm/x86.c ---- src.orig/arch/x86/kvm/x86.c 2017-09-22 15:27:20.852052672 -0400 -+++ src/arch/x86/kvm/x86.c 2017-09-22 15:27:55.489196104 -0400 -@@ -1,3 +1,4 @@ -+ - /* - * Kernel-based Virtual Machine driver for Linux - * diff --git a/test/integration/rhel-7.6/bug-table-section.patch b/test/integration/rhel-7.6/bug-table-section.patch deleted file mode 100644 index f75e39894..000000000 --- a/test/integration/rhel-7.6/bug-table-section.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: kernel-rhel7/fs/proc/proc_sysctl.c -=================================================================== ---- kernel-rhel7.orig/fs/proc/proc_sysctl.c -+++ kernel-rhel7/fs/proc/proc_sysctl.c -@@ -301,6 +301,8 @@ void sysctl_head_put(struct ctl_table_he - - static struct ctl_table_header *sysctl_head_grab(struct ctl_table_header *head) - { -+ if (jiffies == 0) -+ printk("kpatch-test: testing __bug_table section changes\n"); - BUG_ON(!head); - spin_lock(&sysctl_lock); - if (!use_table(head)) diff --git a/test/integration/rhel-7.6/cmdline-string-LOADED.test b/test/integration/rhel-7.6/cmdline-string-LOADED.test deleted file mode 100755 index a8e0a0817..000000000 --- a/test/integration/rhel-7.6/cmdline-string-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep kpatch=1 /proc/cmdline diff --git a/test/integration/rhel-7.6/cmdline-string.patch b/test/integration/rhel-7.6/cmdline-string.patch deleted file mode 100644 index 749861fc4..000000000 --- a/test/integration/rhel-7.6/cmdline-string.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nupr src.orig/fs/proc/cmdline.c src/fs/proc/cmdline.c ---- src.orig/fs/proc/cmdline.c 2017-09-22 15:27:21.698056175 -0400 -+++ src/fs/proc/cmdline.c 2017-09-22 15:27:22.955061380 -0400 -@@ -5,7 +5,7 @@ - - static int cmdline_proc_show(struct seq_file *m, void *v) - { -- seq_printf(m, "%s\n", saved_command_line); -+ seq_printf(m, "%s kpatch=1\n", saved_command_line); - return 0; - } - diff --git a/test/integration/rhel-7.6/data-new-LOADED.test b/test/integration/rhel-7.6/data-new-LOADED.test deleted file mode 100755 index 598b6bb77..000000000 --- a/test/integration/rhel-7.6/data-new-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep "kpatch: 5" /proc/meminfo diff --git a/test/integration/rhel-7.6/data-new.patch b/test/integration/rhel-7.6/data-new.patch deleted file mode 100644 index e2f9333e2..000000000 --- a/test/integration/rhel-7.6/data-new.patch +++ /dev/null @@ -1,29 +0,0 @@ -Index: kernel-rhel7/fs/proc/meminfo.c -=================================================================== ---- kernel-rhel7.orig/fs/proc/meminfo.c -+++ kernel-rhel7/fs/proc/meminfo.c -@@ -20,6 +20,8 @@ void __attribute__((weak)) arch_report_m - { - } - -+static int foo = 5; -+ - static int meminfo_proc_show(struct seq_file *m, void *v) - { - struct sysinfo i; -@@ -110,6 +112,7 @@ static int meminfo_proc_show(struct seq_ - "CmaTotal: %8lu kB\n" - "CmaFree: %8lu kB\n" - #endif -+ "kpatch: %d" - , - K(i.totalram), - K(i.freeram), -@@ -175,6 +178,7 @@ static int meminfo_proc_show(struct seq_ - , K(totalcma_pages) - , K(global_page_state(NR_FREE_CMA_PAGES)) - #endif -+ ,foo - ); - - hugetlb_report_meminfo(m); diff --git a/test/integration/rhel-7.6/data-read-mostly.patch.disabled b/test/integration/rhel-7.6/data-read-mostly.patch.disabled deleted file mode 100644 index 42b02cb28..000000000 --- a/test/integration/rhel-7.6/data-read-mostly.patch.disabled +++ /dev/null @@ -1,12 +0,0 @@ -Index: kernel-rhel7/net/core/dev.c -=================================================================== ---- kernel-rhel7.orig/net/core/dev.c -+++ kernel-rhel7/net/core/dev.c -@@ -4199,6 +4199,7 @@ skip_classify: - case RX_HANDLER_PASS: - break; - default: -+ printk("BUG!\n"); - BUG(); - } - } diff --git a/test/integration/rhel-7.6/fixup-section.patch b/test/integration/rhel-7.6/fixup-section.patch deleted file mode 100644 index 18d13b5cd..000000000 --- a/test/integration/rhel-7.6/fixup-section.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/fs/readdir.c b/fs/readdir.c -index febd02dfbe2d..064db7bd70d0 100644 ---- a/fs/readdir.c -+++ b/fs/readdir.c -@@ -176,6 +176,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, - goto efault; - } - dirent = buf->current_dir; -+ asm("nop"); - if (__put_user(d_ino, &dirent->d_ino)) - goto efault; - if (__put_user(reclen, &dirent->d_reclen)) diff --git a/test/integration/rhel-7.6/gcc-constprop.patch.disabled b/test/integration/rhel-7.6/gcc-constprop.patch.disabled deleted file mode 100644 index 63ba45d5c..000000000 --- a/test/integration/rhel-7.6/gcc-constprop.patch.disabled +++ /dev/null @@ -1,13 +0,0 @@ -diff -Nupr src.orig/kernel/time/timekeeping.c src/kernel/time/timekeeping.c ---- src.orig/kernel/time/timekeeping.c 2017-09-22 15:27:21.602055778 -0400 -+++ src/kernel/time/timekeeping.c 2017-09-22 15:27:27.522080292 -0400 -@@ -877,6 +877,9 @@ void do_gettimeofday(struct timeval *tv) - { - struct timespec64 now; - -+ if (!tv) -+ return; -+ - getnstimeofday64(&now); - tv->tv_sec = now.tv_sec; - tv->tv_usec = now.tv_nsec/1000; diff --git a/test/integration/rhel-7.6/gcc-isra.patch b/test/integration/rhel-7.6/gcc-isra.patch deleted file mode 100644 index 1eab35c68..000000000 --- a/test/integration/rhel-7.6/gcc-isra.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: kernel-rhel7/fs/proc/proc_sysctl.c -=================================================================== ---- kernel-rhel7.orig/fs/proc/proc_sysctl.c -+++ kernel-rhel7/fs/proc/proc_sysctl.c -@@ -46,6 +46,7 @@ void proc_sys_poll_notify(struct ctl_tab - if (!poll) - return; - -+ printk("kpatch-test: testing gcc .isra function name mangling\n"); - atomic_inc(&poll->event); - wake_up_interruptible(&poll->wait); - } diff --git a/test/integration/rhel-7.6/gcc-mangled-3.patch b/test/integration/rhel-7.6/gcc-mangled-3.patch deleted file mode 100644 index 92ba80e21..000000000 --- a/test/integration/rhel-7.6/gcc-mangled-3.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: kernel-rhel7/mm/slub.c -=================================================================== ---- kernel-rhel7.orig/mm/slub.c -+++ kernel-rhel7/mm/slub.c -@@ -5611,6 +5611,9 @@ void get_slabinfo(struct kmem_cache *s, - unsigned long nr_free = 0; - int node; - -+ if (!jiffies) -+ printk("slabinfo\n"); -+ - for_each_online_node(node) { - struct kmem_cache_node *n = get_node(s, node); - diff --git a/test/integration/rhel-7.6/gcc-static-local-var-2.patch b/test/integration/rhel-7.6/gcc-static-local-var-2.patch deleted file mode 100644 index 71539687f..000000000 --- a/test/integration/rhel-7.6/gcc-static-local-var-2.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: kernel-rhel7/mm/mmap.c -=================================================================== ---- kernel-rhel7.orig/mm/mmap.c -+++ kernel-rhel7/mm/mmap.c -@@ -1715,6 +1715,9 @@ unsigned long mmap_region(struct file *f - struct rb_node **rb_link, *rb_parent; - unsigned long charged = 0; - -+ if (!jiffies) -+ printk("kpatch mmap foo\n"); -+ - /* Check against address space limit. */ - if (!may_expand_vm(mm, len >> PAGE_SHIFT)) { - unsigned long nr_pages; diff --git a/test/integration/rhel-7.6/gcc-static-local-var-3.patch b/test/integration/rhel-7.6/gcc-static-local-var-3.patch deleted file mode 100644 index d751fc615..000000000 --- a/test/integration/rhel-7.6/gcc-static-local-var-3.patch +++ /dev/null @@ -1,20 +0,0 @@ -Index: kernel-rhel7/kernel/sys.c -=================================================================== ---- kernel-rhel7.orig/kernel/sys.c -+++ kernel-rhel7/kernel/sys.c -@@ -559,8 +559,15 @@ SYSCALL_DEFINE4(reboot, int, magic1, int - return ret; - } - -+void kpatch_bar(void) -+{ -+ if (!jiffies) -+ printk("kpatch_foo\n"); -+} -+ - static void deferred_cad(struct work_struct *dummy) - { -+ kpatch_bar(); - kernel_restart(NULL); - } - diff --git a/test/integration/rhel-7.6/gcc-static-local-var-4.patch b/test/integration/rhel-7.6/gcc-static-local-var-4.patch deleted file mode 100644 index e25d34302..000000000 --- a/test/integration/rhel-7.6/gcc-static-local-var-4.patch +++ /dev/null @@ -1,21 +0,0 @@ -Index: kernel-rhel7/fs/aio.c -=================================================================== ---- kernel-rhel7.orig/fs/aio.c -+++ kernel-rhel7/fs/aio.c -@@ -223,9 +223,16 @@ static int __init aio_setup(void) - } - __initcall(aio_setup); - -+void kpatch_aio_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch aio foo\n"); -+} -+ - static void put_aio_ring_file(struct kioctx *ctx) - { - struct file *aio_ring_file = ctx->aio_ring_file; -+ kpatch_aio_foo(); - if (aio_ring_file) { - truncate_setsize(aio_ring_file->f_inode, 0); - diff --git a/test/integration/rhel-7.6/gcc-static-local-var-4.test b/test/integration/rhel-7.6/gcc-static-local-var-4.test deleted file mode 100755 index e085f9345..000000000 --- a/test/integration/rhel-7.6/gcc-static-local-var-4.test +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -set -o pipefail -if ! $(eu-readelf --wide --symbols test-gcc-static-local-var-4.ko | awk '$NF == "free_ioctx" { exit 1 }'); then - exit 1 -else - exit 0 -fi diff --git a/test/integration/rhel-7.6/gcc-static-local-var-5.patch b/test/integration/rhel-7.6/gcc-static-local-var-5.patch deleted file mode 100644 index 540affaf8..000000000 --- a/test/integration/rhel-7.6/gcc-static-local-var-5.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff -Nupr src.orig/kernel/audit.c src/kernel/audit.c ---- src.orig/kernel/audit.c 2017-09-22 15:27:21.602055778 -0400 -+++ src/kernel/audit.c 2017-09-22 15:27:34.429108894 -0400 -@@ -205,6 +205,12 @@ void audit_panic(const char *message) - } - } - -+void kpatch_audit_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch audit foo\n"); -+} -+ - static inline int audit_rate_check(void) - { - static unsigned long last_check = 0; -@@ -215,6 +221,7 @@ static inline int audit_rate_check(void) - unsigned long elapsed; - int retval = 0; - -+ kpatch_audit_foo(); - if (!audit_rate_limit) return 1; - - spin_lock_irqsave(&lock, flags); -@@ -234,6 +241,11 @@ static inline int audit_rate_check(void) - return retval; - } - -+noinline void kpatch_audit_check(void) -+{ -+ audit_rate_check(); -+} -+ - /** - * audit_log_lost - conditionally log lost audit message event - * @message: the message stating reason for lost audit message -@@ -282,6 +294,8 @@ static int audit_log_config_change(char - struct audit_buffer *ab; - int rc = 0; - -+ kpatch_audit_check(); -+ - ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE); - if (unlikely(!ab)) - return rc; diff --git a/test/integration/rhel-7.6/gcc-static-local-var-6.patch b/test/integration/rhel-7.6/gcc-static-local-var-6.patch deleted file mode 100644 index bd5493c0b..000000000 --- a/test/integration/rhel-7.6/gcc-static-local-var-6.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c -index a9d587a..23336ed 100644 ---- a/net/ipv6/netfilter.c -+++ b/net/ipv6/netfilter.c -@@ -106,6 +106,8 @@ static int nf_ip6_reroute(struct sk_buff *skb, - return 0; - } - -+#include "kpatch-macros.h" -+ - static int nf_ip6_route(struct net *net, struct dst_entry **dst, - struct flowi *fl, bool strict) - { -@@ -119,6 +121,9 @@ static int nf_ip6_route(struct net *net, struct dst_entry **dst, - struct dst_entry *result; - int err; - -+ if (!jiffies) -+ printk("kpatch nf_ip6_route foo\n"); -+ - result = ip6_route_output(net, sk, &fl->u.ip6); - err = result->error; - if (err) diff --git a/test/integration/rhel-7.6/macro-callbacks.patch b/test/integration/rhel-7.6/macro-callbacks.patch deleted file mode 100644 index 0d6831b66..000000000 --- a/test/integration/rhel-7.6/macro-callbacks.patch +++ /dev/null @@ -1,160 +0,0 @@ -kpatch/livepatch callback test patch: - - vmlinux - pcspkr (mod) - joydev (mod) - -Note: update joydev's pre-patch callback to return -ENODEV to test failure path - ---- src.old/fs/aio.c 2018-02-26 11:07:51.522610407 -0500 -+++ src/fs/aio.c 2018-03-05 11:17:21.560015449 -0500 -@@ -42,6 +42,50 @@ - #include - #include - -+#include -+#include "kpatch-macros.h" -+ -+static const char *const module_state[] = { -+ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", -+ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", -+ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", -+ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", -+}; -+ -+static void callback_info(const char *callback, patch_object *obj) -+{ -+ if (obj->mod) -+ pr_info("%s: %s -> %s\n", callback, obj->mod->name, -+ module_state[obj->mod->state]); -+ else -+ pr_info("%s: vmlinux\n", callback); -+} -+ -+static int pre_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+ return 0; -+} -+KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); -+ -+static void post_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_PATCH_CALLBACK(post_patch_callback); -+ -+static void pre_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); -+ -+static void post_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); -+ - #define AIO_RING_MAGIC 0xa10a10a1 - #define AIO_RING_COMPAT_FEATURES 1 - #define AIO_RING_INCOMPAT_FEATURES 0 ---- src.old/drivers/input/joydev.c 2018-02-26 11:07:49.470610407 -0500 -+++ src/drivers/input/joydev.c 2018-03-05 11:18:13.998015449 -0500 -@@ -954,3 +954,47 @@ static void __exit joydev_exit(void) - - module_init(joydev_init); - module_exit(joydev_exit); -+ -+#include -+#include "kpatch-macros.h" -+ -+static const char *const module_state[] = { -+ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", -+ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", -+ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", -+ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", -+}; -+ -+static void callback_info(const char *callback, patch_object *obj) -+{ -+ if (obj->mod) -+ pr_info("%s: %s -> %s\n", callback, obj->mod->name, -+ module_state[obj->mod->state]); -+ else -+ pr_info("%s: vmlinux\n", callback); -+} -+ -+static int pre_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+ return 0; /* return -ENODEV; */ -+} -+KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); -+ -+static void post_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_PATCH_CALLBACK(post_patch_callback); -+ -+static void pre_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); -+ -+static void post_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); ---- src.old/drivers/input/misc/pcspkr.c 2018-02-26 11:07:49.477610407 -0500 -+++ src/drivers/input/misc/pcspkr.c 2018-03-05 11:18:23.411015449 -0500 -@@ -136,3 +136,46 @@ static struct platform_driver pcspkr_pla - }; - module_platform_driver(pcspkr_platform_driver); - -+#include -+#include "kpatch-macros.h" -+ -+static const char *const module_state[] = { -+ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", -+ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", -+ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", -+ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", -+}; -+ -+static void callback_info(const char *callback, patch_object *obj) -+{ -+ if (obj->mod) -+ pr_info("%s: %s -> %s\n", callback, obj->mod->name, -+ module_state[obj->mod->state]); -+ else -+ pr_info("%s: vmlinux\n", callback); -+} -+ -+static int pre_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+ return 0; -+} -+KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); -+ -+static void post_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_PATCH_CALLBACK(post_patch_callback); -+ -+static void pre_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); -+ -+static void post_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); diff --git a/test/integration/rhel-7.6/macro-printk.patch b/test/integration/rhel-7.6/macro-printk.patch deleted file mode 100644 index e837173d2..000000000 --- a/test/integration/rhel-7.6/macro-printk.patch +++ /dev/null @@ -1,151 +0,0 @@ -Index: kernel-rhel7/net/ipv4/fib_frontend.c -=================================================================== ---- kernel-rhel7.orig/net/ipv4/fib_frontend.c -+++ kernel-rhel7/net/ipv4/fib_frontend.c -@@ -685,6 +685,7 @@ errout: - return err; - } - -+#include "kpatch-macros.h" - static int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh) - { - struct net *net = sock_net(skb->sk); -@@ -703,6 +704,7 @@ static int inet_rtm_newroute(struct sk_b - } - - err = fib_table_insert(net, tb, &cfg); -+ KPATCH_PRINTK("[inet_rtm_newroute]: err is %d\n", err); - errout: - return err; - } -Index: kernel-rhel7/net/ipv4/fib_semantics.c -=================================================================== ---- kernel-rhel7.orig/net/ipv4/fib_semantics.c -+++ kernel-rhel7/net/ipv4/fib_semantics.c -@@ -969,6 +969,7 @@ fib_convert_metrics(struct fib_info *fi, - return 0; - } - -+#include "kpatch-macros.h" - struct fib_info *fib_create_info(struct fib_config *cfg) - { - int err; -@@ -993,6 +994,7 @@ struct fib_info *fib_create_info(struct - #endif - - err = -ENOBUFS; -+ KPATCH_PRINTK("[fib_create_info]: create error err is %d\n",err); - if (fib_info_cnt >= fib_info_hash_size) { - unsigned int new_size = fib_info_hash_size << 1; - struct hlist_head *new_info_hash; -@@ -1013,6 +1015,7 @@ struct fib_info *fib_create_info(struct - if (!fib_info_hash_size) - goto failure; - } -+ KPATCH_PRINTK("[fib_create_info]: 2 create error err is %d\n",err); - - fi = kzalloc(sizeof(*fi)+nhs*sizeof(struct fib_nh), GFP_KERNEL); - if (fi == NULL) -@@ -1028,6 +1031,8 @@ struct fib_info *fib_create_info(struct - fi->fib_metrics = (struct dst_metrics *)&dst_default_metrics; - } - fib_info_cnt++; -+ KPATCH_PRINTK("[fib_create_info]: 3 create error err is %d\n",err); -+ - fi->fib_net = net; - fi->fib_protocol = cfg->fc_protocol; - fi->fib_scope = cfg->fc_scope; -@@ -1043,8 +1048,10 @@ struct fib_info *fib_create_info(struct - if (!nexthop_nh->nh_pcpu_rth_output) - goto failure; - } endfor_nexthops(fi) -+ KPATCH_PRINTK("[fib_create_info]: 4 create error err is %d\n",err); - - err = fib_convert_metrics(fi, cfg); -+ KPATCH_PRINTK("[fib_create_info]: 5 create error err is %d\n",err); - if (err) - goto failure; - -@@ -1095,6 +1102,7 @@ struct fib_info *fib_create_info(struct - nh->nh_weight = 1; - #endif - } -+ KPATCH_PRINTK("[fib_create_info]: 6 create error err is %d\n",err); - - if (fib_props[cfg->fc_type].error) { - if (cfg->fc_gw || cfg->fc_oif || cfg->fc_mp) -@@ -1112,6 +1120,7 @@ struct fib_info *fib_create_info(struct - goto err_inval; - } - } -+ KPATCH_PRINTK("[fib_create_info]: 7 create error err is %d\n",err); - - if (cfg->fc_scope > RT_SCOPE_HOST) - goto err_inval; -@@ -1134,6 +1143,7 @@ struct fib_info *fib_create_info(struct - goto failure; - } endfor_nexthops(fi) - } -+ KPATCH_PRINTK("[fib_create_info]: 8 create error err is %d\n",err); - - if (fi->fib_prefsrc) { - if (cfg->fc_type != RTN_LOCAL || !cfg->fc_dst || -@@ -1146,6 +1156,7 @@ struct fib_info *fib_create_info(struct - fib_info_update_nh_saddr(net, nexthop_nh); - fib_add_weight(fi, nexthop_nh); - } endfor_nexthops(fi) -+ KPATCH_PRINTK("[fib_create_info]: 9 create error err is %d\n",err); - - fib_rebalance(fi); - -@@ -1157,6 +1168,7 @@ link_it: - ofi->fib_treeref++; - return ofi; - } -+ KPATCH_PRINTK("[fib_create_info]: 10 create error err is %d\n",err); - - fi->fib_treeref++; - atomic_inc(&fi->fib_clntref); -@@ -1180,6 +1192,7 @@ link_it: - hlist_add_head(&nexthop_nh->nh_hash, head); - } endfor_nexthops(fi) - spin_unlock_bh(&fib_info_lock); -+ KPATCH_PRINTK("[fib_create_info]: 11 create error err is %d\n",err); - return fi; - - err_inval: -@@ -1190,6 +1203,7 @@ failure: - fi->fib_dead = 1; - free_fib_info(fi); - } -+ KPATCH_PRINTK("[fib_create_info]: 12 create error err is %d\n",err); - - return ERR_PTR(err); - } -Index: kernel-rhel7/net/ipv4/fib_trie.c -=================================================================== ---- kernel-rhel7.orig/net/ipv4/fib_trie.c -+++ kernel-rhel7/net/ipv4/fib_trie.c -@@ -1105,6 +1105,7 @@ static int fib_insert_alias(struct trie - } - - /* Caller must hold RTNL. */ -+#include "kpatch-macros.h" - int fib_table_insert(struct net *net, struct fib_table *tb, - struct fib_config *cfg) - { -@@ -1130,11 +1131,14 @@ int fib_table_insert(struct net *net, st - if ((plen < KEYLENGTH) && (key << plen)) - return -EINVAL; - -+ KPATCH_PRINTK("[fib_table_insert]: start\n"); - fi = fib_create_info(cfg); - if (IS_ERR(fi)) { - err = PTR_ERR(fi); -+ KPATCH_PRINTK("[fib_table_insert]: create error err is %d\n",err); - goto err; - } -+ KPATCH_PRINTK("[fib_table_insert]: cross\n"); - - l = fib_find_node(t, &tp, key); - fa = l ? fib_find_alias(&l->leaf, slen, tos, fi->fib_priority, diff --git a/test/integration/rhel-7.6/meminfo-init-FAIL.patch b/test/integration/rhel-7.6/meminfo-init-FAIL.patch deleted file mode 100644 index 3b8672d62..000000000 --- a/test/integration/rhel-7.6/meminfo-init-FAIL.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: kernel-rhel7/fs/proc/meminfo.c -=================================================================== ---- kernel-rhel7.orig/fs/proc/meminfo.c -+++ kernel-rhel7/fs/proc/meminfo.c -@@ -199,6 +199,7 @@ static const struct file_operations memi - - static int __init proc_meminfo_init(void) - { -+ printk("a\n"); - proc_create("meminfo", 0, NULL, &meminfo_proc_fops); - return 0; - } diff --git a/test/integration/rhel-7.6/meminfo-init2-FAIL.patch b/test/integration/rhel-7.6/meminfo-init2-FAIL.patch deleted file mode 100644 index cd70ef939..000000000 --- a/test/integration/rhel-7.6/meminfo-init2-FAIL.patch +++ /dev/null @@ -1,20 +0,0 @@ -Index: kernel-rhel7/fs/proc/meminfo.c -=================================================================== ---- kernel-rhel7.orig/fs/proc/meminfo.c -+++ kernel-rhel7/fs/proc/meminfo.c -@@ -30,6 +30,7 @@ static int meminfo_proc_show(struct seq_ - unsigned long pages[NR_LRU_LISTS]; - int lru; - -+ printk("a\n"); - /* - * display in kilobytes. - */ -@@ -199,6 +200,7 @@ static const struct file_operations memi - - static int __init proc_meminfo_init(void) - { -+ printk("a\n"); - proc_create("meminfo", 0, NULL, &meminfo_proc_fops); - return 0; - } diff --git a/test/integration/rhel-7.6/meminfo-string-LOADED.test b/test/integration/rhel-7.6/meminfo-string-LOADED.test deleted file mode 100755 index 10dc20b3d..000000000 --- a/test/integration/rhel-7.6/meminfo-string-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep VMALLOCCHUNK /proc/meminfo diff --git a/test/integration/rhel-7.6/meminfo-string.patch b/test/integration/rhel-7.6/meminfo-string.patch deleted file mode 100644 index afdc5d016..000000000 --- a/test/integration/rhel-7.6/meminfo-string.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c ---- src.orig/fs/proc/meminfo.c 2017-09-22 15:27:21.699056179 -0400 -+++ src/fs/proc/meminfo.c 2017-09-22 15:27:41.274137239 -0400 -@@ -99,7 +99,7 @@ static int meminfo_proc_show(struct seq_ - "Committed_AS: %8lu kB\n" - "VmallocTotal: %8lu kB\n" - "VmallocUsed: %8lu kB\n" -- "VmallocChunk: %8lu kB\n" -+ "VMALLOCCHUNK: %8lu kB\n" - #ifdef CONFIG_MEMORY_FAILURE - "HardwareCorrupted: %5lu kB\n" - #endif diff --git a/test/integration/rhel-7.6/module-call-external.patch b/test/integration/rhel-7.6/module-call-external.patch deleted file mode 100644 index f149edf16..000000000 --- a/test/integration/rhel-7.6/module-call-external.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c -index 27459a453bb8..2247255877be 100644 ---- a/fs/nfsd/export.c -+++ b/fs/nfsd/export.c -@@ -1184,7 +1184,13 @@ static void exp_flags(struct seq_file *m, int flag, int fsid, - } - } - -+extern char *kpatch_string(void); -+ -+#ifdef CONFIG_PPC64 -+static int __attribute__((optimize("-fno-optimize-sibling-calls"))) e_show(struct seq_file *m, void *p) -+#else - static int e_show(struct seq_file *m, void *p) -+#endif - { - struct cache_head *cp = p; - struct svc_export *exp = container_of(cp, struct svc_export, h); -@@ -1193,6 +1199,7 @@ static int e_show(struct seq_file *m, void *p) - if (p == SEQ_START_TOKEN) { - seq_puts(m, "# Version 1.1\n"); - seq_puts(m, "# Path Client(Flags) # IPs\n"); -+ seq_puts(m, kpatch_string()); - return 0; - } - -diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c -index 592f64643491..21b87cb948c9 100644 ---- a/net/netlink/af_netlink.c -+++ b/net/netlink/af_netlink.c -@@ -2568,4 +2568,9 @@ panic: - panic("netlink_init: Cannot allocate nl_table\n"); - } - -+char *kpatch_string(void) -+{ -+ return "# kpatch\n"; -+} -+ - core_initcall(netlink_proto_init); diff --git a/test/integration/rhel-7.6/multiple.test b/test/integration/rhel-7.6/multiple.test deleted file mode 100755 index 7e4b3525c..000000000 --- a/test/integration/rhel-7.6/multiple.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -SCRIPTDIR="$(readlink -f $(dirname $(type -p $0)))" - -declare -a blacklist=(meminfo-string-LOADED.test) - -source ${SCRIPTDIR}/../common/multiple.template diff --git a/test/integration/rhel-7.6/new-function.patch b/test/integration/rhel-7.6/new-function.patch deleted file mode 100644 index a9a0724d9..000000000 --- a/test/integration/rhel-7.6/new-function.patch +++ /dev/null @@ -1,26 +0,0 @@ -Index: kernel-rhel7/drivers/tty/n_tty.c -=================================================================== ---- kernel-rhel7.orig/drivers/tty/n_tty.c -+++ kernel-rhel7/drivers/tty/n_tty.c -@@ -2128,7 +2128,7 @@ do_it_again: - * lock themselves) - */ - --static ssize_t n_tty_write(struct tty_struct *tty, struct file *file, -+static ssize_t noinline kpatch_n_tty_write(struct tty_struct *tty, struct file *file, - const unsigned char *buf, size_t nr) - { - const unsigned char *b = buf; -@@ -2210,6 +2210,12 @@ break_out: - return (b - buf) ? b - buf : retval; - } - -+static ssize_t __attribute__((optimize("-fno-optimize-sibling-calls"))) n_tty_write(struct tty_struct *tty, struct file *file, -+ const unsigned char *buf, size_t nr) -+{ -+ return kpatch_n_tty_write(tty, file, buf, nr); -+} -+ - /** - * n_tty_poll - poll method for N_TTY - * @tty: terminal device diff --git a/test/integration/rhel-7.6/new-globals.patch b/test/integration/rhel-7.6/new-globals.patch deleted file mode 100644 index 3d9d34940..000000000 --- a/test/integration/rhel-7.6/new-globals.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff -Nupr src.orig/fs/proc/cmdline.c src/fs/proc/cmdline.c ---- src.orig/fs/proc/cmdline.c 2017-09-22 15:27:21.698056175 -0400 -+++ src/fs/proc/cmdline.c 2017-09-22 15:27:47.028161067 -0400 -@@ -27,3 +27,10 @@ static int __init proc_cmdline_init(void - return 0; - } - module_init(proc_cmdline_init); -+ -+#include -+void kpatch_print_message(void) -+{ -+ if (!jiffies) -+ printk("hello there!\n"); -+} -diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c ---- src.orig/fs/proc/meminfo.c 2017-09-22 15:27:21.699056179 -0400 -+++ src/fs/proc/meminfo.c 2017-09-22 15:27:47.029161071 -0400 -@@ -16,6 +16,8 @@ - #include - #include "internal.h" - -+void kpatch_print_message(void); -+ - void __attribute__((weak)) arch_report_meminfo(struct seq_file *m) - { - } -@@ -53,6 +55,7 @@ static int meminfo_proc_show(struct seq_ - /* - * Tagged format, for easy grepping and expansion. - */ -+ kpatch_print_message(); - seq_printf(m, - "MemTotal: %8lu kB\n" - "MemFree: %8lu kB\n" diff --git a/test/integration/rhel-7.6/parainstructions-section.patch b/test/integration/rhel-7.6/parainstructions-section.patch deleted file mode 100644 index 809dce4b9..000000000 --- a/test/integration/rhel-7.6/parainstructions-section.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nupr src.orig/fs/proc/generic.c src/fs/proc/generic.c ---- src.orig/fs/proc/generic.c 2017-09-22 15:27:21.698056175 -0400 -+++ src/fs/proc/generic.c 2017-09-22 15:27:48.190165879 -0400 -@@ -194,6 +194,7 @@ int proc_alloc_inum(unsigned int *inum) - unsigned int i; - int error; - -+ printk("kpatch-test: testing change to .parainstructions section\n"); - retry: - if (!ida_pre_get(&proc_inum_ida, GFP_KERNEL)) - return -ENOMEM; diff --git a/test/integration/rhel-7.6/shadow-newpid-LOADED.test b/test/integration/rhel-7.6/shadow-newpid-LOADED.test deleted file mode 100755 index c07d11205..000000000 --- a/test/integration/rhel-7.6/shadow-newpid-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep -q newpid: /proc/$$/status diff --git a/test/integration/rhel-7.6/shadow-newpid.patch b/test/integration/rhel-7.6/shadow-newpid.patch deleted file mode 100644 index 17bf52771..000000000 --- a/test/integration/rhel-7.6/shadow-newpid.patch +++ /dev/null @@ -1,72 +0,0 @@ -diff --git a/fs/proc/array.c b/fs/proc/array.c -index 39684c79e8e2..138b60d1314d 100644 ---- a/fs/proc/array.c -+++ b/fs/proc/array.c -@@ -394,13 +394,20 @@ static inline void task_seccomp(struct seq_file *m, struct task_struct *p) - seq_putc(m, '\n'); - } - -+#include - static inline void task_context_switch_counts(struct seq_file *m, - struct task_struct *p) - { -+ int *newpid; -+ - seq_printf(m, "voluntary_ctxt_switches:\t%lu\n" - "nonvoluntary_ctxt_switches:\t%lu\n", - p->nvcsw, - p->nivcsw); -+ -+ newpid = klp_shadow_get(p, 0); -+ if (newpid) -+ seq_printf(m, "newpid:\t%d\n", *newpid); - } - - static void task_cpus_allowed(struct seq_file *m, struct task_struct *task) -diff --git a/kernel/exit.c b/kernel/exit.c -index 148a7842928d..e1dbab71b37d 100644 ---- a/kernel/exit.c -+++ b/kernel/exit.c -@@ -791,6 +791,7 @@ static void check_stack_usage(void) - static inline void check_stack_usage(void) {} - #endif - -+#include - void do_exit(long code) - { - struct task_struct *tsk = current; -@@ -888,6 +889,8 @@ void do_exit(long code) - check_stack_usage(); - exit_thread(); - -+ klp_shadow_free(tsk, 0, NULL); -+ - /* - * Flush inherited counters to the parent - before the parent - * gets woken up by child-exit notifications. -diff --git a/kernel/fork.c b/kernel/fork.c -index 9bff3b28c357..529a2c943d7c 100644 ---- a/kernel/fork.c -+++ b/kernel/fork.c -@@ -1757,6 +1757,7 @@ struct task_struct *fork_idle(int cpu) - * It copies the process, and if successful kick-starts - * it and waits for it to finish using the VM if required. - */ -+#include - long do_fork(unsigned long clone_flags, - unsigned long stack_start, - unsigned long stack_size, -@@ -1794,6 +1795,13 @@ long do_fork(unsigned long clone_flags, - if (!IS_ERR(p)) { - struct completion vfork; - struct pid *pid; -+ int *newpid; -+ static int ctr = 0; -+ -+ newpid = klp_shadow_get_or_alloc(p, 0, sizeof(*newpid), GFP_KERNEL, -+ NULL, NULL); -+ if (newpid) -+ *newpid = ctr++; - - trace_sched_process_fork(current, p); - diff --git a/test/integration/rhel-7.6/smp-locks-section.patch b/test/integration/rhel-7.6/smp-locks-section.patch deleted file mode 100644 index 6f39d53f9..000000000 --- a/test/integration/rhel-7.6/smp-locks-section.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -Nupr src.orig/drivers/tty/tty_buffer.c src/drivers/tty/tty_buffer.c ---- src.orig/drivers/tty/tty_buffer.c 2017-09-22 15:27:21.077053604 -0400 -+++ src/drivers/tty/tty_buffer.c 2017-09-22 15:27:50.542175618 -0400 -@@ -217,6 +217,10 @@ int tty_buffer_request_room(struct tty_p - /* OPTIMISATION: We could keep a per tty "zero" sized buffer to - remove this conditional if its worth it. This would be invisible - to the callers */ -+ -+ if (!size) -+ printk("kpatch-test: testing .smp_locks section changes\n"); -+ - b = buf->tail; - if (b != NULL) - left = b->size - b->used; diff --git a/test/integration/rhel-7.6/special-static.patch b/test/integration/rhel-7.6/special-static.patch deleted file mode 100644 index 7fa529f1c..000000000 --- a/test/integration/rhel-7.6/special-static.patch +++ /dev/null @@ -1,23 +0,0 @@ -Index: kernel-rhel7/kernel/fork.c -=================================================================== ---- kernel-rhel7.orig/kernel/fork.c -+++ kernel-rhel7/kernel/fork.c -@@ -1146,10 +1146,18 @@ static void posix_cpu_timers_init_group( - INIT_LIST_HEAD(&sig->cpu_timers[2]); - } - -+void kpatch_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch copy signal\n"); -+} -+ - static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) - { - struct signal_struct *sig; - -+ kpatch_foo(); -+ - if (clone_flags & CLONE_THREAD) - return 0; - diff --git a/test/integration/rhel-7.6/symvers-disagreement-FAIL.patch b/test/integration/rhel-7.6/symvers-disagreement-FAIL.patch deleted file mode 100644 index d8ef75410..000000000 --- a/test/integration/rhel-7.6/symvers-disagreement-FAIL.patch +++ /dev/null @@ -1,51 +0,0 @@ -From bcb86fa4e9c31379a9e2716eae29cd53ccca064f Mon Sep 17 00:00:00 2001 -From: Julien Thierry -Date: Wed, 6 May 2020 14:30:57 +0100 -Subject: [PATCH] Symbol version change - -This change causes: -1) Some exported symbols in drivers/base/core.c to see their CRCs - change. -2) Changes usb_get_dev() referencing a get_device() whose CRC has - changed, causing the symbol and the new CRC to be included in the - __version section of the final module. - -This makes the final module unloadable for the target kernel. - -See "Exported symbol versioning" of the patch author guide for more -detail. - ---- - drivers/base/core.c | 2 ++ - drivers/usb/core/usb.c | 2 ++ - 2 files changed, 4 insertions(+) - -diff --git a/drivers/base/core.c b/drivers/base/core.c -index b9a71137208..4af27e069c2 100644 ---- a/drivers/base/core.c -+++ b/drivers/base/core.c -@@ -31,6 +31,8 @@ - #include "base.h" - #include "power/power.h" - -+#include -+ - #ifdef CONFIG_SYSFS_DEPRECATED - #ifdef CONFIG_SYSFS_DEPRECATED_V2 - long sysfs_deprecated = 1; -diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c -index f9db3660999..bece0bf4f5a 100644 ---- a/drivers/usb/core/usb.c -+++ b/drivers/usb/core/usb.c -@@ -691,6 +691,8 @@ EXPORT_SYMBOL_GPL(usb_alloc_dev); - */ - struct usb_device *usb_get_dev(struct usb_device *dev) - { -+ barrier(); -+ - if (dev) - get_device(&dev->dev); - return dev; --- -2.21.1 - diff --git a/test/integration/rhel-7.6/tracepoints-section.patch b/test/integration/rhel-7.6/tracepoints-section.patch deleted file mode 100644 index 512e51268..000000000 --- a/test/integration/rhel-7.6/tracepoints-section.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: kernel-rhel7/kernel/timer.c -=================================================================== ---- kernel-rhel7.orig/kernel/timer.c -+++ kernel-rhel7/kernel/timer.c -@@ -1454,6 +1454,9 @@ static void run_timer_softirq(struct sof - { - struct tvec_base *base = __this_cpu_read(tvec_bases); - -+ if (!base) -+ printk("kpatch-test: testing __tracepoints section changes\n"); -+ - if (time_after_eq(jiffies, base->timer_jiffies)) - __run_timers(base); - } diff --git a/test/integration/rhel-7.6/warn-detect-FAIL.patch b/test/integration/rhel-7.6/warn-detect-FAIL.patch deleted file mode 100644 index 8efa78232..000000000 --- a/test/integration/rhel-7.6/warn-detect-FAIL.patch +++ /dev/null @@ -1,8 +0,0 @@ -diff -Nupr src.orig/arch/x86/kvm/x86.c src/arch/x86/kvm/x86.c ---- src.orig/arch/x86/kvm/x86.c 2017-09-22 15:27:20.852052672 -0400 -+++ src/arch/x86/kvm/x86.c 2017-09-22 15:27:55.489196104 -0400 -@@ -1,3 +1,4 @@ -+ - /* - * Kernel-based Virtual Machine driver for Linux - * diff --git a/test/integration/rhel-7.7/bug-table-section.patch b/test/integration/rhel-7.7/bug-table-section.patch deleted file mode 100644 index 34342c0bf..000000000 --- a/test/integration/rhel-7.7/bug-table-section.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: kernel/fs/proc/proc_sysctl.c -=================================================================== ---- kernel.orig/fs/proc/proc_sysctl.c -+++ kernel/fs/proc/proc_sysctl.c -@@ -301,6 +301,8 @@ void sysctl_head_put(struct ctl_table_he - - static struct ctl_table_header *sysctl_head_grab(struct ctl_table_header *head) - { -+ if (jiffies == 0) -+ printk("kpatch-test: testing __bug_table section changes\n"); - BUG_ON(!head); - spin_lock(&sysctl_lock); - if (!use_table(head)) diff --git a/test/integration/rhel-7.7/cmdline-string-LOADED.test b/test/integration/rhel-7.7/cmdline-string-LOADED.test deleted file mode 100755 index a8e0a0817..000000000 --- a/test/integration/rhel-7.7/cmdline-string-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep kpatch=1 /proc/cmdline diff --git a/test/integration/rhel-7.7/cmdline-string.patch b/test/integration/rhel-7.7/cmdline-string.patch deleted file mode 100644 index f1f12b35d..000000000 --- a/test/integration/rhel-7.7/cmdline-string.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: kernel/fs/proc/cmdline.c -=================================================================== ---- kernel.orig/fs/proc/cmdline.c -+++ kernel/fs/proc/cmdline.c -@@ -5,7 +5,7 @@ - - static int cmdline_proc_show(struct seq_file *m, void *v) - { -- seq_printf(m, "%s\n", saved_command_line); -+ seq_printf(m, "%s kpatch=1\n", saved_command_line); - return 0; - } - diff --git a/test/integration/rhel-7.7/data-new-LOADED.test b/test/integration/rhel-7.7/data-new-LOADED.test deleted file mode 100755 index 598b6bb77..000000000 --- a/test/integration/rhel-7.7/data-new-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep "kpatch: 5" /proc/meminfo diff --git a/test/integration/rhel-7.7/data-new.patch b/test/integration/rhel-7.7/data-new.patch deleted file mode 100644 index 4f9abcf5b..000000000 --- a/test/integration/rhel-7.7/data-new.patch +++ /dev/null @@ -1,29 +0,0 @@ -Index: kernel/fs/proc/meminfo.c -=================================================================== ---- kernel.orig/fs/proc/meminfo.c -+++ kernel/fs/proc/meminfo.c -@@ -20,6 +20,8 @@ void __attribute__((weak)) arch_report_m - { - } - -+static int foo = 5; -+ - static int meminfo_proc_show(struct seq_file *m, void *v) - { - struct sysinfo i; -@@ -110,6 +112,7 @@ static int meminfo_proc_show(struct seq_ - "CmaTotal: %8lu kB\n" - "CmaFree: %8lu kB\n" - #endif -+ "kpatch: %d" - , - K(i.totalram), - K(i.freeram), -@@ -175,6 +178,7 @@ static int meminfo_proc_show(struct seq_ - , K(totalcma_pages) - , K(global_page_state(NR_FREE_CMA_PAGES)) - #endif -+ ,foo - ); - - hugetlb_report_meminfo(m); diff --git a/test/integration/rhel-7.7/data-read-mostly.patch.disabled b/test/integration/rhel-7.7/data-read-mostly.patch.disabled deleted file mode 100644 index 5e5582648..000000000 --- a/test/integration/rhel-7.7/data-read-mostly.patch.disabled +++ /dev/null @@ -1,12 +0,0 @@ -Index: kernel/net/core/dev.c -=================================================================== ---- kernel.orig/net/core/dev.c -+++ kernel/net/core/dev.c -@@ -4327,6 +4327,7 @@ skip_classify: - case RX_HANDLER_PASS: - break; - default: -+ printk("BUG!\n"); - BUG(); - } - } diff --git a/test/integration/rhel-7.7/fixup-section.patch b/test/integration/rhel-7.7/fixup-section.patch deleted file mode 100644 index 27c01cf5e..000000000 --- a/test/integration/rhel-7.7/fixup-section.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: kernel/fs/readdir.c -=================================================================== ---- kernel.orig/fs/readdir.c -+++ kernel/fs/readdir.c -@@ -176,6 +176,7 @@ static int filldir(void * __buf, const c - goto efault; - } - dirent = buf->current_dir; -+ asm("nop"); - if (__put_user(d_ino, &dirent->d_ino)) - goto efault; - if (__put_user(reclen, &dirent->d_reclen)) diff --git a/test/integration/rhel-7.7/gcc-constprop.patch.disabled b/test/integration/rhel-7.7/gcc-constprop.patch.disabled deleted file mode 100644 index 63ba45d5c..000000000 --- a/test/integration/rhel-7.7/gcc-constprop.patch.disabled +++ /dev/null @@ -1,13 +0,0 @@ -diff -Nupr src.orig/kernel/time/timekeeping.c src/kernel/time/timekeeping.c ---- src.orig/kernel/time/timekeeping.c 2017-09-22 15:27:21.602055778 -0400 -+++ src/kernel/time/timekeeping.c 2017-09-22 15:27:27.522080292 -0400 -@@ -877,6 +877,9 @@ void do_gettimeofday(struct timeval *tv) - { - struct timespec64 now; - -+ if (!tv) -+ return; -+ - getnstimeofday64(&now); - tv->tv_sec = now.tv_sec; - tv->tv_usec = now.tv_nsec/1000; diff --git a/test/integration/rhel-7.7/gcc-isra.patch b/test/integration/rhel-7.7/gcc-isra.patch deleted file mode 100644 index ce5434a2a..000000000 --- a/test/integration/rhel-7.7/gcc-isra.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: kernel/fs/proc/proc_sysctl.c -=================================================================== ---- kernel.orig/fs/proc/proc_sysctl.c -+++ kernel/fs/proc/proc_sysctl.c -@@ -46,6 +46,7 @@ void proc_sys_poll_notify(struct ctl_tab - if (!poll) - return; - -+ printk("kpatch-test: testing gcc .isra function name mangling\n"); - atomic_inc(&poll->event); - wake_up_interruptible(&poll->wait); - } diff --git a/test/integration/rhel-7.7/gcc-mangled-3.patch b/test/integration/rhel-7.7/gcc-mangled-3.patch deleted file mode 100644 index 7dbfc627f..000000000 --- a/test/integration/rhel-7.7/gcc-mangled-3.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: kernel/mm/slub.c -=================================================================== ---- kernel.orig/mm/slub.c -+++ kernel/mm/slub.c -@@ -5675,6 +5675,9 @@ void get_slabinfo(struct kmem_cache *s, - unsigned long nr_free = 0; - int node; - -+ if (!jiffies) -+ printk("slabinfo\n"); -+ - for_each_online_node(node) { - struct kmem_cache_node *n = get_node(s, node); - diff --git a/test/integration/rhel-7.7/gcc-static-local-var-2.patch b/test/integration/rhel-7.7/gcc-static-local-var-2.patch deleted file mode 100644 index d1b70f133..000000000 --- a/test/integration/rhel-7.7/gcc-static-local-var-2.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: kernel/mm/mmap.c -=================================================================== ---- kernel.orig/mm/mmap.c -+++ kernel/mm/mmap.c -@@ -1716,6 +1716,9 @@ unsigned long mmap_region(struct file *f - struct rb_node **rb_link, *rb_parent; - unsigned long charged = 0; - -+ if (!jiffies) -+ printk("kpatch mmap foo\n"); -+ - /* Check against address space limit. */ - if (!may_expand_vm(mm, len >> PAGE_SHIFT)) { - unsigned long nr_pages; diff --git a/test/integration/rhel-7.7/gcc-static-local-var-3.patch b/test/integration/rhel-7.7/gcc-static-local-var-3.patch deleted file mode 100644 index 584c8695b..000000000 --- a/test/integration/rhel-7.7/gcc-static-local-var-3.patch +++ /dev/null @@ -1,20 +0,0 @@ -Index: kernel/kernel/sys.c -=================================================================== ---- kernel.orig/kernel/sys.c -+++ kernel/kernel/sys.c -@@ -559,8 +559,15 @@ SYSCALL_DEFINE4(reboot, int, magic1, int - return ret; - } - -+void kpatch_bar(void) -+{ -+ if (!jiffies) -+ printk("kpatch_foo\n"); -+} -+ - static void deferred_cad(struct work_struct *dummy) - { -+ kpatch_bar(); - kernel_restart(NULL); - } - diff --git a/test/integration/rhel-7.7/gcc-static-local-var-4.patch b/test/integration/rhel-7.7/gcc-static-local-var-4.patch deleted file mode 100644 index 85e4df524..000000000 --- a/test/integration/rhel-7.7/gcc-static-local-var-4.patch +++ /dev/null @@ -1,21 +0,0 @@ -Index: kernel/fs/aio.c -=================================================================== ---- kernel.orig/fs/aio.c -+++ kernel/fs/aio.c -@@ -223,9 +223,16 @@ static int __init aio_setup(void) - } - __initcall(aio_setup); - -+void kpatch_aio_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch aio foo\n"); -+} -+ - static void put_aio_ring_file(struct kioctx *ctx) - { - struct file *aio_ring_file = ctx->aio_ring_file; -+ kpatch_aio_foo(); - if (aio_ring_file) { - truncate_setsize(aio_ring_file->f_inode, 0); - diff --git a/test/integration/rhel-7.7/gcc-static-local-var-4.test b/test/integration/rhel-7.7/gcc-static-local-var-4.test deleted file mode 100755 index e085f9345..000000000 --- a/test/integration/rhel-7.7/gcc-static-local-var-4.test +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -set -o pipefail -if ! $(eu-readelf --wide --symbols test-gcc-static-local-var-4.ko | awk '$NF == "free_ioctx" { exit 1 }'); then - exit 1 -else - exit 0 -fi diff --git a/test/integration/rhel-7.7/gcc-static-local-var-5.patch b/test/integration/rhel-7.7/gcc-static-local-var-5.patch deleted file mode 100644 index 3028676b1..000000000 --- a/test/integration/rhel-7.7/gcc-static-local-var-5.patch +++ /dev/null @@ -1,46 +0,0 @@ -Index: kernel/kernel/audit.c -=================================================================== ---- kernel.orig/kernel/audit.c -+++ kernel/kernel/audit.c -@@ -205,6 +205,12 @@ void audit_panic(const char *message) - } - } - -+void kpatch_audit_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch audit foo\n"); -+} -+ - static inline int audit_rate_check(void) - { - static unsigned long last_check = 0; -@@ -215,6 +221,7 @@ static inline int audit_rate_check(void) - unsigned long elapsed; - int retval = 0; - -+ kpatch_audit_foo(); - if (!audit_rate_limit) return 1; - - spin_lock_irqsave(&lock, flags); -@@ -234,6 +241,11 @@ static inline int audit_rate_check(void) - return retval; - } - -+noinline void kpatch_audit_check(void) -+{ -+ audit_rate_check(); -+} -+ - /** - * audit_log_lost - conditionally log lost audit message event - * @message: the message stating reason for lost audit message -@@ -282,6 +294,8 @@ static int audit_log_config_change(char - struct audit_buffer *ab; - int rc = 0; - -+ kpatch_audit_check(); -+ - ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE); - if (unlikely(!ab)) - return rc; diff --git a/test/integration/rhel-7.7/gcc-static-local-var-6.patch b/test/integration/rhel-7.7/gcc-static-local-var-6.patch deleted file mode 100644 index 53c39469c..000000000 --- a/test/integration/rhel-7.7/gcc-static-local-var-6.patch +++ /dev/null @@ -1,23 +0,0 @@ -Index: kernel/net/ipv6/netfilter.c -=================================================================== ---- kernel.orig/net/ipv6/netfilter.c -+++ kernel/net/ipv6/netfilter.c -@@ -112,6 +112,8 @@ static int nf_ip6_reroute(struct sk_buff - return 0; - } - -+#include "kpatch-macros.h" -+ - static int nf_ip6_route(struct net *net, struct dst_entry **dst, - struct flowi *fl, bool strict) - { -@@ -125,6 +127,9 @@ static int nf_ip6_route(struct net *net, - struct dst_entry *result; - int err; - -+ if (!jiffies) -+ printk("kpatch nf_ip6_route foo\n"); -+ - result = ip6_route_output(net, sk, &fl->u.ip6); - err = result->error; - if (err) diff --git a/test/integration/rhel-7.7/macro-callbacks.patch b/test/integration/rhel-7.7/macro-callbacks.patch deleted file mode 100644 index d6757e03f..000000000 --- a/test/integration/rhel-7.7/macro-callbacks.patch +++ /dev/null @@ -1,166 +0,0 @@ -kpatch/livepatch callback test patch: - - vmlinux - pcspkr (mod) - joydev (mod) - -Note: update joydev's pre-patch callback to return -ENODEV to test failure path - -Index: kernel/fs/aio.c -=================================================================== ---- kernel.orig/fs/aio.c -+++ kernel/fs/aio.c -@@ -42,6 +42,50 @@ - #include - #include - -+#include -+#include "kpatch-macros.h" -+ -+static const char *const module_state[] = { -+ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", -+ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", -+ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", -+ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", -+}; -+ -+static void callback_info(const char *callback, patch_object *obj) -+{ -+ if (obj->mod) -+ pr_info("%s: %s -> %s\n", callback, obj->mod->name, -+ module_state[obj->mod->state]); -+ else -+ pr_info("%s: vmlinux\n", callback); -+} -+ -+static int pre_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+ return 0; -+} -+KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); -+ -+static void post_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_PATCH_CALLBACK(post_patch_callback); -+ -+static void pre_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); -+ -+static void post_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); -+ - #define AIO_RING_MAGIC 0xa10a10a1 - #define AIO_RING_COMPAT_FEATURES 1 - #define AIO_RING_INCOMPAT_FEATURES 0 -Index: kernel/drivers/input/joydev.c -=================================================================== ---- kernel.orig/drivers/input/joydev.c -+++ kernel/drivers/input/joydev.c -@@ -954,3 +954,47 @@ static void __exit joydev_exit(void) - - module_init(joydev_init); - module_exit(joydev_exit); -+ -+#include -+#include "kpatch-macros.h" -+ -+static const char *const module_state[] = { -+ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", -+ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", -+ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", -+ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", -+}; -+ -+static void callback_info(const char *callback, patch_object *obj) -+{ -+ if (obj->mod) -+ pr_info("%s: %s -> %s\n", callback, obj->mod->name, -+ module_state[obj->mod->state]); -+ else -+ pr_info("%s: vmlinux\n", callback); -+} -+ -+static int pre_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+ return 0; /* return -ENODEV; */ -+} -+KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); -+ -+static void post_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_PATCH_CALLBACK(post_patch_callback); -+ -+static void pre_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); -+ -+static void post_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); -Index: kernel/drivers/input/misc/pcspkr.c -=================================================================== ---- kernel.orig/drivers/input/misc/pcspkr.c -+++ kernel/drivers/input/misc/pcspkr.c -@@ -136,3 +136,46 @@ static struct platform_driver pcspkr_pla - }; - module_platform_driver(pcspkr_platform_driver); - -+#include -+#include "kpatch-macros.h" -+ -+static const char *const module_state[] = { -+ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", -+ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", -+ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", -+ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", -+}; -+ -+static void callback_info(const char *callback, patch_object *obj) -+{ -+ if (obj->mod) -+ pr_info("%s: %s -> %s\n", callback, obj->mod->name, -+ module_state[obj->mod->state]); -+ else -+ pr_info("%s: vmlinux\n", callback); -+} -+ -+static int pre_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+ return 0; -+} -+KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); -+ -+static void post_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_PATCH_CALLBACK(post_patch_callback); -+ -+static void pre_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); -+ -+static void post_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); diff --git a/test/integration/rhel-7.7/macro-printk.patch b/test/integration/rhel-7.7/macro-printk.patch deleted file mode 100644 index a4ff62c60..000000000 --- a/test/integration/rhel-7.7/macro-printk.patch +++ /dev/null @@ -1,151 +0,0 @@ -Index: kernel/net/ipv4/fib_frontend.c -=================================================================== ---- kernel.orig/net/ipv4/fib_frontend.c -+++ kernel/net/ipv4/fib_frontend.c -@@ -686,6 +686,7 @@ errout: - return err; - } - -+#include "kpatch-macros.h" - static int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh) - { - struct net *net = sock_net(skb->sk); -@@ -704,6 +705,7 @@ static int inet_rtm_newroute(struct sk_b - } - - err = fib_table_insert(net, tb, &cfg); -+ KPATCH_PRINTK("[inet_rtm_newroute]: err is %d\n", err); - errout: - return err; - } -Index: kernel/net/ipv4/fib_semantics.c -=================================================================== ---- kernel.orig/net/ipv4/fib_semantics.c -+++ kernel/net/ipv4/fib_semantics.c -@@ -985,6 +985,7 @@ fib_convert_metrics(struct fib_info *fi, - return 0; - } - -+#include "kpatch-macros.h" - struct fib_info *fib_create_info(struct fib_config *cfg) - { - int err; -@@ -1009,6 +1010,7 @@ struct fib_info *fib_create_info(struct - #endif - - err = -ENOBUFS; -+ KPATCH_PRINTK("[fib_create_info]: create error err is %d\n",err); - if (fib_info_cnt >= fib_info_hash_size) { - unsigned int new_size = fib_info_hash_size << 1; - struct hlist_head *new_info_hash; -@@ -1029,6 +1031,7 @@ struct fib_info *fib_create_info(struct - if (!fib_info_hash_size) - goto failure; - } -+ KPATCH_PRINTK("[fib_create_info]: 2 create error err is %d\n",err); - - fi = kzalloc(sizeof(*fi)+nhs*sizeof(struct fib_nh), GFP_KERNEL); - if (fi == NULL) -@@ -1044,6 +1047,8 @@ struct fib_info *fib_create_info(struct - fi->fib_metrics = (struct dst_metrics *)&dst_default_metrics; - } - fib_info_cnt++; -+ KPATCH_PRINTK("[fib_create_info]: 3 create error err is %d\n",err); -+ - fi->fib_net = net; - fi->fib_protocol = cfg->fc_protocol; - fi->fib_scope = cfg->fc_scope; -@@ -1059,8 +1064,10 @@ struct fib_info *fib_create_info(struct - if (!nexthop_nh->nh_pcpu_rth_output) - goto failure; - } endfor_nexthops(fi) -+ KPATCH_PRINTK("[fib_create_info]: 4 create error err is %d\n",err); - - err = fib_convert_metrics(fi, cfg); -+ KPATCH_PRINTK("[fib_create_info]: 5 create error err is %d\n",err); - if (err) - goto failure; - -@@ -1111,6 +1118,7 @@ struct fib_info *fib_create_info(struct - nh->nh_weight = 1; - #endif - } -+ KPATCH_PRINTK("[fib_create_info]: 6 create error err is %d\n",err); - - if (fib_props[cfg->fc_type].error) { - if (cfg->fc_gw || cfg->fc_oif || cfg->fc_mp) -@@ -1128,6 +1136,7 @@ struct fib_info *fib_create_info(struct - goto err_inval; - } - } -+ KPATCH_PRINTK("[fib_create_info]: 7 create error err is %d\n",err); - - if (cfg->fc_scope > RT_SCOPE_HOST) - goto err_inval; -@@ -1150,6 +1159,7 @@ struct fib_info *fib_create_info(struct - goto failure; - } endfor_nexthops(fi) - } -+ KPATCH_PRINTK("[fib_create_info]: 8 create error err is %d\n",err); - - if (fi->fib_prefsrc) { - if (cfg->fc_type != RTN_LOCAL || !cfg->fc_dst || -@@ -1162,6 +1172,7 @@ struct fib_info *fib_create_info(struct - fib_info_update_nh_saddr(net, nexthop_nh); - fib_add_weight(fi, nexthop_nh); - } endfor_nexthops(fi) -+ KPATCH_PRINTK("[fib_create_info]: 9 create error err is %d\n",err); - - fib_rebalance(fi); - -@@ -1173,6 +1184,7 @@ link_it: - ofi->fib_treeref++; - return ofi; - } -+ KPATCH_PRINTK("[fib_create_info]: 10 create error err is %d\n",err); - - fi->fib_treeref++; - atomic_inc(&fi->fib_clntref); -@@ -1196,6 +1208,7 @@ link_it: - hlist_add_head(&nexthop_nh->nh_hash, head); - } endfor_nexthops(fi) - spin_unlock_bh(&fib_info_lock); -+ KPATCH_PRINTK("[fib_create_info]: 11 create error err is %d\n",err); - return fi; - - err_inval: -@@ -1206,6 +1219,7 @@ failure: - fi->fib_dead = 1; - free_fib_info(fi); - } -+ KPATCH_PRINTK("[fib_create_info]: 12 create error err is %d\n",err); - - return ERR_PTR(err); - } -Index: kernel/net/ipv4/fib_trie.c -=================================================================== ---- kernel.orig/net/ipv4/fib_trie.c -+++ kernel/net/ipv4/fib_trie.c -@@ -1105,6 +1105,7 @@ static int fib_insert_alias(struct trie - } - - /* Caller must hold RTNL. */ -+#include "kpatch-macros.h" - int fib_table_insert(struct net *net, struct fib_table *tb, - struct fib_config *cfg) - { -@@ -1130,11 +1131,14 @@ int fib_table_insert(struct net *net, st - if ((plen < KEYLENGTH) && (key << plen)) - return -EINVAL; - -+ KPATCH_PRINTK("[fib_table_insert]: start\n"); - fi = fib_create_info(cfg); - if (IS_ERR(fi)) { - err = PTR_ERR(fi); -+ KPATCH_PRINTK("[fib_table_insert]: create error err is %d\n",err); - goto err; - } -+ KPATCH_PRINTK("[fib_table_insert]: cross\n"); - - l = fib_find_node(t, &tp, key); - fa = l ? fib_find_alias(&l->leaf, slen, tos, fi->fib_priority, diff --git a/test/integration/rhel-7.7/meminfo-init-FAIL.patch b/test/integration/rhel-7.7/meminfo-init-FAIL.patch deleted file mode 100644 index f3e6c7317..000000000 --- a/test/integration/rhel-7.7/meminfo-init-FAIL.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: kernel/fs/proc/meminfo.c -=================================================================== ---- kernel.orig/fs/proc/meminfo.c -+++ kernel/fs/proc/meminfo.c -@@ -199,6 +199,7 @@ static const struct file_operations memi - - static int __init proc_meminfo_init(void) - { -+ printk("a\n"); - proc_create("meminfo", 0, NULL, &meminfo_proc_fops); - return 0; - } diff --git a/test/integration/rhel-7.7/meminfo-init2-FAIL.patch b/test/integration/rhel-7.7/meminfo-init2-FAIL.patch deleted file mode 100644 index e2252945c..000000000 --- a/test/integration/rhel-7.7/meminfo-init2-FAIL.patch +++ /dev/null @@ -1,20 +0,0 @@ -Index: kernel/fs/proc/meminfo.c -=================================================================== ---- kernel.orig/fs/proc/meminfo.c -+++ kernel/fs/proc/meminfo.c -@@ -30,6 +30,7 @@ static int meminfo_proc_show(struct seq_ - unsigned long pages[NR_LRU_LISTS]; - int lru; - -+ printk("a\n"); - /* - * display in kilobytes. - */ -@@ -199,6 +200,7 @@ static const struct file_operations memi - - static int __init proc_meminfo_init(void) - { -+ printk("a\n"); - proc_create("meminfo", 0, NULL, &meminfo_proc_fops); - return 0; - } diff --git a/test/integration/rhel-7.7/meminfo-string-LOADED.test b/test/integration/rhel-7.7/meminfo-string-LOADED.test deleted file mode 100755 index 10dc20b3d..000000000 --- a/test/integration/rhel-7.7/meminfo-string-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep VMALLOCCHUNK /proc/meminfo diff --git a/test/integration/rhel-7.7/meminfo-string.patch b/test/integration/rhel-7.7/meminfo-string.patch deleted file mode 100644 index 23ff7a7a0..000000000 --- a/test/integration/rhel-7.7/meminfo-string.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: kernel/fs/proc/meminfo.c -=================================================================== ---- kernel.orig/fs/proc/meminfo.c -+++ kernel/fs/proc/meminfo.c -@@ -99,7 +99,7 @@ static int meminfo_proc_show(struct seq_ - "Committed_AS: %8lu kB\n" - "VmallocTotal: %8lu kB\n" - "VmallocUsed: %8lu kB\n" -- "VmallocChunk: %8lu kB\n" -+ "VMALLOCCHUNK: %8lu kB\n" - #ifdef CONFIG_MEMORY_FAILURE - "HardwareCorrupted: %5lu kB\n" - #endif diff --git a/test/integration/rhel-7.7/module-call-external.patch b/test/integration/rhel-7.7/module-call-external.patch deleted file mode 100644 index f149edf16..000000000 --- a/test/integration/rhel-7.7/module-call-external.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c -index 27459a453bb8..2247255877be 100644 ---- a/fs/nfsd/export.c -+++ b/fs/nfsd/export.c -@@ -1184,7 +1184,13 @@ static void exp_flags(struct seq_file *m, int flag, int fsid, - } - } - -+extern char *kpatch_string(void); -+ -+#ifdef CONFIG_PPC64 -+static int __attribute__((optimize("-fno-optimize-sibling-calls"))) e_show(struct seq_file *m, void *p) -+#else - static int e_show(struct seq_file *m, void *p) -+#endif - { - struct cache_head *cp = p; - struct svc_export *exp = container_of(cp, struct svc_export, h); -@@ -1193,6 +1199,7 @@ static int e_show(struct seq_file *m, void *p) - if (p == SEQ_START_TOKEN) { - seq_puts(m, "# Version 1.1\n"); - seq_puts(m, "# Path Client(Flags) # IPs\n"); -+ seq_puts(m, kpatch_string()); - return 0; - } - -diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c -index 592f64643491..21b87cb948c9 100644 ---- a/net/netlink/af_netlink.c -+++ b/net/netlink/af_netlink.c -@@ -2568,4 +2568,9 @@ panic: - panic("netlink_init: Cannot allocate nl_table\n"); - } - -+char *kpatch_string(void) -+{ -+ return "# kpatch\n"; -+} -+ - core_initcall(netlink_proto_init); diff --git a/test/integration/rhel-7.7/multiple.test b/test/integration/rhel-7.7/multiple.test deleted file mode 100755 index 7e4b3525c..000000000 --- a/test/integration/rhel-7.7/multiple.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -SCRIPTDIR="$(readlink -f $(dirname $(type -p $0)))" - -declare -a blacklist=(meminfo-string-LOADED.test) - -source ${SCRIPTDIR}/../common/multiple.template diff --git a/test/integration/rhel-7.7/new-function.patch b/test/integration/rhel-7.7/new-function.patch deleted file mode 100644 index 604dbe5df..000000000 --- a/test/integration/rhel-7.7/new-function.patch +++ /dev/null @@ -1,26 +0,0 @@ -Index: kernel/drivers/tty/n_tty.c -=================================================================== ---- kernel.orig/drivers/tty/n_tty.c -+++ kernel/drivers/tty/n_tty.c -@@ -2175,7 +2175,7 @@ do_it_again: - * lock themselves) - */ - --static ssize_t n_tty_write(struct tty_struct *tty, struct file *file, -+static ssize_t noinline kpatch_n_tty_write(struct tty_struct *tty, struct file *file, - const unsigned char *buf, size_t nr) - { - const unsigned char *b = buf; -@@ -2264,6 +2264,12 @@ break_out: - return (b - buf) ? b - buf : retval; - } - -+static ssize_t __attribute__((optimize("-fno-optimize-sibling-calls"))) n_tty_write(struct tty_struct *tty, struct file *file, -+ const unsigned char *buf, size_t nr) -+{ -+ return kpatch_n_tty_write(tty, file, buf, nr); -+} -+ - /** - * n_tty_poll - poll method for N_TTY - * @tty: terminal device diff --git a/test/integration/rhel-7.7/new-globals.patch b/test/integration/rhel-7.7/new-globals.patch deleted file mode 100644 index e18d09d51..000000000 --- a/test/integration/rhel-7.7/new-globals.patch +++ /dev/null @@ -1,36 +0,0 @@ -Index: kernel/fs/proc/cmdline.c -=================================================================== ---- kernel.orig/fs/proc/cmdline.c -+++ kernel/fs/proc/cmdline.c -@@ -27,3 +27,10 @@ static int __init proc_cmdline_init(void - return 0; - } - module_init(proc_cmdline_init); -+ -+#include -+void kpatch_print_message(void) -+{ -+ if (!jiffies) -+ printk("hello there!\n"); -+} -Index: kernel/fs/proc/meminfo.c -=================================================================== ---- kernel.orig/fs/proc/meminfo.c -+++ kernel/fs/proc/meminfo.c -@@ -16,6 +16,8 @@ - #include - #include "internal.h" - -+void kpatch_print_message(void); -+ - void __attribute__((weak)) arch_report_meminfo(struct seq_file *m) - { - } -@@ -53,6 +55,7 @@ static int meminfo_proc_show(struct seq_ - /* - * Tagged format, for easy grepping and expansion. - */ -+ kpatch_print_message(); - seq_printf(m, - "MemTotal: %8lu kB\n" - "MemFree: %8lu kB\n" diff --git a/test/integration/rhel-7.7/parainstructions-section.patch b/test/integration/rhel-7.7/parainstructions-section.patch deleted file mode 100644 index 151d2631e..000000000 --- a/test/integration/rhel-7.7/parainstructions-section.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: kernel/fs/proc/generic.c -=================================================================== ---- kernel.orig/fs/proc/generic.c -+++ kernel/fs/proc/generic.c -@@ -194,6 +194,7 @@ int proc_alloc_inum(unsigned int *inum) - unsigned int i; - int error; - -+ printk("kpatch-test: testing change to .parainstructions section\n"); - retry: - if (!ida_pre_get(&proc_inum_ida, GFP_KERNEL)) - return -ENOMEM; diff --git a/test/integration/rhel-7.7/shadow-newpid-LOADED.test b/test/integration/rhel-7.7/shadow-newpid-LOADED.test deleted file mode 100755 index c07d11205..000000000 --- a/test/integration/rhel-7.7/shadow-newpid-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep -q newpid: /proc/$$/status diff --git a/test/integration/rhel-7.7/shadow-newpid.patch b/test/integration/rhel-7.7/shadow-newpid.patch deleted file mode 100644 index cae690dd7..000000000 --- a/test/integration/rhel-7.7/shadow-newpid.patch +++ /dev/null @@ -1,72 +0,0 @@ -Index: kernel/fs/proc/array.c -=================================================================== ---- kernel.orig/fs/proc/array.c -+++ kernel/fs/proc/array.c -@@ -395,13 +395,20 @@ static inline void task_seccomp(struct s - seq_putc(m, '\n'); - } - -+#include - static inline void task_context_switch_counts(struct seq_file *m, - struct task_struct *p) - { -+ int *newpid; -+ - seq_printf(m, "voluntary_ctxt_switches:\t%lu\n" - "nonvoluntary_ctxt_switches:\t%lu\n", - p->nvcsw, - p->nivcsw); -+ -+ newpid = klp_shadow_get(p, 0); -+ if (newpid) -+ seq_printf(m, "newpid:\t%d\n", *newpid); - } - - static void task_cpus_allowed(struct seq_file *m, struct task_struct *task) -Index: kernel/kernel/exit.c -=================================================================== ---- kernel.orig/kernel/exit.c -+++ kernel/kernel/exit.c -@@ -791,6 +791,7 @@ static void check_stack_usage(void) - static inline void check_stack_usage(void) {} - #endif - -+#include - void do_exit(long code) - { - struct task_struct *tsk = current; -@@ -888,6 +889,8 @@ void do_exit(long code) - check_stack_usage(); - exit_thread(); - -+ klp_shadow_free(tsk, 0, NULL); -+ - /* - * Flush inherited counters to the parent - before the parent - * gets woken up by child-exit notifications. -Index: kernel/kernel/fork.c -=================================================================== ---- kernel.orig/kernel/fork.c -+++ kernel/kernel/fork.c -@@ -1760,6 +1760,7 @@ struct task_struct *fork_idle(int cpu) - * It copies the process, and if successful kick-starts - * it and waits for it to finish using the VM if required. - */ -+#include - long do_fork(unsigned long clone_flags, - unsigned long stack_start, - unsigned long stack_size, -@@ -1797,6 +1798,13 @@ long do_fork(unsigned long clone_flags, - if (!IS_ERR(p)) { - struct completion vfork; - struct pid *pid; -+ int *newpid; -+ static int ctr = 0; -+ -+ newpid = klp_shadow_get_or_alloc(p, 0, sizeof(*newpid), GFP_KERNEL, -+ NULL, NULL); -+ if (newpid) -+ *newpid = ctr++; - - trace_sched_process_fork(current, p); - diff --git a/test/integration/rhel-7.7/smp-locks-section.patch b/test/integration/rhel-7.7/smp-locks-section.patch deleted file mode 100644 index 7aa1c3108..000000000 --- a/test/integration/rhel-7.7/smp-locks-section.patch +++ /dev/null @@ -1,15 +0,0 @@ -Index: kernel/drivers/tty/tty_buffer.c -=================================================================== ---- kernel.orig/drivers/tty/tty_buffer.c -+++ kernel/drivers/tty/tty_buffer.c -@@ -217,6 +217,10 @@ int tty_buffer_request_room(struct tty_p - /* OPTIMISATION: We could keep a per tty "zero" sized buffer to - remove this conditional if its worth it. This would be invisible - to the callers */ -+ -+ if (!size) -+ printk("kpatch-test: testing .smp_locks section changes\n"); -+ - b = buf->tail; - if (b != NULL) - left = b->size - b->used; diff --git a/test/integration/rhel-7.7/special-static.patch b/test/integration/rhel-7.7/special-static.patch deleted file mode 100644 index 8a757ba51..000000000 --- a/test/integration/rhel-7.7/special-static.patch +++ /dev/null @@ -1,23 +0,0 @@ -Index: kernel/kernel/fork.c -=================================================================== ---- kernel.orig/kernel/fork.c -+++ kernel/kernel/fork.c -@@ -1146,10 +1146,18 @@ static void posix_cpu_timers_init_group( - INIT_LIST_HEAD(&sig->cpu_timers[2]); - } - -+void kpatch_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch copy signal\n"); -+} -+ - static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) - { - struct signal_struct *sig; - -+ kpatch_foo(); -+ - if (clone_flags & CLONE_THREAD) - return 0; - diff --git a/test/integration/rhel-7.7/symvers-disagreement-FAIL.patch b/test/integration/rhel-7.7/symvers-disagreement-FAIL.patch deleted file mode 100644 index e94064512..000000000 --- a/test/integration/rhel-7.7/symvers-disagreement-FAIL.patch +++ /dev/null @@ -1,51 +0,0 @@ -From d5513eae5155c6e7e884554d5e3e2c65a7b39cbe Mon Sep 17 00:00:00 2001 -From: Julien Thierry -Date: Wed, 6 May 2020 14:30:57 +0100 -Subject: [PATCH] Symbol version change - -This change causes: -1) Some exported symbols in drivers/base/core.c to see their CRCs - change. -2) Changes usb_get_dev() referencing a get_device() whose CRC has - changed, causing the symbol and the new CRC to be included in the - __version section of the final module. - -This makes the final module unloadable for the target kernel. - -See "Exported symbol versioning" of the patch author guide for more -detail. - ---- - drivers/base/core.c | 2 ++ - drivers/usb/core/usb.c | 2 ++ - 2 files changed, 4 insertions(+) - -diff --git a/drivers/base/core.c b/drivers/base/core.c -index b9a71137208..4af27e069c2 100644 ---- a/drivers/base/core.c -+++ b/drivers/base/core.c -@@ -31,6 +31,8 @@ - #include "base.h" - #include "power/power.h" - -+#include -+ - #ifdef CONFIG_SYSFS_DEPRECATED - #ifdef CONFIG_SYSFS_DEPRECATED_V2 - long sysfs_deprecated = 1; -diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c -index d6337db2164..0ff9722dfa2 100644 ---- a/drivers/usb/core/usb.c -+++ b/drivers/usb/core/usb.c -@@ -693,6 +693,8 @@ EXPORT_SYMBOL_GPL(usb_alloc_dev); - */ - struct usb_device *usb_get_dev(struct usb_device *dev) - { -+ barrier(); -+ - if (dev) - get_device(&dev->dev); - return dev; --- -2.21.3 - diff --git a/test/integration/rhel-7.7/tracepoints-section.patch b/test/integration/rhel-7.7/tracepoints-section.patch deleted file mode 100644 index b992e14dd..000000000 --- a/test/integration/rhel-7.7/tracepoints-section.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: kernel/kernel/timer.c -=================================================================== ---- kernel.orig/kernel/timer.c -+++ kernel/kernel/timer.c -@@ -1454,6 +1454,9 @@ static void run_timer_softirq(struct sof - { - struct tvec_base *base = __this_cpu_read(tvec_bases); - -+ if (!base) -+ printk("kpatch-test: testing __tracepoints section changes\n"); -+ - if (time_after_eq(jiffies, base->timer_jiffies)) - __run_timers(base); - } diff --git a/test/integration/rhel-7.7/warn-detect-FAIL.patch b/test/integration/rhel-7.7/warn-detect-FAIL.patch deleted file mode 100644 index 801fa4c8d..000000000 --- a/test/integration/rhel-7.7/warn-detect-FAIL.patch +++ /dev/null @@ -1,9 +0,0 @@ -Index: kernel/arch/x86/kvm/x86.c -=================================================================== ---- kernel.orig/arch/x86/kvm/x86.c -+++ kernel/arch/x86/kvm/x86.c -@@ -1,3 +1,4 @@ -+ - /* - * Kernel-based Virtual Machine driver for Linux - * diff --git a/test/integration/rhel-8.0/README b/test/integration/rhel-8.0/README deleted file mode 100644 index d46fbcba4..000000000 --- a/test/integration/rhel-8.0/README +++ /dev/null @@ -1 +0,0 @@ -4.18.0-80.el8 diff --git a/test/integration/rhel-8.0/bug-table-section.patch b/test/integration/rhel-8.0/bug-table-section.patch deleted file mode 100644 index 842ae4a12..000000000 --- a/test/integration/rhel-8.0/bug-table-section.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c -index 89921a0..ac129b6 100644 ---- a/fs/proc/proc_sysctl.c -+++ b/fs/proc/proc_sysctl.c -@@ -333,6 +333,8 @@ static void start_unregistering(struct ctl_table_header *p) - - static struct ctl_table_header *sysctl_head_grab(struct ctl_table_header *head) - { -+ if (jiffies == 0) -+ printk("kpatch-test: testing __bug_table section changes\n"); - BUG_ON(!head); - spin_lock(&sysctl_lock); - if (!use_table(head)) diff --git a/test/integration/rhel-8.0/cmdline-string-LOADED.test b/test/integration/rhel-8.0/cmdline-string-LOADED.test deleted file mode 100755 index a8e0a0817..000000000 --- a/test/integration/rhel-8.0/cmdline-string-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep kpatch=1 /proc/cmdline diff --git a/test/integration/rhel-8.0/cmdline-string.patch b/test/integration/rhel-8.0/cmdline-string.patch deleted file mode 100644 index 665c763aa..000000000 --- a/test/integration/rhel-8.0/cmdline-string.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/fs/proc/cmdline.c b/fs/proc/cmdline.c -index fa762c5..bd66027 100644 ---- a/fs/proc/cmdline.c -+++ b/fs/proc/cmdline.c -@@ -6,8 +6,7 @@ - - static int cmdline_proc_show(struct seq_file *m, void *v) - { -- seq_puts(m, saved_command_line); -- seq_putc(m, '\n'); -+ seq_printf(m, "%s kpatch=1\n", saved_command_line); - return 0; - } - diff --git a/test/integration/rhel-8.0/data-new-LOADED.test b/test/integration/rhel-8.0/data-new-LOADED.test deleted file mode 100755 index 9f25744e6..000000000 --- a/test/integration/rhel-8.0/data-new-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep "kpatch: 5" /proc/meminfo diff --git a/test/integration/rhel-8.0/data-new.patch b/test/integration/rhel-8.0/data-new.patch deleted file mode 100644 index 78d1b97a9..000000000 --- a/test/integration/rhel-8.0/data-new.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c -index 2fb0484..79ead86 100644 ---- a/fs/proc/meminfo.c -+++ b/fs/proc/meminfo.c -@@ -30,6 +30,8 @@ static void show_val_kb(struct seq_file *m, const char *s, unsigned long num) - seq_write(m, " kB\n", 4); - } - -+static int foo = 5; -+ - static int meminfo_proc_show(struct seq_file *m, void *v) - { - struct sysinfo i; -@@ -141,6 +143,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v) - show_val_kb(m, "CmaFree: ", - global_zone_page_state(NR_FREE_CMA_PAGES)); - #endif -+ seq_printf(m, "kpatch: %d\n", foo); - - hugetlb_report_meminfo(m); - diff --git a/test/integration/rhel-8.0/data-read-mostly.patch.disabled b/test/integration/rhel-8.0/data-read-mostly.patch.disabled deleted file mode 100644 index ed4eef072..000000000 --- a/test/integration/rhel-8.0/data-read-mostly.patch.disabled +++ /dev/null @@ -1,14 +0,0 @@ -Disabled due to https://github.com/dynup/kpatch/issues/940 ---- -diff --git a/net/core/dev.c b/net/core/dev.c -index b6f9647..b376a48 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -4858,6 +4858,7 @@ static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc) - case RX_HANDLER_PASS: - break; - default: -+ printk("BUG!\n"); - BUG(); - } - } diff --git a/test/integration/rhel-8.0/fixup-section.patch b/test/integration/rhel-8.0/fixup-section.patch deleted file mode 100644 index 78ab6dd02..000000000 --- a/test/integration/rhel-8.0/fixup-section.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/fs/readdir.c b/fs/readdir.c -index d97f548..58863b6 100644 ---- a/fs/readdir.c -+++ b/fs/readdir.c -@@ -189,6 +189,7 @@ static int filldir(struct dir_context *ctx, const char *name, int namlen, - goto efault; - } - dirent = buf->current_dir; -+ asm("nop"); - if (__put_user(d_ino, &dirent->d_ino)) - goto efault; - if (__put_user(reclen, &dirent->d_reclen)) diff --git a/test/integration/rhel-8.0/gcc-constprop.patch.disabled b/test/integration/rhel-8.0/gcc-constprop.patch.disabled deleted file mode 100644 index 3fbc57736..000000000 --- a/test/integration/rhel-8.0/gcc-constprop.patch.disabled +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c -index 4786df9..c73a687 100644 ---- a/kernel/time/timekeeping.c -+++ b/kernel/time/timekeeping.c -@@ -1211,6 +1211,9 @@ void do_gettimeofday(struct timeval *tv) - { - struct timespec64 now; - -+ if (!tv) -+ return; -+ - getnstimeofday64(&now); - tv->tv_sec = now.tv_sec; - tv->tv_usec = now.tv_nsec/1000; diff --git a/test/integration/rhel-8.0/gcc-isra.patch b/test/integration/rhel-8.0/gcc-isra.patch deleted file mode 100644 index 0903f24d6..000000000 --- a/test/integration/rhel-8.0/gcc-isra.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c -index 89921a0..199b1d7 100644 ---- a/fs/proc/proc_sysctl.c -+++ b/fs/proc/proc_sysctl.c -@@ -48,6 +48,7 @@ void proc_sys_poll_notify(struct ctl_table_poll *poll) - if (!poll) - return; - -+ printk("kpatch-test: testing gcc .isra function name mangling\n"); - atomic_inc(&poll->event); - wake_up_interruptible(&poll->wait); - } diff --git a/test/integration/rhel-8.0/gcc-mangled-3.patch b/test/integration/rhel-8.0/gcc-mangled-3.patch deleted file mode 100644 index bcb5e625b..000000000 --- a/test/integration/rhel-8.0/gcc-mangled-3.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/mm/slub.c b/mm/slub.c -index 51258ef..3cb5264 100644 ---- a/mm/slub.c -+++ b/mm/slub.c -@@ -5852,6 +5852,9 @@ void get_slabinfo(struct kmem_cache *s, struct slabinfo *sinfo) - int node; - struct kmem_cache_node *n; - -+ if (!jiffies) -+ printk("slabinfo\n"); -+ - for_each_kmem_cache_node(s, node, n) { - nr_slabs += node_nr_slabs(n); - nr_objs += node_nr_objs(n); diff --git a/test/integration/rhel-8.0/gcc-static-local-var-2.patch b/test/integration/rhel-8.0/gcc-static-local-var-2.patch deleted file mode 100644 index a884bfa97..000000000 --- a/test/integration/rhel-8.0/gcc-static-local-var-2.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/mm/mmap.c b/mm/mmap.c -index bf46096..4bc085c 100644 ---- a/mm/mmap.c -+++ b/mm/mmap.c -@@ -1684,6 +1684,9 @@ unsigned long mmap_region(struct file *file, unsigned long addr, - struct rb_node **rb_link, *rb_parent; - unsigned long charged = 0; - -+ if (!jiffies) -+ printk("kpatch mmap foo\n"); -+ - /* Check against address space limit. */ - if (!may_expand_vm(mm, vm_flags, len >> PAGE_SHIFT)) { - unsigned long nr_pages; diff --git a/test/integration/rhel-8.0/gcc-static-local-var-3.patch b/test/integration/rhel-8.0/gcc-static-local-var-3.patch deleted file mode 100644 index da2acc0e2..000000000 --- a/test/integration/rhel-8.0/gcc-static-local-var-3.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/kernel/reboot.c b/kernel/reboot.c -index e4ced88..0c0b5a2 100644 ---- a/kernel/reboot.c -+++ b/kernel/reboot.c -@@ -393,8 +393,15 @@ void kernel_power_off(void) - return ret; - } - -+void kpatch_bar(void) -+{ -+ if (!jiffies) -+ printk("kpatch_foo\n"); -+} -+ - static void deferred_cad(struct work_struct *dummy) - { -+ kpatch_bar(); - kernel_restart(NULL); - } - diff --git a/test/integration/rhel-8.0/gcc-static-local-var-4.patch.disabled b/test/integration/rhel-8.0/gcc-static-local-var-4.patch.disabled deleted file mode 100644 index 17e269dd6..000000000 --- a/test/integration/rhel-8.0/gcc-static-local-var-4.patch.disabled +++ /dev/null @@ -1,25 +0,0 @@ -Disabled due to https://github.com/dynup/kpatch/issues/940 ---- -diff --git a/fs/aio.c b/fs/aio.c -index e1f8f01..4dfb05c 100644 ---- a/fs/aio.c -+++ b/fs/aio.c -@@ -263,11 +263,18 @@ static int __init aio_setup(void) - } - __initcall(aio_setup); - -+void kpatch_aio_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch aio foo\n"); -+} -+ - static void put_aio_ring_file(struct kioctx *ctx) - { - struct file *aio_ring_file = ctx->aio_ring_file; - struct address_space *i_mapping; - -+ kpatch_aio_foo(); - if (aio_ring_file) { - truncate_setsize(file_inode(aio_ring_file), 0); - diff --git a/test/integration/rhel-8.0/gcc-static-local-var-4.test.disabled b/test/integration/rhel-8.0/gcc-static-local-var-4.test.disabled deleted file mode 100755 index e085f9345..000000000 --- a/test/integration/rhel-8.0/gcc-static-local-var-4.test.disabled +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -set -o pipefail -if ! $(eu-readelf --wide --symbols test-gcc-static-local-var-4.ko | awk '$NF == "free_ioctx" { exit 1 }'); then - exit 1 -else - exit 0 -fi diff --git a/test/integration/rhel-8.0/gcc-static-local-var-5.patch b/test/integration/rhel-8.0/gcc-static-local-var-5.patch deleted file mode 100644 index 0e3e2d347..000000000 --- a/test/integration/rhel-8.0/gcc-static-local-var-5.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/kernel/audit.c b/kernel/audit.c -index e7478cb..ed2546a 100644 ---- a/kernel/audit.c -+++ b/kernel/audit.c -@@ -325,6 +325,12 @@ void audit_panic(const char *message) - } - } - -+void kpatch_audit_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch audit foo\n"); -+} -+ - static inline int audit_rate_check(void) - { - static unsigned long last_check = 0; -@@ -335,6 +341,7 @@ static inline int audit_rate_check(void) - unsigned long elapsed; - int retval = 0; - -+ kpatch_audit_foo(); - if (!audit_rate_limit) return 1; - - spin_lock_irqsave(&lock, flags); -@@ -354,6 +361,11 @@ static inline int audit_rate_check(void) - return retval; - } - -+noinline void kpatch_audit_check(void) -+{ -+ audit_rate_check(); -+} -+ - /** - * audit_log_lost - conditionally log lost audit message event - * @message: the message stating reason for lost audit message -@@ -400,6 +412,8 @@ static int audit_log_config_change(char *function_name, u32 new, u32 old, - struct audit_buffer *ab; - int rc = 0; - -+ kpatch_audit_check(); -+ - ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE); - if (unlikely(!ab)) - return rc; diff --git a/test/integration/rhel-8.0/gcc-static-local-var-6.patch b/test/integration/rhel-8.0/gcc-static-local-var-6.patch deleted file mode 100644 index 91c72b6f7..000000000 --- a/test/integration/rhel-8.0/gcc-static-local-var-6.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c -index 531d695..a536c74 100644 ---- a/net/ipv6/netfilter.c -+++ b/net/ipv6/netfilter.c -@@ -84,6 +84,8 @@ static int nf_ip6_reroute(struct sk_buff *skb, - return 0; - } - -+#include "kpatch-macros.h" -+ - static int nf_ip6_route(struct net *net, struct dst_entry **dst, - struct flowi *fl, bool strict) - { -@@ -97,6 +99,9 @@ static int nf_ip6_route(struct net *net, struct dst_entry **dst, - struct dst_entry *result; - int err; - -+ if (!jiffies) -+ printk("kpatch nf_ip6_route foo\n"); -+ - result = ip6_route_output(net, sk, &fl->u.ip6); - err = result->error; - if (err) diff --git a/test/integration/rhel-8.0/macro-callbacks.patch b/test/integration/rhel-8.0/macro-callbacks.patch deleted file mode 100644 index b7f0077f3..000000000 --- a/test/integration/rhel-8.0/macro-callbacks.patch +++ /dev/null @@ -1,158 +0,0 @@ -diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c -index 4c1e427..7e46aaf 100644 ---- a/drivers/input/joydev.c -+++ b/drivers/input/joydev.c -@@ -1068,3 +1068,47 @@ static void __exit joydev_exit(void) - - module_init(joydev_init); - module_exit(joydev_exit); -+ -+#include -+#include "kpatch-macros.h" -+ -+static const char *const module_state[] = { -+ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", -+ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", -+ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", -+ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", -+}; -+ -+static void callback_info(const char *callback, patch_object *obj) -+{ -+ if (obj->mod) -+ pr_info("%s: %s -> %s\n", callback, obj->mod->name, -+ module_state[obj->mod->state]); -+ else -+ pr_info("%s: vmlinux\n", callback); -+} -+ -+static int pre_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+ return 0; /* return -ENODEV; */ -+} -+KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); -+ -+static void post_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_PATCH_CALLBACK(post_patch_callback); -+ -+static void pre_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); -+ -+static void post_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); -diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c -index 56ddba2..d188b12 100644 ---- a/drivers/input/misc/pcspkr.c -+++ b/drivers/input/misc/pcspkr.c -@@ -138,3 +138,46 @@ static void pcspkr_shutdown(struct platform_device *dev) - }; - module_platform_driver(pcspkr_platform_driver); - -+#include -+#include "kpatch-macros.h" -+ -+static const char *const module_state[] = { -+ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", -+ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", -+ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", -+ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", -+}; -+ -+static void callback_info(const char *callback, patch_object *obj) -+{ -+ if (obj->mod) -+ pr_info("%s: %s -> %s\n", callback, obj->mod->name, -+ module_state[obj->mod->state]); -+ else -+ pr_info("%s: vmlinux\n", callback); -+} -+ -+static int pre_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+ return 0; -+} -+KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); -+ -+static void post_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_PATCH_CALLBACK(post_patch_callback); -+ -+static void pre_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); -+ -+static void post_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); -diff --git a/fs/aio.c b/fs/aio.c -index e1f8f01..5efe496 100644 ---- a/fs/aio.c -+++ b/fs/aio.c -@@ -49,6 +49,50 @@ - - #define KIOCB_KEY 0 - -+#include -+#include "kpatch-macros.h" -+ -+static const char *const module_state[] = { -+ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", -+ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", -+ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", -+ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", -+}; -+ -+static void callback_info(const char *callback, patch_object *obj) -+{ -+ if (obj->mod) -+ pr_info("%s: %s -> %s\n", callback, obj->mod->name, -+ module_state[obj->mod->state]); -+ else -+ pr_info("%s: vmlinux\n", callback); -+} -+ -+static int pre_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+ return 0; -+} -+KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); -+ -+static void post_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_PATCH_CALLBACK(post_patch_callback); -+ -+static void pre_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); -+ -+static void post_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); -+ - #define AIO_RING_MAGIC 0xa10a10a1 - #define AIO_RING_COMPAT_FEATURES 1 - #define AIO_RING_INCOMPAT_FEATURES 0 diff --git a/test/integration/rhel-8.0/macro-printk.patch.disabled b/test/integration/rhel-8.0/macro-printk.patch.disabled deleted file mode 100644 index dfe0586d4..000000000 --- a/test/integration/rhel-8.0/macro-printk.patch.disabled +++ /dev/null @@ -1,151 +0,0 @@ -diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c -index 0113993..0ea4967 100644 ---- a/net/ipv4/fib_frontend.c -+++ b/net/ipv4/fib_frontend.c -@@ -767,6 +767,7 @@ static int inet_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh, - return err; - } - -+#include "kpatch-macros.h" - static int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, - struct netlink_ext_ack *extack) - { -@@ -788,6 +789,7 @@ static int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, - err = fib_table_insert(net, tb, &cfg, extack); - if (!err && cfg.fc_type == RTN_LOCAL) - net->ipv4.fib_has_custom_local_routes = true; -+ KPATCH_PRINTK("[inet_rtm_newroute]: err is %d\n", err); - errout: - return err; - } -diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c -index 446204c..5b73a01 100644 ---- a/net/ipv4/fib_semantics.c -+++ b/net/ipv4/fib_semantics.c -@@ -1025,6 +1025,7 @@ static bool fib_valid_prefsrc(struct fib_config *cfg, __be32 fib_prefsrc) - fi->fib_metrics->metrics); - } - -+#include "kpatch-macros.h" - struct fib_info *fib_create_info(struct fib_config *cfg, - struct netlink_ext_ack *extack) - { -@@ -1058,6 +1059,7 @@ struct fib_info *fib_create_info(struct fib_config *cfg, - #endif - - err = -ENOBUFS; -+ KPATCH_PRINTK("[fib_create_info]: create error err is %d\n",err); - if (fib_info_cnt >= fib_info_hash_size) { - unsigned int new_size = fib_info_hash_size << 1; - struct hlist_head *new_info_hash; -@@ -1078,6 +1080,7 @@ struct fib_info *fib_create_info(struct fib_config *cfg, - if (!fib_info_hash_size) - goto failure; - } -+ KPATCH_PRINTK("[fib_create_info]: 2 create error err is %d\n",err); - - fi = kzalloc(sizeof(*fi)+nhs*sizeof(struct fib_nh), GFP_KERNEL); - if (!fi) -@@ -1093,6 +1096,8 @@ struct fib_info *fib_create_info(struct fib_config *cfg, - fi->fib_metrics = (struct dst_metrics *)&dst_default_metrics; - } - fib_info_cnt++; -+ KPATCH_PRINTK("[fib_create_info]: 3 create error err is %d\n",err); -+ - fi->fib_net = net; - fi->fib_protocol = cfg->fc_protocol; - fi->fib_scope = cfg->fc_scope; -@@ -1109,8 +1114,10 @@ struct fib_info *fib_create_info(struct fib_config *cfg, - if (!nexthop_nh->nh_pcpu_rth_output) - goto failure; - } endfor_nexthops(fi) -+ KPATCH_PRINTK("[fib_create_info]: 4 create error err is %d\n",err); - - err = fib_convert_metrics(fi, cfg); -+ KPATCH_PRINTK("[fib_create_info]: 5 create error err is %d\n",err); - if (err) - goto failure; - -@@ -1172,6 +1179,7 @@ struct fib_info *fib_create_info(struct fib_config *cfg, - nh->nh_weight = 1; - #endif - } -+ KPATCH_PRINTK("[fib_create_info]: 6 create error err is %d\n",err); - - if (fib_props[cfg->fc_type].error) { - if (cfg->fc_gw || cfg->fc_oif || cfg->fc_mp) { -@@ -1193,6 +1201,7 @@ struct fib_info *fib_create_info(struct fib_config *cfg, - goto err_inval; - } - } -+ KPATCH_PRINTK("[fib_create_info]: 7 create error err is %d\n",err); - - if (cfg->fc_scope > RT_SCOPE_HOST) { - NL_SET_ERR_MSG(extack, "Invalid scope"); -@@ -1231,6 +1240,7 @@ struct fib_info *fib_create_info(struct fib_config *cfg, - if (linkdown == fi->fib_nhs) - fi->fib_flags |= RTNH_F_LINKDOWN; - } -+ KPATCH_PRINTK("[fib_create_info]: 8 create error err is %d\n",err); - - if (fi->fib_prefsrc && !fib_valid_prefsrc(cfg, fi->fib_prefsrc)) { - NL_SET_ERR_MSG(extack, "Invalid prefsrc address"); -@@ -1240,6 +1250,7 @@ struct fib_info *fib_create_info(struct fib_config *cfg, - change_nexthops(fi) { - fib_info_update_nh_saddr(net, nexthop_nh); - } endfor_nexthops(fi) -+ KPATCH_PRINTK("[fib_create_info]: 9 create error err is %d\n",err); - - fib_rebalance(fi); - -@@ -1251,6 +1262,7 @@ struct fib_info *fib_create_info(struct fib_config *cfg, - ofi->fib_treeref++; - return ofi; - } -+ KPATCH_PRINTK("[fib_create_info]: 10 create error err is %d\n",err); - - fi->fib_treeref++; - refcount_set(&fi->fib_clntref, 1); -@@ -1274,6 +1286,7 @@ struct fib_info *fib_create_info(struct fib_config *cfg, - hlist_add_head(&nexthop_nh->nh_hash, head); - } endfor_nexthops(fi) - spin_unlock_bh(&fib_info_lock); -+ KPATCH_PRINTK("[fib_create_info]: 11 create error err is %d\n",err); - return fi; - - err_inval: -@@ -1284,6 +1297,7 @@ struct fib_info *fib_create_info(struct fib_config *cfg, - fi->fib_dead = 1; - free_fib_info(fi); - } -+ KPATCH_PRINTK("[fib_create_info]: 12 create error err is %d\n",err); - - return ERR_PTR(err); - } -diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c -index 5bc0c89..d57b327 100644 ---- a/net/ipv4/fib_trie.c -+++ b/net/ipv4/fib_trie.c -@@ -1121,6 +1121,7 @@ static bool fib_valid_key_len(u32 key, u8 plen, struct netlink_ext_ack *extack) - } - - /* Caller must hold RTNL. */ -+#include "kpatch-macros.h" - int fib_table_insert(struct net *net, struct fib_table *tb, - struct fib_config *cfg, struct netlink_ext_ack *extack) - { -@@ -1143,11 +1144,14 @@ int fib_table_insert(struct net *net, struct fib_table *tb, - - pr_debug("Insert table=%u %08x/%d\n", tb->tb_id, key, plen); - -+ KPATCH_PRINTK("[fib_table_insert]: start\n"); - fi = fib_create_info(cfg, extack); - if (IS_ERR(fi)) { - err = PTR_ERR(fi); -+ KPATCH_PRINTK("[fib_table_insert]: create error err is %d\n",err); - goto err; - } -+ KPATCH_PRINTK("[fib_table_insert]: cross\n"); - - l = fib_find_node(t, &tp, key); - fa = l ? fib_find_alias(&l->leaf, slen, tos, fi->fib_priority, diff --git a/test/integration/rhel-8.0/meminfo-init-FAIL.patch b/test/integration/rhel-8.0/meminfo-init-FAIL.patch deleted file mode 100644 index a3361ed13..000000000 --- a/test/integration/rhel-8.0/meminfo-init-FAIL.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c -index 2fb0484..b981fab 100644 ---- a/fs/proc/meminfo.c -+++ b/fs/proc/meminfo.c -@@ -151,6 +151,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v) - - static int __init proc_meminfo_init(void) - { -+ printk("a\n"); - proc_create_single("meminfo", 0, NULL, meminfo_proc_show); - return 0; - } diff --git a/test/integration/rhel-8.0/meminfo-init2-FAIL.patch b/test/integration/rhel-8.0/meminfo-init2-FAIL.patch deleted file mode 100644 index 28f844557..000000000 --- a/test/integration/rhel-8.0/meminfo-init2-FAIL.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c -index 2fb0484..eb61884 100644 ---- a/fs/proc/meminfo.c -+++ b/fs/proc/meminfo.c -@@ -39,6 +39,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v) - unsigned long pages[NR_LRU_LISTS]; - int lru; - -+ printk("a\n"); - si_meminfo(&i); - si_swapinfo(&i); - committed = percpu_counter_read_positive(&vm_committed_as); -@@ -151,6 +152,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v) - - static int __init proc_meminfo_init(void) - { -+ printk("a\n"); - proc_create_single("meminfo", 0, NULL, meminfo_proc_show); - return 0; - } diff --git a/test/integration/rhel-8.0/meminfo-string-LOADED.test b/test/integration/rhel-8.0/meminfo-string-LOADED.test deleted file mode 100755 index 10dc20b3d..000000000 --- a/test/integration/rhel-8.0/meminfo-string-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep VMALLOCCHUNK /proc/meminfo diff --git a/test/integration/rhel-8.0/meminfo-string.patch b/test/integration/rhel-8.0/meminfo-string.patch deleted file mode 100644 index e20210faa..000000000 --- a/test/integration/rhel-8.0/meminfo-string.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c -index 2fb0484..804bc35 100644 ---- a/fs/proc/meminfo.c -+++ b/fs/proc/meminfo.c -@@ -120,7 +120,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v) - seq_printf(m, "VmallocTotal: %8lu kB\n", - (unsigned long)VMALLOC_TOTAL >> 10); - show_val_kb(m, "VmallocUsed: ", 0ul); -- show_val_kb(m, "VmallocChunk: ", 0ul); -+ show_val_kb(m, "VMALLOCCHUNK: ", 0ul); - - #ifdef CONFIG_MEMORY_FAILURE - seq_printf(m, "HardwareCorrupted: %5lu kB\n", diff --git a/test/integration/rhel-8.0/module-call-external.patch b/test/integration/rhel-8.0/module-call-external.patch deleted file mode 100644 index 44e546fa3..000000000 --- a/test/integration/rhel-8.0/module-call-external.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c -index a1143f7..950403a 100644 ---- a/fs/nfsd/export.c -+++ b/fs/nfsd/export.c -@@ -1196,6 +1196,8 @@ static void exp_flags(struct seq_file *m, int flag, int fsid, - } - } - -+extern char *kpatch_string(void); -+ - static int e_show(struct seq_file *m, void *p) - { - struct cache_head *cp = p; -@@ -1205,6 +1207,7 @@ static int e_show(struct seq_file *m, void *p) - if (p == SEQ_START_TOKEN) { - seq_puts(m, "# Version 1.1\n"); - seq_puts(m, "# Path Client(Flags) # IPs\n"); -+ seq_puts(m, kpatch_string()); - return 0; - } - -diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c -index 56704d9..851d41d 100644 ---- a/net/netlink/af_netlink.c -+++ b/net/netlink/af_netlink.c -@@ -2779,4 +2779,9 @@ static int __init netlink_proto_init(void) - panic("netlink_init: Cannot allocate nl_table\n"); - } - -+char *kpatch_string(void) -+{ -+ return "# kpatch\n"; -+} -+ - core_initcall(netlink_proto_init); diff --git a/test/integration/rhel-8.0/multiple.test b/test/integration/rhel-8.0/multiple.test deleted file mode 100755 index 7e4b3525c..000000000 --- a/test/integration/rhel-8.0/multiple.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -SCRIPTDIR="$(readlink -f $(dirname $(type -p $0)))" - -declare -a blacklist=(meminfo-string-LOADED.test) - -source ${SCRIPTDIR}/../common/multiple.template diff --git a/test/integration/rhel-8.0/new-function.patch b/test/integration/rhel-8.0/new-function.patch deleted file mode 100644 index f1f21a7db..000000000 --- a/test/integration/rhel-8.0/new-function.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c -index 3ad4602..f3cda7e 100644 ---- a/drivers/tty/n_tty.c -+++ b/drivers/tty/n_tty.c -@@ -2296,7 +2296,7 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, - * lock themselves) - */ - --static ssize_t n_tty_write(struct tty_struct *tty, struct file *file, -+static ssize_t noinline kpatch_n_tty_write(struct tty_struct *tty, struct file *file, - const unsigned char *buf, size_t nr) - { - const unsigned char *b = buf; -@@ -2383,6 +2383,12 @@ static ssize_t n_tty_write(struct tty_struct *tty, struct file *file, - return (b - buf) ? b - buf : retval; - } - -+static ssize_t __attribute__((optimize("-fno-optimize-sibling-calls"))) n_tty_write(struct tty_struct *tty, struct file *file, -+ const unsigned char *buf, size_t nr) -+{ -+ return kpatch_n_tty_write(tty, file, buf, nr); -+} -+ - /** - * n_tty_poll - poll method for N_TTY - * @tty: terminal device diff --git a/test/integration/rhel-8.0/new-globals.patch b/test/integration/rhel-8.0/new-globals.patch deleted file mode 100644 index 38892a43b..000000000 --- a/test/integration/rhel-8.0/new-globals.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/fs/proc/cmdline.c b/fs/proc/cmdline.c -index fa762c5..cc67970 100644 ---- a/fs/proc/cmdline.c -+++ b/fs/proc/cmdline.c -@@ -17,3 +17,10 @@ static int __init proc_cmdline_init(void) - return 0; - } - fs_initcall(proc_cmdline_init); -+ -+#include -+void kpatch_print_message(void) -+{ -+ if (!jiffies) -+ printk("hello there!\n"); -+} -diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c -index 2fb0484..7dd8350 100644 ---- a/fs/proc/meminfo.c -+++ b/fs/proc/meminfo.c -@@ -20,6 +20,8 @@ - #include - #include "internal.h" - -+void kpatch_print_message(void); -+ - void __attribute__((weak)) arch_report_meminfo(struct seq_file *m) - { - } -@@ -53,6 +55,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v) - - available = si_mem_available(); - -+ kpatch_print_message(); - show_val_kb(m, "MemTotal: ", i.totalram); - show_val_kb(m, "MemFree: ", i.freeram); - show_val_kb(m, "MemAvailable: ", available); diff --git a/test/integration/rhel-8.0/parainstructions-section.patch b/test/integration/rhel-8.0/parainstructions-section.patch deleted file mode 100644 index d3af7a603..000000000 --- a/test/integration/rhel-8.0/parainstructions-section.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/fs/proc/generic.c b/fs/proc/generic.c -index bb1c162..2b3f7ec 100644 ---- a/fs/proc/generic.c -+++ b/fs/proc/generic.c -@@ -205,6 +205,7 @@ int proc_alloc_inum(unsigned int *inum) - { - int i; - -+ printk("kpatch-test: testing change to .parainstructions section\n"); - i = ida_simple_get(&proc_inum_ida, 0, UINT_MAX - PROC_DYNAMIC_FIRST + 1, - GFP_KERNEL); - if (i < 0) diff --git a/test/integration/rhel-8.0/shadow-newpid-LOADED.test b/test/integration/rhel-8.0/shadow-newpid-LOADED.test deleted file mode 100755 index c07d11205..000000000 --- a/test/integration/rhel-8.0/shadow-newpid-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep -q newpid: /proc/$$/status diff --git a/test/integration/rhel-8.0/shadow-newpid.patch.disabled b/test/integration/rhel-8.0/shadow-newpid.patch.disabled deleted file mode 100644 index 19109a366..000000000 --- a/test/integration/rhel-8.0/shadow-newpid.patch.disabled +++ /dev/null @@ -1,80 +0,0 @@ -Disabled due to https://github.com/dynup/kpatch/issues/940 ---- -diff --git a/fs/proc/array.c b/fs/proc/array.c -index 0ceb3b6..1b44c7f 100644 ---- a/fs/proc/array.c -+++ b/fs/proc/array.c -@@ -370,12 +370,19 @@ static inline void task_seccomp(struct seq_file *m, struct task_struct *p) - seq_putc(m, '\n'); - } - -+#include - static inline void task_context_switch_counts(struct seq_file *m, - struct task_struct *p) - { -+ int *newpid; -+ - seq_put_decimal_ull(m, "voluntary_ctxt_switches:\t", p->nvcsw); - seq_put_decimal_ull(m, "\nnonvoluntary_ctxt_switches:\t", p->nivcsw); - seq_putc(m, '\n'); -+ -+ newpid = klp_shadow_get(p, 0); -+ if (newpid) -+ seq_printf(m, "newpid:\t%d\n", *newpid); - } - - static void task_cpus_allowed(struct seq_file *m, struct task_struct *task) -diff --git a/kernel/exit.c b/kernel/exit.c -index deaa53a..01f5776 100644 ---- a/kernel/exit.c -+++ b/kernel/exit.c -@@ -760,6 +760,7 @@ static void check_stack_usage(void) - static inline void check_stack_usage(void) {} - #endif - -+#include - void __noreturn do_exit(long code) - { - struct task_struct *tsk = current; -@@ -865,6 +866,8 @@ void __noreturn do_exit(long code) - exit_task_work(tsk); - exit_thread(tsk); - -+ klp_shadow_free(tsk, 0, NULL); -+ - /* - * Flush inherited counters to the parent - before the parent - * gets woken up by child-exit notifications. -diff --git a/kernel/fork.c b/kernel/fork.c -index 3311231..2c12c1a 100644 ---- a/kernel/fork.c -+++ b/kernel/fork.c -@@ -2093,6 +2093,7 @@ struct task_struct *fork_idle(int cpu) - * It copies the process, and if successful kick-starts - * it and waits for it to finish using the VM if required. - */ -+#include - long _do_fork(unsigned long clone_flags, - unsigned long stack_start, - unsigned long stack_size, -@@ -2105,6 +2106,8 @@ long _do_fork(unsigned long clone_flags, - struct task_struct *p; - int trace = 0; - long nr; -+ int *newpid; -+ static int ctr = 0; - - /* - * Determine whether and which event to report to ptracer. When -@@ -2131,6 +2134,11 @@ long _do_fork(unsigned long clone_flags, - if (IS_ERR(p)) - return PTR_ERR(p); - -+ newpid = klp_shadow_get_or_alloc(p, 0, sizeof(*newpid), GFP_KERNEL, -+ NULL, NULL); -+ if (newpid) -+ *newpid = ctr++; -+ - /* - * Do this prior waking up the new thread - the thread pointer - * might get invalid after that point, if the thread exits quickly. diff --git a/test/integration/rhel-8.0/smp-locks-section.patch b/test/integration/rhel-8.0/smp-locks-section.patch deleted file mode 100644 index 5166614c3..000000000 --- a/test/integration/rhel-8.0/smp-locks-section.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c -index ae3ce33..37727fe 100644 ---- a/drivers/tty/tty_buffer.c -+++ b/drivers/tty/tty_buffer.c -@@ -256,6 +256,9 @@ static int __tty_buffer_request_room(struct tty_port *port, size_t size, - struct tty_buffer *b, *n; - int left, change; - -+ if (!size) -+ printk("kpatch-test: testing .smp_locks section changes\n"); -+ - b = buf->tail; - if (b->flags & TTYB_NORMAL) - left = 2 * b->size - b->used; diff --git a/test/integration/rhel-8.0/special-static.patch b/test/integration/rhel-8.0/special-static.patch deleted file mode 100644 index 22502dfff..000000000 --- a/test/integration/rhel-8.0/special-static.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/kernel/fork.c b/kernel/fork.c -index 3311231..f6e66b7 100644 ---- a/kernel/fork.c -+++ b/kernel/fork.c -@@ -1461,10 +1461,18 @@ static void posix_cpu_timers_init_group(struct signal_struct *sig) - static inline void posix_cpu_timers_init_group(struct signal_struct *sig) { } - #endif - -+void kpatch_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch copy signal\n"); -+} -+ - static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) - { - struct signal_struct *sig; - -+ kpatch_foo(); -+ - if (clone_flags & CLONE_THREAD) - return 0; - diff --git a/test/integration/rhel-8.0/symvers-disagreement-FAIL.patch b/test/integration/rhel-8.0/symvers-disagreement-FAIL.patch deleted file mode 100644 index e3a672a2e..000000000 --- a/test/integration/rhel-8.0/symvers-disagreement-FAIL.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 7085a655b8d665b6314e8dab2f803bac0aea04ec Mon Sep 17 00:00:00 2001 -From: Julien Thierry -Date: Wed, 6 May 2020 14:30:57 +0100 -Subject: [PATCH] Symbol version change - -This change causes: -1) Some exported symbols in drivers/base/core.c to see their CRCs - change. -2) Changes usb_get_dev() referencing a get_device() whose CRC has - changed, causing the symbol and the new CRC to be included in the - __version section of the final module. - -This makes the final module unloadable for the target kernel. - -See "Exported symbol versioning" of the patch author guide for more -detail. - ---- - drivers/base/core.c | 2 ++ - drivers/usb/core/usb.c | 2 ++ - 2 files changed, 4 insertions(+) - -diff --git a/drivers/base/core.c b/drivers/base/core.c -index df3e1a44707a..15c9d6e2e1e0 100644 ---- a/drivers/base/core.c -+++ b/drivers/base/core.c -@@ -29,6 +29,8 @@ - #include "base.h" - #include "power/power.h" - -+#include -+ - #ifdef CONFIG_SYSFS_DEPRECATED - #ifdef CONFIG_SYSFS_DEPRECATED_V2 - long sysfs_deprecated = 1; -diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c -index 623be3174fb3..4ddd74ae0bb9 100644 ---- a/drivers/usb/core/usb.c -+++ b/drivers/usb/core/usb.c -@@ -685,6 +685,8 @@ EXPORT_SYMBOL_GPL(usb_alloc_dev); - */ - struct usb_device *usb_get_dev(struct usb_device *dev) - { -+ barrier(); -+ - if (dev) - get_device(&dev->dev); - return dev; --- -2.21.3 - diff --git a/test/integration/rhel-8.0/tracepoints-section.patch b/test/integration/rhel-8.0/tracepoints-section.patch deleted file mode 100644 index 0dfea0cb3..000000000 --- a/test/integration/rhel-8.0/tracepoints-section.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/kernel/time/timer.c b/kernel/time/timer.c -index 786f8c0..1105697 100644 ---- a/kernel/time/timer.c -+++ b/kernel/time/timer.c -@@ -1692,6 +1692,9 @@ static __latent_entropy void run_timer_softirq(struct softirq_action *h) - { - struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]); - -+ if (!base) -+ printk("kpatch-test: testing __tracepoints section changes\n"); -+ - __run_timers(base); - if (IS_ENABLED(CONFIG_NO_HZ_COMMON)) - __run_timers(this_cpu_ptr(&timer_bases[BASE_DEF])); diff --git a/test/integration/rhel-8.0/warn-detect-FAIL.patch b/test/integration/rhel-8.0/warn-detect-FAIL.patch deleted file mode 100644 index f57bd0e8c..000000000 --- a/test/integration/rhel-8.0/warn-detect-FAIL.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c -index 4fa858b..ef1a710 100644 ---- a/arch/x86/kvm/x86.c -+++ b/arch/x86/kvm/x86.c -@@ -1,3 +1,4 @@ -+ - /* - * Kernel-based Virtual Machine driver for Linux - * diff --git a/test/integration/rhel-8.1/bug-table-section.patch b/test/integration/rhel-8.1/bug-table-section.patch deleted file mode 100644 index b37f54592..000000000 --- a/test/integration/rhel-8.1/bug-table-section.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nupr src/fs/proc/proc_sysctl.c src/fs/proc/proc_sysctl.c ---- src/fs/proc/proc_sysctl.c 2020-03-11 11:23:26.886602663 +0000 -+++ src/fs/proc/proc_sysctl.c 2020-03-11 11:23:39.822895153 +0000 -@@ -333,6 +333,8 @@ static void start_unregistering(struct c - - static struct ctl_table_header *sysctl_head_grab(struct ctl_table_header *head) - { -+ if (jiffies == 0) -+ printk("kpatch-test: testing __bug_table section changes\n"); - BUG_ON(!head); - spin_lock(&sysctl_lock); - if (!use_table(head)) diff --git a/test/integration/rhel-8.1/cmdline-string-LOADED.test b/test/integration/rhel-8.1/cmdline-string-LOADED.test deleted file mode 100755 index a8e0a0817..000000000 --- a/test/integration/rhel-8.1/cmdline-string-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep kpatch=1 /proc/cmdline diff --git a/test/integration/rhel-8.1/cmdline-string.patch b/test/integration/rhel-8.1/cmdline-string.patch deleted file mode 100644 index 2ba176263..000000000 --- a/test/integration/rhel-8.1/cmdline-string.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -Nupr src/fs/proc/cmdline.c src/fs/proc/cmdline.c ---- src/fs/proc/cmdline.c 2020-03-11 11:23:26.878602482 +0000 -+++ src/fs/proc/cmdline.c 2020-03-11 11:24:37.984218859 +0000 -@@ -6,8 +6,7 @@ - - static int cmdline_proc_show(struct seq_file *m, void *v) - { -- seq_puts(m, saved_command_line); -- seq_putc(m, '\n'); -+ seq_printf(m, "%s kpatch=1\n", saved_command_line); - return 0; - } - diff --git a/test/integration/rhel-8.1/data-new-LOADED.test b/test/integration/rhel-8.1/data-new-LOADED.test deleted file mode 100755 index 9f25744e6..000000000 --- a/test/integration/rhel-8.1/data-new-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep "kpatch: 5" /proc/meminfo diff --git a/test/integration/rhel-8.1/data-new.patch b/test/integration/rhel-8.1/data-new.patch deleted file mode 100644 index a33a233b2..000000000 --- a/test/integration/rhel-8.1/data-new.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -Nupr src/fs/proc/meminfo.c src/fs/proc/meminfo.c ---- src/fs/proc/meminfo.c 2020-03-11 11:23:26.882602572 +0000 -+++ src/fs/proc/meminfo.c 2020-03-11 11:25:35.401538436 +0000 -@@ -30,6 +30,8 @@ static void show_val_kb(struct seq_file - seq_write(m, " kB\n", 4); - } - -+static int foo = 5; -+ - static int meminfo_proc_show(struct seq_file *m, void *v) - { - struct sysinfo i; -@@ -141,6 +143,7 @@ static int meminfo_proc_show(struct seq_ - show_val_kb(m, "CmaFree: ", - global_zone_page_state(NR_FREE_CMA_PAGES)); - #endif -+ seq_printf(m, "kpatch: %d\n", foo); - - hugetlb_report_meminfo(m); - diff --git a/test/integration/rhel-8.1/data-read-mostly.patch.disabled b/test/integration/rhel-8.1/data-read-mostly.patch.disabled deleted file mode 100644 index 3569b7d02..000000000 --- a/test/integration/rhel-8.1/data-read-mostly.patch.disabled +++ /dev/null @@ -1,13 +0,0 @@ -Disabled due to https:/github.com/dynup/kpatch/issues/940 ---- -diff -Nupr src/net/core/dev.c src/net/core/dev.c ---- src/net/core/dev.c 2020-03-11 11:23:32.550730639 +0000 -+++ src/net/core/dev.c 2020-03-11 11:43:53.348022834 +0000 -@@ -4893,6 +4893,7 @@ skip_classify: - case RX_HANDLER_PASS: - break; - default: -+ printk("BUG!\n"); - BUG(); - } - } diff --git a/test/integration/rhel-8.1/fixup-section.patch b/test/integration/rhel-8.1/fixup-section.patch deleted file mode 100644 index 7446a2988..000000000 --- a/test/integration/rhel-8.1/fixup-section.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nupr src/fs/readdir.c src/fs/readdir.c ---- src/fs/readdir.c 2020-03-11 11:23:24.210542249 +0000 -+++ src/fs/readdir.c 2020-03-11 11:26:32.322857837 +0000 -@@ -189,6 +189,7 @@ static int filldir(struct dir_context *c - goto efault; - } - dirent = buf->current_dir; -+ asm("nop"); - if (__put_user(d_ino, &dirent->d_ino)) - goto efault; - if (__put_user(reclen, &dirent->d_reclen)) diff --git a/test/integration/rhel-8.1/gcc-constprop.patch.disabled b/test/integration/rhel-8.1/gcc-constprop.patch.disabled deleted file mode 100644 index 1c8ca71fb..000000000 --- a/test/integration/rhel-8.1/gcc-constprop.patch.disabled +++ /dev/null @@ -1,13 +0,0 @@ -diff -Nupr src/kernel/time/timekeeping.c src/kernel/time/timekeeping.c ---- src/kernel/time/timekeeping.c 2020-03-11 11:23:30.538685163 +0000 -+++ src/kernel/time/timekeeping.c 2020-03-11 11:44:47.885367244 +0000 -@@ -1221,6 +1221,9 @@ void do_gettimeofday(struct timeval *tv) - { - struct timespec64 now; - -+ if (!tv) -+ return; -+ - getnstimeofday64(&now); - tv->tv_sec = now.tv_sec; - tv->tv_usec = now.tv_nsec/1000; diff --git a/test/integration/rhel-8.1/gcc-isra.patch b/test/integration/rhel-8.1/gcc-isra.patch deleted file mode 100644 index 3ae952f2f..000000000 --- a/test/integration/rhel-8.1/gcc-isra.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nupr src/fs/proc/proc_sysctl.c src/fs/proc/proc_sysctl.c ---- src/fs/proc/proc_sysctl.c 2020-03-11 11:23:26.886602663 +0000 -+++ src/fs/proc/proc_sysctl.c 2020-03-11 11:27:30.392214139 +0000 -@@ -48,6 +48,7 @@ void proc_sys_poll_notify(struct ctl_tab - if (!poll) - return; - -+ printk("kpatch-test: testing gcc .isra function name mangling\n"); - atomic_inc(&poll->event); - wake_up_interruptible(&poll->wait); - } diff --git a/test/integration/rhel-8.1/gcc-mangled-3.patch b/test/integration/rhel-8.1/gcc-mangled-3.patch deleted file mode 100644 index 65e757a72..000000000 --- a/test/integration/rhel-8.1/gcc-mangled-3.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -Nupr src/mm/slub.c src/mm/slub.c ---- src/mm/slub.c 2020-03-11 11:23:32.406727384 +0000 -+++ src/mm/slub.c 2020-03-11 11:28:27.973568215 +0000 -@@ -5836,6 +5836,9 @@ void get_slabinfo(struct kmem_cache *s, - int node; - struct kmem_cache_node *n; - -+ if (!jiffies) -+ printk("slabinfo\n"); -+ - for_each_kmem_cache_node(s, node, n) { - nr_slabs += node_nr_slabs(n); - nr_objs += node_nr_objs(n); diff --git a/test/integration/rhel-8.1/gcc-static-local-var-2.patch b/test/integration/rhel-8.1/gcc-static-local-var-2.patch deleted file mode 100644 index a17a1bec1..000000000 --- a/test/integration/rhel-8.1/gcc-static-local-var-2.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -Nupr src/mm/mmap.c src/mm/mmap.c ---- src/mm/mmap.c 2020-03-11 11:23:32.386726932 +0000 -+++ src/mm/mmap.c 2020-03-11 11:29:26.610955502 +0000 -@@ -1685,6 +1685,9 @@ unsigned long mmap_region(struct file *f - struct rb_node **rb_link, *rb_parent; - unsigned long charged = 0; - -+ if (!jiffies) -+ printk("kpatch mmap foo\n"); -+ - /* Check against address space limit. */ - if (!may_expand_vm(mm, vm_flags, len >> PAGE_SHIFT)) { - unsigned long nr_pages; diff --git a/test/integration/rhel-8.1/gcc-static-local-var-3.patch b/test/integration/rhel-8.1/gcc-static-local-var-3.patch deleted file mode 100644 index 81a0b3271..000000000 --- a/test/integration/rhel-8.1/gcc-static-local-var-3.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -Nupr src/kernel/reboot.c src/kernel/reboot.c ---- src/kernel/reboot.c 2020-03-11 11:23:30.502684349 +0000 -+++ src/kernel/reboot.c 2020-03-11 11:30:24.412330397 +0000 -@@ -393,8 +393,15 @@ SYSCALL_DEFINE4(reboot, int, magic1, int - return ret; - } - -+void kpatch_bar(void) -+{ -+ if (!jiffies) -+ printk("kpatch_foo\n"); -+} -+ - static void deferred_cad(struct work_struct *dummy) - { -+ kpatch_bar(); - kernel_restart(NULL); - } - diff --git a/test/integration/rhel-8.1/gcc-static-local-var-4.patch.disabled b/test/integration/rhel-8.1/gcc-static-local-var-4.patch.disabled deleted file mode 100644 index 63481a7ce..000000000 --- a/test/integration/rhel-8.1/gcc-static-local-var-4.patch.disabled +++ /dev/null @@ -1,24 +0,0 @@ -Disabled due to https:/github.com/dynup/kpatch/issues/940 ---- -diff -Nupr src/fs/aio.c src/fs/aio.c ---- src/fs/aio.c 2020-03-11 11:23:24.150540895 +0000 -+++ src/fs/aio.c 2020-03-11 11:45:44.710769201 +0000 -@@ -251,11 +251,18 @@ static int __init aio_setup(void) - } - __initcall(aio_setup); - -+void kpatch_aio_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch aio foo\n"); -+} -+ - static void put_aio_ring_file(struct kioctx *ctx) - { - struct file *aio_ring_file = ctx->aio_ring_file; - struct address_space *i_mapping; - -+ kpatch_aio_foo(); - if (aio_ring_file) { - truncate_setsize(file_inode(aio_ring_file), 0); - diff --git a/test/integration/rhel-8.1/gcc-static-local-var-4.test.disabled b/test/integration/rhel-8.1/gcc-static-local-var-4.test.disabled deleted file mode 100755 index e085f9345..000000000 --- a/test/integration/rhel-8.1/gcc-static-local-var-4.test.disabled +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -set -o pipefail -if ! $(eu-readelf --wide --symbols test-gcc-static-local-var-4.ko | awk '$NF == "free_ioctx" { exit 1 }'); then - exit 1 -else - exit 0 -fi diff --git a/test/integration/rhel-8.1/gcc-static-local-var-5.patch b/test/integration/rhel-8.1/gcc-static-local-var-5.patch deleted file mode 100644 index 3f639ac64..000000000 --- a/test/integration/rhel-8.1/gcc-static-local-var-5.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff -Nupr src/kernel/audit.c src/kernel/audit.c ---- src/kernel/audit.c 2020-03-11 11:23:30.394681909 +0000 -+++ src/kernel/audit.c 2020-03-11 11:46:41.484170922 +0000 -@@ -325,6 +325,12 @@ void audit_panic(const char *message) - } - } - -+void kpatch_audit_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch audit foo\n"); -+} -+ - static inline int audit_rate_check(void) - { - static unsigned long last_check = 0; -@@ -335,6 +341,7 @@ static inline int audit_rate_check(void) - unsigned long elapsed; - int retval = 0; - -+ kpatch_audit_foo(); - if (!audit_rate_limit) return 1; - - spin_lock_irqsave(&lock, flags); -@@ -354,6 +361,11 @@ static inline int audit_rate_check(void) - return retval; - } - -+noinline void kpatch_audit_check(void) -+{ -+ audit_rate_check(); -+} -+ - /** - * audit_log_lost - conditionally log lost audit message event - * @message: the message stating reason for lost audit message -@@ -400,6 +412,8 @@ static int audit_log_config_change(char - struct audit_buffer *ab; - int rc = 0; - -+ kpatch_audit_check(); -+ - ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_CONFIG_CHANGE); - if (unlikely(!ab)) - return rc; diff --git a/test/integration/rhel-8.1/gcc-static-local-var-6.patch b/test/integration/rhel-8.1/gcc-static-local-var-6.patch deleted file mode 100644 index b970dd80b..000000000 --- a/test/integration/rhel-8.1/gcc-static-local-var-6.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -Nupr src/net/ipv6/netfilter.c src/net/ipv6/netfilter.c ---- src/net/ipv6/netfilter.c 2020-03-11 11:23:32.702734076 +0000 -+++ src/net/ipv6/netfilter.c 2020-03-11 11:31:22.397716246 +0000 -@@ -87,6 +87,8 @@ static int nf_ip6_reroute(struct sk_buff - return 0; - } - -+#include "kpatch-macros.h" -+ - static int nf_ip6_route(struct net *net, struct dst_entry **dst, - struct flowi *fl, bool strict) - { -@@ -100,6 +102,9 @@ static int nf_ip6_route(struct net *net, - struct dst_entry *result; - int err; - -+ if (!jiffies) -+ printk("kpatch nf_ip6_route foo\n"); -+ - result = ip6_route_output(net, sk, &fl->u.ip6); - err = result->error; - if (err) diff --git a/test/integration/rhel-8.1/macro-callbacks.patch b/test/integration/rhel-8.1/macro-callbacks.patch deleted file mode 100644 index fd29ecfeb..000000000 --- a/test/integration/rhel-8.1/macro-callbacks.patch +++ /dev/null @@ -1,155 +0,0 @@ -diff -Nupr src/drivers/input/joydev.c src/drivers/input/joydev.c ---- src/drivers/input/joydev.c 2020-03-11 11:23:07.890174500 +0000 -+++ src/drivers/input/joydev.c 2020-03-11 11:32:20.859119425 +0000 -@@ -1068,3 +1068,47 @@ static void __exit joydev_exit(void) - - module_init(joydev_init); - module_exit(joydev_exit); -+ -+#include -+#include "kpatch-macros.h" -+ -+static const char *const module_state[] = { -+ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", -+ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", -+ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", -+ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", -+}; -+ -+static void callback_info(const char *callback, patch_object *obj) -+{ -+ if (obj->mod) -+ pr_info("%s: %s -> %s\n", callback, obj->mod->name, -+ module_state[obj->mod->state]); -+ else -+ pr_info("%s: vmlinux\n", callback); -+} -+ -+static int pre_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+ return 0; /* return -ENODEV; */ -+} -+KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); -+ -+static void post_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_PATCH_CALLBACK(post_patch_callback); -+ -+static void pre_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); -+ -+static void post_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); -diff -Nupr src/drivers/input/misc/pcspkr.c src/drivers/input/misc/pcspkr.c ---- src/drivers/input/misc/pcspkr.c 2020-03-11 11:23:07.962176120 +0000 -+++ src/drivers/input/misc/pcspkr.c 2020-03-11 11:32:20.859119425 +0000 -@@ -138,3 +138,46 @@ static struct platform_driver pcspkr_pla - }; - module_platform_driver(pcspkr_platform_driver); - -+#include -+#include "kpatch-macros.h" -+ -+static const char *const module_state[] = { -+ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", -+ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", -+ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", -+ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", -+}; -+ -+static void callback_info(const char *callback, patch_object *obj) -+{ -+ if (obj->mod) -+ pr_info("%s: %s -> %s\n", callback, obj->mod->name, -+ module_state[obj->mod->state]); -+ else -+ pr_info("%s: vmlinux\n", callback); -+} -+ -+static int pre_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+ return 0; -+} -+KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); -+ -+static void post_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_PATCH_CALLBACK(post_patch_callback); -+ -+static void pre_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); -+ -+static void post_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); -diff -Nupr src/fs/aio.c src/fs/aio.c ---- src/fs/aio.c 2020-03-11 11:23:24.150540895 +0000 -+++ src/fs/aio.c 2020-03-11 11:32:20.859119425 +0000 -@@ -49,6 +49,50 @@ - - #define KIOCB_KEY 0 - -+#include -+#include "kpatch-macros.h" -+ -+static const char *const module_state[] = { -+ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", -+ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", -+ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", -+ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", -+}; -+ -+static void callback_info(const char *callback, patch_object *obj) -+{ -+ if (obj->mod) -+ pr_info("%s: %s -> %s\n", callback, obj->mod->name, -+ module_state[obj->mod->state]); -+ else -+ pr_info("%s: vmlinux\n", callback); -+} -+ -+static int pre_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+ return 0; -+} -+KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); -+ -+static void post_patch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_PATCH_CALLBACK(post_patch_callback); -+ -+static void pre_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); -+ -+static void post_unpatch_callback(patch_object *obj) -+{ -+ callback_info(__func__, obj); -+} -+KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); -+ - #define AIO_RING_MAGIC 0xa10a10a1 - #define AIO_RING_COMPAT_FEATURES 1 - #define AIO_RING_INCOMPAT_FEATURES 0 diff --git a/test/integration/rhel-8.1/macro-printk.patch.disabled b/test/integration/rhel-8.1/macro-printk.patch.disabled deleted file mode 100644 index 02926af3d..000000000 --- a/test/integration/rhel-8.1/macro-printk.patch.disabled +++ /dev/null @@ -1,148 +0,0 @@ -diff -Nupr src/net/ipv4/fib_frontend.c src/net/ipv4/fib_frontend.c ---- src/net/ipv4/fib_frontend.c 2020-03-11 11:23:32.622732267 +0000 -+++ src/net/ipv4/fib_frontend.c 2020-03-11 11:47:37.897564680 +0000 -@@ -777,6 +777,7 @@ errout: - return err; - } - -+#include "kpatch-macros.h" - static int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, - struct netlink_ext_ack *extack) - { -@@ -798,6 +799,7 @@ static int inet_rtm_newroute(struct sk_b - err = fib_table_insert(net, tb, &cfg, extack); - if (!err && cfg.fc_type == RTN_LOCAL) - net->ipv4.fib_has_custom_local_routes = true; -+ KPATCH_PRINTK("[inet_rtm_newroute]: err is %d\n", err); - errout: - return err; - } -diff -Nupr src/net/ipv4/fib_semantics.c src/net/ipv4/fib_semantics.c ---- src/net/ipv4/fib_semantics.c 2020-03-11 11:23:32.626732358 +0000 -+++ src/net/ipv4/fib_semantics.c 2020-03-11 11:47:37.897564680 +0000 -@@ -1025,6 +1025,7 @@ fib_convert_metrics(struct fib_info *fi, - fi->fib_metrics->metrics); - } - -+#include "kpatch-macros.h" - struct fib_info *fib_create_info(struct fib_config *cfg, - struct netlink_ext_ack *extack) - { -@@ -1058,6 +1059,7 @@ struct fib_info *fib_create_info(struct - #endif - - err = -ENOBUFS; -+ KPATCH_PRINTK("[fib_create_info]: create error err is %d\n",err); - if (fib_info_cnt >= fib_info_hash_size) { - unsigned int new_size = fib_info_hash_size << 1; - struct hlist_head *new_info_hash; -@@ -1078,6 +1080,7 @@ struct fib_info *fib_create_info(struct - if (!fib_info_hash_size) - goto failure; - } -+ KPATCH_PRINTK("[fib_create_info]: 2 create error err is %d\n",err); - - fi = kzalloc(sizeof(*fi)+nhs*sizeof(struct fib_nh), GFP_KERNEL); - if (!fi) -@@ -1093,6 +1096,8 @@ struct fib_info *fib_create_info(struct - fi->fib_metrics = (struct dst_metrics *)&dst_default_metrics; - } - fib_info_cnt++; -+ KPATCH_PRINTK("[fib_create_info]: 3 create error err is %d\n",err); -+ - fi->fib_net = net; - fi->fib_protocol = cfg->fc_protocol; - fi->fib_scope = cfg->fc_scope; -@@ -1109,8 +1114,10 @@ struct fib_info *fib_create_info(struct - if (!nexthop_nh->nh_pcpu_rth_output) - goto failure; - } endfor_nexthops(fi) -+ KPATCH_PRINTK("[fib_create_info]: 4 create error err is %d\n",err); - - err = fib_convert_metrics(fi, cfg); -+ KPATCH_PRINTK("[fib_create_info]: 5 create error err is %d\n",err); - if (err) - goto failure; - -@@ -1172,6 +1179,7 @@ struct fib_info *fib_create_info(struct - nh->nh_weight = 1; - #endif - } -+ KPATCH_PRINTK("[fib_create_info]: 6 create error err is %d\n",err); - - if (fib_props[cfg->fc_type].error) { - if (cfg->fc_gw || cfg->fc_oif || cfg->fc_mp) { -@@ -1193,6 +1201,7 @@ struct fib_info *fib_create_info(struct - goto err_inval; - } - } -+ KPATCH_PRINTK("[fib_create_info]: 7 create error err is %d\n",err); - - if (cfg->fc_scope > RT_SCOPE_HOST) { - NL_SET_ERR_MSG(extack, "Invalid scope"); -@@ -1231,6 +1240,7 @@ struct fib_info *fib_create_info(struct - if (linkdown == fi->fib_nhs) - fi->fib_flags |= RTNH_F_LINKDOWN; - } -+ KPATCH_PRINTK("[fib_create_info]: 8 create error err is %d\n",err); - - if (fi->fib_prefsrc && !fib_valid_prefsrc(cfg, fi->fib_prefsrc)) { - NL_SET_ERR_MSG(extack, "Invalid prefsrc address"); -@@ -1240,6 +1250,7 @@ struct fib_info *fib_create_info(struct - change_nexthops(fi) { - fib_info_update_nh_saddr(net, nexthop_nh); - } endfor_nexthops(fi) -+ KPATCH_PRINTK("[fib_create_info]: 9 create error err is %d\n",err); - - fib_rebalance(fi); - -@@ -1251,6 +1262,7 @@ link_it: - ofi->fib_treeref++; - return ofi; - } -+ KPATCH_PRINTK("[fib_create_info]: 10 create error err is %d\n",err); - - fi->fib_treeref++; - refcount_set(&fi->fib_clntref, 1); -@@ -1274,6 +1286,7 @@ link_it: - hlist_add_head(&nexthop_nh->nh_hash, head); - } endfor_nexthops(fi) - spin_unlock_bh(&fib_info_lock); -+ KPATCH_PRINTK("[fib_create_info]: 11 create error err is %d\n",err); - return fi; - - err_inval: -@@ -1284,6 +1297,7 @@ failure: - fi->fib_dead = 1; - free_fib_info(fi); - } -+ KPATCH_PRINTK("[fib_create_info]: 12 create error err is %d\n",err); - - return ERR_PTR(err); - } -diff -Nupr src/net/ipv4/fib_trie.c src/net/ipv4/fib_trie.c ---- src/net/ipv4/fib_trie.c 2020-03-11 11:23:32.626732358 +0000 -+++ src/net/ipv4/fib_trie.c 2020-03-11 11:47:37.897564680 +0000 -@@ -1121,6 +1121,7 @@ static bool fib_valid_key_len(u32 key, u - } - - /* Caller must hold RTNL. */ -+#include "kpatch-macros.h" - int fib_table_insert(struct net *net, struct fib_table *tb, - struct fib_config *cfg, struct netlink_ext_ack *extack) - { -@@ -1143,11 +1144,14 @@ int fib_table_insert(struct net *net, st - - pr_debug("Insert table=%u %08x/%d\n", tb->tb_id, key, plen); - -+ KPATCH_PRINTK("[fib_table_insert]: start\n"); - fi = fib_create_info(cfg, extack); - if (IS_ERR(fi)) { - err = PTR_ERR(fi); -+ KPATCH_PRINTK("[fib_table_insert]: create error err is %d\n",err); - goto err; - } -+ KPATCH_PRINTK("[fib_table_insert]: cross\n"); - - l = fib_find_node(t, &tp, key); - fa = l ? fib_find_alias(&l->leaf, slen, tos, fi->fib_priority, diff --git a/test/integration/rhel-8.1/meminfo-init-FAIL.patch b/test/integration/rhel-8.1/meminfo-init-FAIL.patch deleted file mode 100644 index 2334a0ef8..000000000 --- a/test/integration/rhel-8.1/meminfo-init-FAIL.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nupr src/fs/proc/meminfo.c src/fs/proc/meminfo.c ---- src/fs/proc/meminfo.c 2020-03-11 11:23:26.882602572 +0000 -+++ src/fs/proc/meminfo.c 2020-03-11 11:34:17.189926874 +0000 -@@ -151,6 +151,7 @@ static int meminfo_proc_show(struct seq_ - - static int __init proc_meminfo_init(void) - { -+ printk("a\n"); - proc_create_single("meminfo", 0, NULL, meminfo_proc_show); - return 0; - } diff --git a/test/integration/rhel-8.1/meminfo-init2-FAIL.patch b/test/integration/rhel-8.1/meminfo-init2-FAIL.patch deleted file mode 100644 index 937667b00..000000000 --- a/test/integration/rhel-8.1/meminfo-init2-FAIL.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -Nupr src/fs/proc/meminfo.c src/fs/proc/meminfo.c ---- src/fs/proc/meminfo.c 2020-03-11 11:23:26.882602572 +0000 -+++ src/fs/proc/meminfo.c 2020-03-11 11:33:19.732537882 +0000 -@@ -40,6 +40,7 @@ static int meminfo_proc_show(struct seq_ - unsigned long sreclaimable, sunreclaim; - int lru; - -+ printk("a\n"); - si_meminfo(&i); - si_swapinfo(&i); - committed = percpu_counter_read_positive(&vm_committed_as); -@@ -151,6 +152,7 @@ static int meminfo_proc_show(struct seq_ - - static int __init proc_meminfo_init(void) - { -+ printk("a\n"); - proc_create_single("meminfo", 0, NULL, meminfo_proc_show); - return 0; - } diff --git a/test/integration/rhel-8.1/meminfo-string-LOADED.test b/test/integration/rhel-8.1/meminfo-string-LOADED.test deleted file mode 100755 index 10dc20b3d..000000000 --- a/test/integration/rhel-8.1/meminfo-string-LOADED.test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep VMALLOCCHUNK /proc/meminfo diff --git a/test/integration/rhel-8.1/meminfo-string.patch b/test/integration/rhel-8.1/meminfo-string.patch deleted file mode 100644 index e3e750955..000000000 --- a/test/integration/rhel-8.1/meminfo-string.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nupr src/fs/proc/meminfo.c src/fs/proc/meminfo.c ---- src/fs/proc/meminfo.c 2020-03-11 11:23:26.882602572 +0000 -+++ src/fs/proc/meminfo.c 2020-03-11 11:35:15.879349884 +0000 -@@ -120,7 +120,7 @@ static int meminfo_proc_show(struct seq_ - seq_printf(m, "VmallocTotal: %8lu kB\n", - (unsigned long)VMALLOC_TOTAL >> 10); - show_val_kb(m, "VmallocUsed: ", 0ul); -- show_val_kb(m, "VmallocChunk: ", 0ul); -+ show_val_kb(m, "VMALLOCCHUNK: ", 0ul); - - #ifdef CONFIG_MEMORY_FAILURE - seq_printf(m, "HardwareCorrupted: %5lu kB\n", diff --git a/test/integration/rhel-8.1/module-LOADED.test b/test/integration/rhel-8.1/module-LOADED.test deleted file mode 100755 index 72bb85266..000000000 --- a/test/integration/rhel-8.1/module-LOADED.test +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -set -o errexit - -sudo modprobe nfsd -sleep 5 -grep -q kpatch /proc/fs/nfs/exports - -# TODO: This will trigger a printk on newer kernels which have the .klp.arch -# removal. Don't actually do the grep until running on a newer kernel. -echo "file fs/nfsd/export.c +p" > /sys/kernel/debug/dynamic_debug/control -cat /proc/fs/nfs/exports > /dev/null -# dmesg | grep -q "kpatch: pr_debug" diff --git a/test/integration/rhel-8.1/module.patch b/test/integration/rhel-8.1/module.patch deleted file mode 100644 index 8bfb62155..000000000 --- a/test/integration/rhel-8.1/module.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 08078d00ab1749a6f84148a00d8d26572af4ec97 Mon Sep 17 00:00:00 2001 -Message-Id: <08078d00ab1749a6f84148a00d8d26572af4ec97.1586900628.git.jpoimboe@redhat.com> -From: Josh Poimboeuf -Date: Tue, 14 Apr 2020 15:17:51 -0500 -Subject: [PATCH] kpatch module integration test - -This tests several things related to the patching of modules: - -- 'kpatch_string' tests the referencing of a symbol which is outside the - .o, but inside the patch module. - -- alternatives patching (.altinstructions) - -- paravirt patching (.parainstructions) - -- jump labels (5.8+ kernels only) -- including dynamic printk - -Signed-off-by: Josh Poimboeuf ---- - fs/nfsd/export.c | 30 ++++++++++++++++++++++++++++++ - net/netlink/af_netlink.c | 5 +++++ - 2 files changed, 35 insertions(+) - -diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c -index a1143f7c2201..253c15ad82b2 100644 ---- a/fs/nfsd/export.c -+++ b/fs/nfsd/export.c -@@ -1196,15 +1196,45 @@ static void exp_flags(struct seq_file *m, int flag, int fsid, - } - } - -+#include -+extern char *kpatch_string(void); -+ - static int e_show(struct seq_file *m, void *p) - { - struct cache_head *cp = p; - struct svc_export *exp = container_of(cp, struct svc_export, h); - struct cache_detail *cd = m->private; -+#ifdef CONFIG_X86_64 -+ unsigned long long sched_clock; -+ -+ alternative("ud2", "call yield", X86_FEATURE_ALWAYS); -+ alternative("call yield", "ud2", X86_FEATURE_IA64); -+ -+ sched_clock = paravirt_sched_clock(); -+ if (!jiffies) -+ printk("kpatch: sched_clock: %llu\n", sched_clock); -+#endif -+ -+ pr_debug("kpatch: pr_debug() test\n"); -+ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) -+{ -+ static DEFINE_STATIC_KEY_TRUE(kpatch_key); -+ -+ if (static_branch_unlikely(&mcsafe_key)) -+ printk("kpatch: mcsafe_key\n"); -+ -+ BUG_ON(!static_branch_likely(&kpatch_key)); -+ static_branch_disable(&kpatch_key); -+ BUG_ON(static_branch_likely(&kpatch_key)); -+ static_branch_enable(&kpatch_key); -+} -+#endif - - if (p == SEQ_START_TOKEN) { - seq_puts(m, "# Version 1.1\n"); - seq_puts(m, "# Path Client(Flags) # IPs\n"); -+ seq_puts(m, kpatch_string()); - return 0; - } - -diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c -index 44fa4ea5df76..dc36ec2901b8 100644 ---- a/net/netlink/af_netlink.c -+++ b/net/netlink/af_netlink.c -@@ -2809,4 +2809,9 @@ static int __init netlink_proto_init(void) - panic("netlink_init: Cannot allocate nl_table\n"); - } - -+char *kpatch_string(void) -+{ -+ return "# kpatch\n"; -+} -+ - core_initcall(netlink_proto_init); --- -2.21.1 - diff --git a/test/integration/rhel-8.1/multiple.test b/test/integration/rhel-8.1/multiple.test deleted file mode 100755 index 7e4b3525c..000000000 --- a/test/integration/rhel-8.1/multiple.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -SCRIPTDIR="$(readlink -f $(dirname $(type -p $0)))" - -declare -a blacklist=(meminfo-string-LOADED.test) - -source ${SCRIPTDIR}/../common/multiple.template diff --git a/test/integration/rhel-8.1/new-function.patch b/test/integration/rhel-8.1/new-function.patch deleted file mode 100644 index 3e446dfa2..000000000 --- a/test/integration/rhel-8.1/new-function.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -Nupr src/drivers/tty/n_tty.c src/drivers/tty/n_tty.c ---- src/drivers/tty/n_tty.c 2020-03-11 11:23:23.062516341 +0000 -+++ src/drivers/tty/n_tty.c 2020-03-11 11:37:13.226206161 +0000 -@@ -2296,7 +2296,7 @@ static ssize_t n_tty_read(struct tty_str - * lock themselves) - */ - --static ssize_t n_tty_write(struct tty_struct *tty, struct file *file, -+static ssize_t noinline kpatch_n_tty_write(struct tty_struct *tty, struct file *file, - const unsigned char *buf, size_t nr) - { - const unsigned char *b = buf; -@@ -2383,6 +2383,12 @@ break_out: - return (b - buf) ? b - buf : retval; - } - -+static ssize_t __attribute__((optimize("-fno-optimize-sibling-calls"))) n_tty_write(struct tty_struct *tty, struct file *file, -+ const unsigned char *buf, size_t nr) -+{ -+ return kpatch_n_tty_write(tty, file, buf, nr); -+} -+ - /** - * n_tty_poll - poll method for N_TTY - * @tty: terminal device diff --git a/test/integration/rhel-8.1/new-globals.patch b/test/integration/rhel-8.1/new-globals.patch deleted file mode 100644 index 07aafec8c..000000000 --- a/test/integration/rhel-8.1/new-globals.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff -Nupr src/fs/proc/cmdline.c src/fs/proc/cmdline.c ---- src/fs/proc/cmdline.c 2020-03-11 11:23:26.878602482 +0000 -+++ src/fs/proc/cmdline.c 2020-03-11 11:38:10.295599825 +0000 -@@ -17,3 +17,10 @@ static int __init proc_cmdline_init(void - return 0; - } - fs_initcall(proc_cmdline_init); -+ -+#include -+void kpatch_print_message(void) -+{ -+ if (!jiffies) -+ printk("hello there!\n"); -+} -diff -Nupr src/fs/proc/meminfo.c src/fs/proc/meminfo.c ---- src/fs/proc/meminfo.c 2020-03-11 11:23:26.882602572 +0000 -+++ src/fs/proc/meminfo.c 2020-03-11 11:38:10.295599825 +0000 -@@ -20,6 +20,8 @@ - #include - #include "internal.h" - -+void kpatch_print_message(void); -+ - void __attribute__((weak)) arch_report_meminfo(struct seq_file *m) - { - } -@@ -56,6 +58,7 @@ static int meminfo_proc_show(struct seq_ - sreclaimable = global_node_page_state(NR_SLAB_RECLAIMABLE); - sunreclaim = global_node_page_state(NR_SLAB_UNRECLAIMABLE); - -+ kpatch_print_message(); - show_val_kb(m, "MemTotal: ", i.totalram); - show_val_kb(m, "MemFree: ", i.freeram); - show_val_kb(m, "MemAvailable: ", available); diff --git a/test/integration/rhel-8.1/parainstructions-section.patch b/test/integration/rhel-8.1/parainstructions-section.patch deleted file mode 100644 index 1183f45d8..000000000 --- a/test/integration/rhel-8.1/parainstructions-section.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nupr src/fs/proc/generic.c src/fs/proc/generic.c ---- src/fs/proc/generic.c 2020-03-11 11:23:26.878602482 +0000 -+++ src/fs/proc/generic.c 2020-03-11 11:39:07.677003695 +0000 -@@ -205,6 +205,7 @@ int proc_alloc_inum(unsigned int *inum) - { - int i; - -+ printk("kpatch-test: testing change to .parainstructions section\n"); - i = ida_simple_get(&proc_inum_ida, 0, UINT_MAX - PROC_DYNAMIC_FIRST + 1, - GFP_KERNEL); - if (i < 0) diff --git a/test/integration/rhel-8.1/shadow-newpid-LOADED.test.disabled b/test/integration/rhel-8.1/shadow-newpid-LOADED.test.disabled deleted file mode 100755 index c07d11205..000000000 --- a/test/integration/rhel-8.1/shadow-newpid-LOADED.test.disabled +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -grep -q newpid: /proc/$$/status diff --git a/test/integration/rhel-8.1/shadow-newpid.patch.disabled b/test/integration/rhel-8.1/shadow-newpid.patch.disabled deleted file mode 100644 index f571dc431..000000000 --- a/test/integration/rhel-8.1/shadow-newpid.patch.disabled +++ /dev/null @@ -1,77 +0,0 @@ -Disabled due to https:/github.com/dynup/kpatch/issues/940 ---- -diff -Nupr src/fs/proc/array.c src/fs/proc/array.c ---- src/fs/proc/array.c 2020-03-11 11:23:26.874602392 +0000 -+++ src/fs/proc/array.c 2020-03-11 11:48:34.514964309 +0000 -@@ -370,12 +370,19 @@ static inline void task_seccomp(struct s - seq_putc(m, '\n'); - } - -+#include - static inline void task_context_switch_counts(struct seq_file *m, - struct task_struct *p) - { -+ int *newpid; -+ - seq_put_decimal_ull(m, "voluntary_ctxt_switches:\t", p->nvcsw); - seq_put_decimal_ull(m, "\nnonvoluntary_ctxt_switches:\t", p->nivcsw); - seq_putc(m, '\n'); -+ -+ newpid = klp_shadow_get(p, 0); -+ if (newpid) -+ seq_printf(m, "newpid:\t%d\n", *newpid); - } - - static void task_cpus_allowed(struct seq_file *m, struct task_struct *task) -diff -Nupr src/kernel/exit.c src/kernel/exit.c ---- src/kernel/exit.c 2020-03-11 11:23:30.434682812 +0000 -+++ src/kernel/exit.c 2020-03-11 11:48:34.514964309 +0000 -@@ -762,6 +762,7 @@ static void check_stack_usage(void) - static inline void check_stack_usage(void) {} - #endif - -+#include - void __noreturn do_exit(long code) - { - struct task_struct *tsk = current; -@@ -868,6 +869,8 @@ void __noreturn do_exit(long code) - exit_thread(tsk); - exit_umh(tsk); - -+ klp_shadow_free(tsk, 0, NULL); -+ - /* - * Flush inherited counters to the parent - before the parent - * gets woken up by child-exit notifications. -diff -Nupr src/kernel/fork.c src/kernel/fork.c ---- src/kernel/fork.c 2020-03-11 11:23:30.438682903 +0000 -+++ src/kernel/fork.c 2020-03-11 11:48:34.514964309 +0000 -@@ -2210,6 +2210,7 @@ struct task_struct *fork_idle(int cpu) - * It copies the process, and if successful kick-starts - * it and waits for it to finish using the VM if required. - */ -+#include - long _do_fork(unsigned long clone_flags, - unsigned long stack_start, - unsigned long stack_size, -@@ -2222,6 +2223,8 @@ long _do_fork(unsigned long clone_flags, - struct task_struct *p; - int trace = 0; - long nr; -+ int *newpid; -+ static int ctr = 0; - - /* - * Determine whether and which event to report to ptracer. When -@@ -2248,6 +2251,11 @@ long _do_fork(unsigned long clone_flags, - if (IS_ERR(p)) - return PTR_ERR(p); - -+ newpid = klp_shadow_get_or_alloc(p, 0, sizeof(*newpid), GFP_KERNEL, -+ NULL, NULL); -+ if (newpid) -+ *newpid = ctr++; -+ - /* - * Do this prior waking up the new thread - the thread pointer - * might get invalid after that point, if the thread exits quickly. diff --git a/test/integration/rhel-8.1/smp-locks-section.patch b/test/integration/rhel-8.1/smp-locks-section.patch deleted file mode 100644 index f0794a1f7..000000000 --- a/test/integration/rhel-8.1/smp-locks-section.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -Nupr src/drivers/tty/tty_buffer.c src/drivers/tty/tty_buffer.c ---- src/drivers/tty/tty_buffer.c 2020-03-11 11:23:23.138518056 +0000 -+++ src/drivers/tty/tty_buffer.c 2020-03-11 11:40:04.174388205 +0000 -@@ -256,6 +256,9 @@ static int __tty_buffer_request_room(str - struct tty_buffer *b, *n; - int left, change; - -+ if (!size) -+ printk("kpatch-test: testing .smp_locks section changes\n"); -+ - b = buf->tail; - if (b->flags & TTYB_NORMAL) - left = 2 * b->size - b->used; diff --git a/test/integration/rhel-8.1/special-static.patch.disabled b/test/integration/rhel-8.1/special-static.patch.disabled deleted file mode 100644 index 992f8b97c..000000000 --- a/test/integration/rhel-8.1/special-static.patch.disabled +++ /dev/null @@ -1,22 +0,0 @@ -diff -Nupr src/kernel/fork.c src/kernel/fork.c ---- src/kernel/fork.c 2020-03-11 11:23:30.438682903 +0000 -+++ src/kernel/fork.c 2020-03-11 11:41:01.567796732 +0000 -@@ -1524,10 +1524,18 @@ static void posix_cpu_timers_init_group( - static inline void posix_cpu_timers_init_group(struct signal_struct *sig) { } - #endif - -+void kpatch_foo(void) -+{ -+ if (!jiffies) -+ printk("kpatch copy signal\n"); -+} -+ - static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) - { - struct signal_struct *sig; - -+ kpatch_foo(); -+ - if (clone_flags & CLONE_THREAD) - return 0; - diff --git a/test/integration/rhel-8.1/symvers-disagreement-FAIL.patch b/test/integration/rhel-8.1/symvers-disagreement-FAIL.patch deleted file mode 100644 index 9527641a6..000000000 --- a/test/integration/rhel-8.1/symvers-disagreement-FAIL.patch +++ /dev/null @@ -1,51 +0,0 @@ -From c63702554e54b992793fe3598ea8c8c415bef908 Mon Sep 17 00:00:00 2001 -From: Julien Thierry -Date: Wed, 6 May 2020 14:30:57 +0100 -Subject: [PATCH] Symbol version change - -This change causes: -1) Some exported symbols in drivers/base/core.c to see their CRCs - change. -2) Changes usb_get_dev() referencing a get_device() whose CRC has - changed, causing the symbol and the new CRC to be included in the - __version section of the final module. - -This makes the final module unloadable for the target kernel. - -See "Exported symbol versioning" of the patch author guide for more -detail. - ---- - drivers/base/core.c | 2 ++ - drivers/usb/core/usb.c | 2 ++ - 2 files changed, 4 insertions(+) - -diff --git a/drivers/base/core.c b/drivers/base/core.c -index 2ab316d85651..2ef19920f6ab 100644 ---- a/drivers/base/core.c -+++ b/drivers/base/core.c -@@ -29,6 +29,8 @@ - #include "base.h" - #include "power/power.h" - -+#include -+ - #ifdef CONFIG_SYSFS_DEPRECATED - #ifdef CONFIG_SYSFS_DEPRECATED_V2 - long sysfs_deprecated = 1; -diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c -index 0a2b261a27c9..51a1868c9cea 100644 ---- a/drivers/usb/core/usb.c -+++ b/drivers/usb/core/usb.c -@@ -685,6 +685,8 @@ EXPORT_SYMBOL_GPL(usb_alloc_dev); - */ - struct usb_device *usb_get_dev(struct usb_device *dev) - { -+ barrier(); -+ - if (dev) - get_device(&dev->dev); - return dev; --- -2.21.3 - diff --git a/test/integration/rhel-8.1/tracepoints-section.patch b/test/integration/rhel-8.1/tracepoints-section.patch deleted file mode 100644 index ab5e316ea..000000000 --- a/test/integration/rhel-8.1/tracepoints-section.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -Nupr src/kernel/time/timer.c src/kernel/time/timer.c ---- src/kernel/time/timer.c 2020-03-11 11:23:30.542685253 +0000 -+++ src/kernel/time/timer.c 2020-03-11 11:41:58.129186658 +0000 -@@ -1692,6 +1692,9 @@ static __latent_entropy void run_timer_s - { - struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]); - -+ if (!base) -+ printk("kpatch-test: testing __tracepoints section changes\n"); -+ - __run_timers(base); - if (IS_ENABLED(CONFIG_NO_HZ_COMMON)) - __run_timers(this_cpu_ptr(&timer_bases[BASE_DEF])); diff --git a/test/integration/rhel-8.1/warn-detect-FAIL.patch b/test/integration/rhel-8.1/warn-detect-FAIL.patch deleted file mode 100644 index a00fe055a..000000000 --- a/test/integration/rhel-8.1/warn-detect-FAIL.patch +++ /dev/null @@ -1,8 +0,0 @@ -diff -Nupr src/arch/x86/kvm/x86.c src/arch/x86/kvm/x86.c ---- src/arch/x86/kvm/x86.c 2020-03-11 11:22:57.389938541 +0000 -+++ src/arch/x86/kvm/x86.c 2020-03-11 11:42:55.798605475 +0000 -@@ -1,3 +1,4 @@ -+ - /* - * Kernel-based Virtual Machine driver for Linux - *