livepatch: kernel.ftrace_enabled = 1 % modprobe test_klp_livepatch livepatch: enabling patch 'test_klp_livepatch' livepatch: 'test_klp_livepatch': initializing patching transition livepatch: 'test_klp_livepatch': starting patching transition livepatch: 'test_klp_livepatch': completing patching transition livepatch: 'test_klp_livepatch': patching complete % echo 0 > /sys/kernel/livepatch/test_klp_livepatch/enabled livepatch: 'test_klp_livepatch': initializing unpatching transition livepatch: 'test_klp_livepatch': starting unpatching transition livepatch: 'test_klp_livepatch': completing unpatching transition livepatch: 'test_klp_livepatch': unpatching complete % rmmod test_klp_livepatch % modprobe test_klp_livepatch livepatch: enabling patch 'test_klp_livepatch' livepatch: 'test_klp_livepatch': initializing patching transition livepatch: 'test_klp_livepatch': starting patching transition livepatch: 'test_klp_livepatch': completing patching transition livepatch: 'test_klp_livepatch': patching complete test_klp_livepatch: this has been live patched % modprobe test_klp_atomic_replace replace=0 livepatch: enabling patch 'test_klp_atomic_replace' livepatch: 'test_klp_atomic_replace': initializing patching transition livepatch: 'test_klp_atomic_replace': starting patching transition livepatch: 'test_klp_atomic_replace': completing patching transition livepatch: 'test_klp_atomic_replace': patching complete test_klp_livepatch: this has been live patched test_klp_atomic_replace: this has been live patched % echo 0 > /sys/kernel/livepatch/test_klp_atomic_replace/enabled livepatch: 'test_klp_atomic_replace': initializing unpatching transition livepatch: 'test_klp_atomic_replace': starting unpatching transition livepatch: 'test_klp_atomic_replace': completing unpatching transition livepatch: 'test_klp_atomic_replace': unpatching complete % rmmod test_klp_atomic_replace test_klp_livepatch: this has been live patched % echo 0 > /sys/kernel/livepatch/test_klp_livepatch/enabled livepatch: 'test_klp_livepatch': initializing unpatching transition livepatch: 'test_klp_livepatch': starting unpatching transition livepatch: 'test_klp_livepatch': completing unpatching transition livepatch: 'test_klp_livepatch': unpatching complete % rmmod test_klp_livepatch % modprobe test_klp_livepatch livepatch: enabling patch 'test_klp_livepatch' livepatch: 'test_klp_livepatch': initializing patching transition livepatch: 'test_klp_livepatch': starting patching transition livepatch: 'test_klp_livepatch': completing patching transition livepatch: 'test_klp_livepatch': patching complete test_klp_livepatch: this has been live patched % modprobe test_klp_atomic_replace replace=1 livepatch: enabling patch 'test_klp_atomic_replace' livepatch: 'test_klp_atomic_replace': initializing patching transition livepatch: 'test_klp_atomic_replace': starting patching transition livepatch: 'test_klp_atomic_replace': completing patching transition livepatch: 'test_klp_atomic_replace': patching complete test_klp_atomic_replace: this has been live patched % rmmod test_klp_livepatch test_klp_atomic_replace: this has been live patched % echo 0 > /sys/kernel/livepatch/test_klp_atomic_replace/enabled livepatch: 'test_klp_atomic_replace': initializing unpatching transition livepatch: 'test_klp_atomic_replace': starting unpatching transition livepatch: 'test_klp_atomic_replace': completing unpatching transition livepatch: 'test_klp_atomic_replace': unpatching complete % rmmod test_klp_atomic_replace livepatch: kernel.ftrace_enabled = 1 % modprobe test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_init % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux test_klp_callbacks_demo: post_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': patching complete % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': patching complete % modprobe test_klp_callbacks_mod livepatch: applying patch 'test_klp_callbacks_demo' to loading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_demo: post_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_mod: test_klp_callbacks_mod_init % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit % modprobe test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_init % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux test_klp_callbacks_demo: post_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': patching complete % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away livepatch: reverting patch 'test_klp_callbacks_demo' on unloading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': patching complete % modprobe test_klp_callbacks_mod livepatch: applying patch 'test_klp_callbacks_demo' to loading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_demo: post_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_mod: test_klp_callbacks_mod_init % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away livepatch: reverting patch 'test_klp_callbacks_demo' on unloading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': patching complete % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % modprobe test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_init % modprobe test_klp_callbacks_demo pre_patch_ret=-19 livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux livepatch: pre-patch callback failed for object 'vmlinux' livepatch: failed to enable patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': canceling patching transition, going to unpatch livepatch: 'test_klp_callbacks_demo': completing unpatching transition livepatch: 'test_klp_callbacks_demo': unpatching complete modprobe: ERROR: could not insert 'test_klp_callbacks_demo': No such device % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': patching complete % echo -19 > /sys/module/test_klp_callbacks_demo/parameters/pre_patch_ret % modprobe test_klp_callbacks_mod livepatch: applying patch 'test_klp_callbacks_demo' to loading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init livepatch: pre-patch callback failed for object 'test_klp_callbacks_mod' livepatch: patch 'test_klp_callbacks_demo' failed for module 'test_klp_callbacks_mod', refusing to load module 'test_klp_callbacks_mod' modprobe: ERROR: could not insert 'test_klp_callbacks_mod': No such device % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % modprobe test_klp_callbacks_busy block_transition=N test_klp_callbacks_busy: test_klp_callbacks_busy_init test_klp_callbacks_busy: busymod_work_func enter test_klp_callbacks_busy: busymod_work_func exit % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_busy -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux test_klp_callbacks_demo: post_patch_callback: test_klp_callbacks_busy -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': patching complete % modprobe test_klp_callbacks_mod livepatch: applying patch 'test_klp_callbacks_demo' to loading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_demo: post_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_mod: test_klp_callbacks_mod_init % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away livepatch: reverting patch 'test_klp_callbacks_demo' on unloading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_busy -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_busy -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % rmmod test_klp_callbacks_busy test_klp_callbacks_busy: test_klp_callbacks_busy_exit % modprobe test_klp_callbacks_busy block_transition=Y test_klp_callbacks_busy: test_klp_callbacks_busy_init test_klp_callbacks_busy: busymod_work_func enter % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_busy -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': starting patching transition % modprobe test_klp_callbacks_mod livepatch: applying patch 'test_klp_callbacks_demo' to loading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_mod: test_klp_callbacks_mod_init % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit livepatch: reverting patch 'test_klp_callbacks_demo' on unloading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': reversing transition from patching to unpatching livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_busy -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % rmmod test_klp_callbacks_busy test_klp_callbacks_busy: busymod_work_func exit test_klp_callbacks_busy: test_klp_callbacks_busy_exit % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': patching complete % modprobe test_klp_callbacks_demo2 livepatch: enabling patch 'test_klp_callbacks_demo2' livepatch: 'test_klp_callbacks_demo2': initializing patching transition test_klp_callbacks_demo2: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo2': starting patching transition livepatch: 'test_klp_callbacks_demo2': completing patching transition test_klp_callbacks_demo2: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo2': patching complete % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo2/enabled livepatch: 'test_klp_callbacks_demo2': initializing unpatching transition test_klp_callbacks_demo2: pre_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo2': starting unpatching transition livepatch: 'test_klp_callbacks_demo2': completing unpatching transition test_klp_callbacks_demo2: post_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo2': unpatching complete % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo2 % rmmod test_klp_callbacks_demo % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': patching complete % modprobe test_klp_callbacks_demo2 replace=1 livepatch: enabling patch 'test_klp_callbacks_demo2' livepatch: 'test_klp_callbacks_demo2': initializing patching transition test_klp_callbacks_demo2: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo2': starting patching transition livepatch: 'test_klp_callbacks_demo2': completing patching transition test_klp_callbacks_demo2: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo2': patching complete % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo2/enabled livepatch: 'test_klp_callbacks_demo2': initializing unpatching transition test_klp_callbacks_demo2: pre_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo2': starting unpatching transition livepatch: 'test_klp_callbacks_demo2': completing unpatching transition test_klp_callbacks_demo2: post_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo2': unpatching complete % rmmod test_klp_callbacks_demo2 % rmmod test_klp_callbacks_demo livepatch: kernel.ftrace_enabled = 1 % modprobe test_klp_shadow_vars test_klp_shadow_vars: klp_shadow_get(obj=PTR1, id=0x1234) = PTR0 test_klp_shadow_vars: got expected NULL result test_klp_shadow_vars: shadow_ctor: PTR3 -> PTR2 test_klp_shadow_vars: klp_shadow_get_or_alloc(obj=PTR1, id=0x1234, size=8, gfp_flags=GFP_KERNEL), ctor=PTR4, ctor_data=PTR2 = PTR3 test_klp_shadow_vars: shadow_ctor: PTR6 -> PTR5 test_klp_shadow_vars: klp_shadow_alloc(obj=PTR1, id=0x1235, size=8, gfp_flags=GFP_KERNEL), ctor=PTR4, ctor_data=PTR5 = PTR6 test_klp_shadow_vars: shadow_ctor: PTR8 -> PTR7 test_klp_shadow_vars: klp_shadow_alloc(obj=PTR9, id=0x1234, size=8, gfp_flags=GFP_KERNEL), ctor=PTR4, ctor_data=PTR7 = PTR8 test_klp_shadow_vars: shadow_ctor: PTR11 -> PTR10 test_klp_shadow_vars: klp_shadow_alloc(obj=PTR9, id=0x1235, size=8, gfp_flags=GFP_KERNEL), ctor=PTR4, ctor_data=PTR10 = PTR11 test_klp_shadow_vars: shadow_ctor: PTR13 -> PTR12 test_klp_shadow_vars: klp_shadow_get_or_alloc(obj=PTR14, id=0x1234, size=8, gfp_flags=GFP_KERNEL), ctor=PTR4, ctor_data=PTR12 = PTR13 test_klp_shadow_vars: shadow_ctor: PTR16 -> PTR15 test_klp_shadow_vars: klp_shadow_alloc(obj=PTR14, id=0x1235, size=8, gfp_flags=GFP_KERNEL), ctor=PTR4, ctor_data=PTR15 = PTR16 test_klp_shadow_vars: klp_shadow_get(obj=PTR1, id=0x1234) = PTR3 test_klp_shadow_vars: got expected PTR3 -> PTR2 result test_klp_shadow_vars: klp_shadow_get(obj=PTR1, id=0x1235) = PTR6 test_klp_shadow_vars: got expected PTR6 -> PTR5 result test_klp_shadow_vars: klp_shadow_get(obj=PTR9, id=0x1234) = PTR8 test_klp_shadow_vars: got expected PTR8 -> PTR7 result test_klp_shadow_vars: klp_shadow_get(obj=PTR9, id=0x1235) = PTR11 test_klp_shadow_vars: got expected PTR11 -> PTR10 result test_klp_shadow_vars: klp_shadow_get(obj=PTR14, id=0x1234) = PTR13 test_klp_shadow_vars: got expected PTR13 -> PTR12 result test_klp_shadow_vars: klp_shadow_get(obj=PTR14, id=0x1235) = PTR16 test_klp_shadow_vars: got expected PTR16 -> PTR15 result test_klp_shadow_vars: klp_shadow_get_or_alloc(obj=PTR1, id=0x1234, size=8, gfp_flags=GFP_KERNEL), ctor=PTR4, ctor_data=PTR2 = PTR3 test_klp_shadow_vars: got expected PTR3 -> PTR2 result test_klp_shadow_vars: klp_shadow_get_or_alloc(obj=PTR9, id=0x1234, size=8, gfp_flags=GFP_KERNEL), ctor=PTR4, ctor_data=PTR7 = PTR8 test_klp_shadow_vars: got expected PTR8 -> PTR7 result test_klp_shadow_vars: klp_shadow_get_or_alloc(obj=PTR14, id=0x1234, size=8, gfp_flags=GFP_KERNEL), ctor=PTR4, ctor_data=PTR12 = PTR13 test_klp_shadow_vars: got expected PTR13 -> PTR12 result test_klp_shadow_vars: shadow_dtor(obj=PTR1, shadow_data=PTR3) test_klp_shadow_vars: klp_shadow_free(obj=PTR1, id=0x1234, dtor=PTR17) test_klp_shadow_vars: klp_shadow_get(obj=PTR1, id=0x1234) = PTR0 test_klp_shadow_vars: got expected NULL result test_klp_shadow_vars: shadow_dtor(obj=PTR9, shadow_data=PTR8) test_klp_shadow_vars: klp_shadow_free(obj=PTR9, id=0x1234, dtor=PTR17) test_klp_shadow_vars: klp_shadow_get(obj=PTR9, id=0x1234) = PTR0 test_klp_shadow_vars: got expected NULL result test_klp_shadow_vars: shadow_dtor(obj=PTR14, shadow_data=PTR13) test_klp_shadow_vars: klp_shadow_free(obj=PTR14, id=0x1234, dtor=PTR17) test_klp_shadow_vars: klp_shadow_get(obj=PTR14, id=0x1234) = PTR0 test_klp_shadow_vars: got expected NULL result test_klp_shadow_vars: klp_shadow_get(obj=PTR1, id=0x1235) = PTR6 test_klp_shadow_vars: got expected PTR6 -> PTR5 result test_klp_shadow_vars: klp_shadow_get(obj=PTR9, id=0x1235) = PTR11 test_klp_shadow_vars: got expected PTR11 -> PTR10 result test_klp_shadow_vars: klp_shadow_get(obj=PTR14, id=0x1235) = PTR16 test_klp_shadow_vars: got expected PTR16 -> PTR15 result test_klp_shadow_vars: klp_shadow_free_all(id=0x1235, dtor=PTR0) test_klp_shadow_vars: klp_shadow_get(obj=PTR1, id=0x1235) = PTR0 test_klp_shadow_vars: got expected NULL result test_klp_shadow_vars: klp_shadow_get(obj=PTR9, id=0x1235) = PTR0 test_klp_shadow_vars: got expected NULL result test_klp_shadow_vars: klp_shadow_get(obj=PTR14, id=0x1235) = PTR0 test_klp_shadow_vars: got expected NULL result % rmmod test_klp_shadow_vars livepatch: kernel.ftrace_enabled = 1 % modprobe test_klp_state livepatch: enabling patch 'test_klp_state' livepatch: 'test_klp_state': initializing patching transition test_klp_state: pre_patch_callback: vmlinux test_klp_state: allocate_loglevel_state: allocating space to store console_loglevel livepatch: 'test_klp_state': starting patching transition livepatch: 'test_klp_state': completing patching transition test_klp_state: post_patch_callback: vmlinux test_klp_state: fix_console_loglevel: fixing console_loglevel livepatch: 'test_klp_state': patching complete % echo 0 > /sys/kernel/livepatch/test_klp_state/enabled livepatch: 'test_klp_state': initializing unpatching transition test_klp_state: pre_unpatch_callback: vmlinux test_klp_state: restore_console_loglevel: restoring console_loglevel livepatch: 'test_klp_state': starting unpatching transition livepatch: 'test_klp_state': completing unpatching transition test_klp_state: post_unpatch_callback: vmlinux test_klp_state: free_loglevel_state: freeing space for the stored console_loglevel livepatch: 'test_klp_state': unpatching complete % rmmod test_klp_state % modprobe test_klp_state livepatch: enabling patch 'test_klp_state' livepatch: 'test_klp_state': initializing patching transition test_klp_state: pre_patch_callback: vmlinux test_klp_state: allocate_loglevel_state: allocating space to store console_loglevel livepatch: 'test_klp_state': starting patching transition livepatch: 'test_klp_state': completing patching transition test_klp_state: post_patch_callback: vmlinux test_klp_state: fix_console_loglevel: fixing console_loglevel livepatch: 'test_klp_state': patching complete % modprobe test_klp_state2 livepatch: enabling patch 'test_klp_state2' livepatch: 'test_klp_state2': initializing patching transition test_klp_state2: pre_patch_callback: vmlinux test_klp_state2: allocate_loglevel_state: space to store console_loglevel already allocated livepatch: 'test_klp_state2': starting patching transition livepatch: 'test_klp_state2': completing patching transition test_klp_state2: post_patch_callback: vmlinux test_klp_state2: fix_console_loglevel: taking over the console_loglevel change livepatch: 'test_klp_state2': patching complete % rmmod test_klp_state % echo 0 > /sys/kernel/livepatch/test_klp_state2/enabled livepatch: 'test_klp_state2': initializing unpatching transition test_klp_state2: pre_unpatch_callback: vmlinux test_klp_state2: restore_console_loglevel: restoring console_loglevel livepatch: 'test_klp_state2': starting unpatching transition livepatch: 'test_klp_state2': completing unpatching transition test_klp_state2: post_unpatch_callback: vmlinux test_klp_state2: free_loglevel_state: freeing space for the stored console_loglevel livepatch: 'test_klp_state2': unpatching complete % rmmod test_klp_state2 % modprobe test_klp_state2 livepatch: enabling patch 'test_klp_state2' livepatch: 'test_klp_state2': initializing patching transition test_klp_state2: pre_patch_callback: vmlinux test_klp_state2: allocate_loglevel_state: allocating space to store console_loglevel livepatch: 'test_klp_state2': starting patching transition livepatch: 'test_klp_state2': completing patching transition test_klp_state2: post_patch_callback: vmlinux test_klp_state2: fix_console_loglevel: fixing console_loglevel livepatch: 'test_klp_state2': patching complete % modprobe test_klp_state3 livepatch: enabling patch 'test_klp_state3' livepatch: 'test_klp_state3': initializing patching transition test_klp_state3: pre_patch_callback: vmlinux test_klp_state3: allocate_loglevel_state: space to store console_loglevel already allocated livepatch: 'test_klp_state3': starting patching transition livepatch: 'test_klp_state3': completing patching transition test_klp_state3: post_patch_callback: vmlinux test_klp_state3: fix_console_loglevel: taking over the console_loglevel change livepatch: 'test_klp_state3': patching complete % rmmod test_klp_state2 % modprobe test_klp_state2 livepatch: enabling patch 'test_klp_state2' livepatch: 'test_klp_state2': initializing patching transition test_klp_state2: pre_patch_callback: vmlinux test_klp_state2: allocate_loglevel_state: space to store console_loglevel already allocated livepatch: 'test_klp_state2': starting patching transition livepatch: 'test_klp_state2': completing patching transition test_klp_state2: post_patch_callback: vmlinux test_klp_state2: fix_console_loglevel: taking over the console_loglevel change livepatch: 'test_klp_state2': patching complete % echo 0 > /sys/kernel/livepatch/test_klp_state2/enabled livepatch: 'test_klp_state2': initializing unpatching transition test_klp_state2: pre_unpatch_callback: vmlinux test_klp_state2: restore_console_loglevel: restoring console_loglevel livepatch: 'test_klp_state2': starting unpatching transition livepatch: 'test_klp_state2': completing unpatching transition test_klp_state2: post_unpatch_callback: vmlinux test_klp_state2: free_loglevel_state: freeing space for the stored console_loglevel livepatch: 'test_klp_state2': unpatching complete % rmmod test_klp_state2 % rmmod test_klp_state3 % modprobe test_klp_state2 livepatch: enabling patch 'test_klp_state2' livepatch: 'test_klp_state2': initializing patching transition test_klp_state2: pre_patch_callback: vmlinux test_klp_state2: allocate_loglevel_state: allocating space to store console_loglevel livepatch: 'test_klp_state2': starting patching transition livepatch: 'test_klp_state2': completing patching transition test_klp_state2: post_patch_callback: vmlinux test_klp_state2: fix_console_loglevel: fixing console_loglevel livepatch: 'test_klp_state2': patching complete % modprobe test_klp_state livepatch: Livepatch patch (test_klp_state) is not compatible with the already installed livepatches. modprobe: ERROR: could not insert 'test_klp_state': Invalid argument % echo 0 > /sys/kernel/livepatch/test_klp_state2/enabled livepatch: 'test_klp_state2': initializing unpatching transition test_klp_state2: pre_unpatch_callback: vmlinux test_klp_state2: restore_console_loglevel: restoring console_loglevel livepatch: 'test_klp_state2': starting unpatching transition livepatch: 'test_klp_state2': completing unpatching transition test_klp_state2: post_unpatch_callback: vmlinux test_klp_state2: free_loglevel_state: freeing space for the stored console_loglevel livepatch: 'test_klp_state2': unpatching complete % rmmod test_klp_state2 livepatch: kernel.ftrace_enabled = 1 livepatch: kernel.ftrace_enabled = 0 % modprobe test_klp_livepatch livepatch: enabling patch 'test_klp_livepatch' livepatch: 'test_klp_livepatch': initializing patching transition livepatch: failed to register ftrace handler for function 'cmdline_proc_show' (-16) livepatch: failed to patch object 'vmlinux' livepatch: failed to enable patch 'test_klp_livepatch' livepatch: 'test_klp_livepatch': canceling patching transition, going to unpatch livepatch: 'test_klp_livepatch': completing unpatching transition livepatch: 'test_klp_livepatch': unpatching complete modprobe: ERROR: could not insert 'test_klp_livepatch': Device or resource busy livepatch: kernel.ftrace_enabled = 1 % modprobe test_klp_livepatch livepatch: enabling patch 'test_klp_livepatch' livepatch: 'test_klp_livepatch': initializing patching transition livepatch: 'test_klp_livepatch': starting patching transition livepatch: 'test_klp_livepatch': completing patching transition livepatch: 'test_klp_livepatch': patching complete livepatch: sysctl: setting key "kernel.ftrace_enabled": Device or resource busy % echo 0 > /sys/kernel/livepatch/test_klp_livepatch/enabled livepatch: 'test_klp_livepatch': initializing unpatching transition livepatch: 'test_klp_livepatch': starting unpatching transition livepatch: 'test_klp_livepatch': completing unpatching transition livepatch: 'test_klp_livepatch': unpatching complete % rmmod test_klp_livepatch livepatch: kernel.ftrace_enabled = 1 % modprobe test_klp_livepatch livepatch: enabling patch 'test_klp_livepatch' livepatch: 'test_klp_livepatch': initializing patching transition livepatch: 'test_klp_livepatch': starting patching transition livepatch: 'test_klp_livepatch': completing patching transition livepatch: 'test_klp_livepatch': patching complete % echo 0 > /sys/kernel/livepatch/test_klp_livepatch/enabled livepatch: 'test_klp_livepatch': initializing unpatching transition livepatch: 'test_klp_livepatch': starting unpatching transition livepatch: 'test_klp_livepatch': completing unpatching transition livepatch: 'test_klp_livepatch': unpatching complete % rmmod test_klp_livepatch % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': patching complete % modprobe test_klp_callbacks_mod livepatch: applying patch 'test_klp_callbacks_demo' to loading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_demo: post_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_mod: test_klp_callbacks_mod_init % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away livepatch: reverting patch 'test_klp_callbacks_demo' on unloading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo livepatch: kernel.ftrace_enabled = 1 % modprobe test_klp_livepatch livepatch: enabling patch 'test_klp_livepatch' livepatch: 'test_klp_livepatch': initializing patching transition livepatch: 'test_klp_livepatch': starting patching transition livepatch: 'test_klp_livepatch': completing patching transition livepatch: 'test_klp_livepatch': patching complete % echo 0 > /sys/kernel/livepatch/test_klp_livepatch/enabled livepatch: 'test_klp_livepatch': initializing unpatching transition livepatch: 'test_klp_livepatch': starting unpatching transition livepatch: 'test_klp_livepatch': completing unpatching transition livepatch: 'test_klp_livepatch': unpatching complete % rmmod test_klp_livepatch % modprobe test_klp_livepatch livepatch: enabling patch 'test_klp_livepatch' livepatch: 'test_klp_livepatch': initializing patching transition livepatch: 'test_klp_livepatch': starting patching transition livepatch: 'test_klp_livepatch': completing patching transition livepatch: 'test_klp_livepatch': patching complete test_klp_livepatch: this has been live patched % modprobe test_klp_atomic_replace replace=0 livepatch: enabling patch 'test_klp_atomic_replace' livepatch: 'test_klp_atomic_replace': initializing patching transition livepatch: 'test_klp_atomic_replace': starting patching transition livepatch: 'test_klp_atomic_replace': completing patching transition livepatch: 'test_klp_atomic_replace': patching complete test_klp_livepatch: this has been live patched test_klp_atomic_replace: this has been live patched % echo 0 > /sys/kernel/livepatch/test_klp_atomic_replace/enabled livepatch: 'test_klp_atomic_replace': initializing unpatching transition livepatch: 'test_klp_atomic_replace': starting unpatching transition livepatch: 'test_klp_atomic_replace': completing unpatching transition livepatch: 'test_klp_atomic_replace': unpatching complete % rmmod test_klp_atomic_replace test_klp_livepatch: this has been live patched % echo 0 > /sys/kernel/livepatch/test_klp_livepatch/enabled livepatch: 'test_klp_livepatch': initializing unpatching transition livepatch: 'test_klp_livepatch': starting unpatching transition livepatch: 'test_klp_livepatch': completing unpatching transition livepatch: 'test_klp_livepatch': unpatching complete % rmmod test_klp_livepatch % modprobe test_klp_livepatch livepatch: enabling patch 'test_klp_livepatch' livepatch: 'test_klp_livepatch': initializing patching transition livepatch: 'test_klp_livepatch': starting patching transition livepatch: 'test_klp_livepatch': completing patching transition livepatch: 'test_klp_livepatch': patching complete test_klp_livepatch: this has been live patched % modprobe test_klp_atomic_replace replace=1 livepatch: enabling patch 'test_klp_atomic_replace' livepatch: 'test_klp_atomic_replace': initializing patching transition livepatch: 'test_klp_atomic_replace': starting patching transition livepatch: 'test_klp_atomic_replace': completing patching transition livepatch: 'test_klp_atomic_replace': patching complete test_klp_atomic_replace: this has been live patched % rmmod test_klp_livepatch test_klp_atomic_replace: this has been live patched % echo 0 > /sys/kernel/livepatch/test_klp_atomic_replace/enabled livepatch: 'test_klp_atomic_replace': initializing unpatching transition livepatch: 'test_klp_atomic_replace': starting unpatching transition livepatch: 'test_klp_atomic_replace': completing unpatching transition livepatch: 'test_klp_atomic_replace': unpatching complete % rmmod test_klp_atomic_replace livepatch: kernel.ftrace_enabled = 1 % modprobe test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_init % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux test_klp_callbacks_demo: post_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': patching complete % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': patching complete % modprobe test_klp_callbacks_mod livepatch: applying patch 'test_klp_callbacks_demo' to loading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_demo: post_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_mod: test_klp_callbacks_mod_init % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit % modprobe test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_init % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux test_klp_callbacks_demo: post_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': patching complete % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away livepatch: reverting patch 'test_klp_callbacks_demo' on unloading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': patching complete % modprobe test_klp_callbacks_mod livepatch: applying patch 'test_klp_callbacks_demo' to loading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_demo: post_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_mod: test_klp_callbacks_mod_init % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away livepatch: reverting patch 'test_klp_callbacks_demo' on unloading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': patching complete % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % modprobe test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_init % modprobe test_klp_callbacks_demo pre_patch_ret=-19 livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux livepatch: pre-patch callback failed for object 'vmlinux' livepatch: failed to enable patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': canceling patching transition, going to unpatch livepatch: 'test_klp_callbacks_demo': completing unpatching transition livepatch: 'test_klp_callbacks_demo': unpatching complete modprobe: ERROR: could not insert 'test_klp_callbacks_demo': No such device % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': patching complete % echo -19 > /sys/module/test_klp_callbacks_demo/parameters/pre_patch_ret % modprobe test_klp_callbacks_mod livepatch: applying patch 'test_klp_callbacks_demo' to loading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init livepatch: pre-patch callback failed for object 'test_klp_callbacks_mod' livepatch: patch 'test_klp_callbacks_demo' failed for module 'test_klp_callbacks_mod', refusing to load module 'test_klp_callbacks_mod' modprobe: ERROR: could not insert 'test_klp_callbacks_mod': No such device % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % modprobe test_klp_callbacks_busy block_transition=N test_klp_callbacks_busy: test_klp_callbacks_busy_init test_klp_callbacks_busy: busymod_work_func enter test_klp_callbacks_busy: busymod_work_func exit % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_busy -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux test_klp_callbacks_demo: post_patch_callback: test_klp_callbacks_busy -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': patching complete % modprobe test_klp_callbacks_mod livepatch: applying patch 'test_klp_callbacks_demo' to loading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_demo: post_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_mod: test_klp_callbacks_mod_init % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away livepatch: reverting patch 'test_klp_callbacks_demo' on unloading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_busy -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_busy -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % rmmod test_klp_callbacks_busy test_klp_callbacks_busy: test_klp_callbacks_busy_exit % modprobe test_klp_callbacks_busy block_transition=Y test_klp_callbacks_busy: test_klp_callbacks_busy_init test_klp_callbacks_busy: busymod_work_func enter % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_busy -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': starting patching transition % modprobe test_klp_callbacks_mod livepatch: applying patch 'test_klp_callbacks_demo' to loading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_mod: test_klp_callbacks_mod_init % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit livepatch: reverting patch 'test_klp_callbacks_demo' on unloading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': reversing transition from patching to unpatching livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_busy -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % rmmod test_klp_callbacks_busy test_klp_callbacks_busy: busymod_work_func exit test_klp_callbacks_busy: test_klp_callbacks_busy_exit % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': patching complete % modprobe test_klp_callbacks_demo2 livepatch: enabling patch 'test_klp_callbacks_demo2' livepatch: 'test_klp_callbacks_demo2': initializing patching transition test_klp_callbacks_demo2: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo2': starting patching transition livepatch: 'test_klp_callbacks_demo2': completing patching transition test_klp_callbacks_demo2: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo2': patching complete % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo2/enabled livepatch: 'test_klp_callbacks_demo2': initializing unpatching transition test_klp_callbacks_demo2: pre_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo2': starting unpatching transition livepatch: 'test_klp_callbacks_demo2': completing unpatching transition test_klp_callbacks_demo2: post_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo2': unpatching complete % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo2 % rmmod test_klp_callbacks_demo % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': patching complete % modprobe test_klp_callbacks_demo2 replace=1 livepatch: enabling patch 'test_klp_callbacks_demo2' livepatch: 'test_klp_callbacks_demo2': initializing patching transition test_klp_callbacks_demo2: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo2': starting patching transition livepatch: 'test_klp_callbacks_demo2': completing patching transition test_klp_callbacks_demo2: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo2': patching complete % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo2/enabled livepatch: 'test_klp_callbacks_demo2': initializing unpatching transition test_klp_callbacks_demo2: pre_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo2': starting unpatching transition livepatch: 'test_klp_callbacks_demo2': completing unpatching transition test_klp_callbacks_demo2: post_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo2': unpatching complete % rmmod test_klp_callbacks_demo2 % rmmod test_klp_callbacks_demo livepatch: kernel.ftrace_enabled = 1 % modprobe test_klp_shadow_vars test_klp_shadow_vars: klp_shadow_get(obj=PTR1, id=0x1234) = PTR0 test_klp_shadow_vars: got expected NULL result test_klp_shadow_vars: shadow_ctor: PTR3 -> PTR2 test_klp_shadow_vars: klp_shadow_get_or_alloc(obj=PTR1, id=0x1234, size=8, gfp_flags=GFP_KERNEL), ctor=PTR4, ctor_data=PTR2 = PTR3 test_klp_shadow_vars: shadow_ctor: PTR6 -> PTR5 test_klp_shadow_vars: klp_shadow_alloc(obj=PTR1, id=0x1235, size=8, gfp_flags=GFP_KERNEL), ctor=PTR4, ctor_data=PTR5 = PTR6 test_klp_shadow_vars: shadow_ctor: PTR8 -> PTR7 test_klp_shadow_vars: klp_shadow_alloc(obj=PTR9, id=0x1234, size=8, gfp_flags=GFP_KERNEL), ctor=PTR4, ctor_data=PTR7 = PTR8 test_klp_shadow_vars: shadow_ctor: PTR11 -> PTR10 test_klp_shadow_vars: klp_shadow_alloc(obj=PTR9, id=0x1235, size=8, gfp_flags=GFP_KERNEL), ctor=PTR4, ctor_data=PTR10 = PTR11 test_klp_shadow_vars: shadow_ctor: PTR13 -> PTR12 test_klp_shadow_vars: klp_shadow_get_or_alloc(obj=PTR14, id=0x1234, size=8, gfp_flags=GFP_KERNEL), ctor=PTR4, ctor_data=PTR12 = PTR13 test_klp_shadow_vars: shadow_ctor: PTR16 -> PTR15 test_klp_shadow_vars: klp_shadow_alloc(obj=PTR14, id=0x1235, size=8, gfp_flags=GFP_KERNEL), ctor=PTR4, ctor_data=PTR15 = PTR16 test_klp_shadow_vars: klp_shadow_get(obj=PTR1, id=0x1234) = PTR3 test_klp_shadow_vars: got expected PTR3 -> PTR2 result test_klp_shadow_vars: klp_shadow_get(obj=PTR1, id=0x1235) = PTR6 test_klp_shadow_vars: got expected PTR6 -> PTR5 result test_klp_shadow_vars: klp_shadow_get(obj=PTR9, id=0x1234) = PTR8 test_klp_shadow_vars: got expected PTR8 -> PTR7 result test_klp_shadow_vars: klp_shadow_get(obj=PTR9, id=0x1235) = PTR11 test_klp_shadow_vars: got expected PTR11 -> PTR10 result test_klp_shadow_vars: klp_shadow_get(obj=PTR14, id=0x1234) = PTR13 test_klp_shadow_vars: got expected PTR13 -> PTR12 result test_klp_shadow_vars: klp_shadow_get(obj=PTR14, id=0x1235) = PTR16 test_klp_shadow_vars: got expected PTR16 -> PTR15 result test_klp_shadow_vars: klp_shadow_get_or_alloc(obj=PTR1, id=0x1234, size=8, gfp_flags=GFP_KERNEL), ctor=PTR4, ctor_data=PTR2 = PTR3 test_klp_shadow_vars: got expected PTR3 -> PTR2 result test_klp_shadow_vars: klp_shadow_get_or_alloc(obj=PTR9, id=0x1234, size=8, gfp_flags=GFP_KERNEL), ctor=PTR4, ctor_data=PTR7 = PTR8 test_klp_shadow_vars: got expected PTR8 -> PTR7 result test_klp_shadow_vars: klp_shadow_get_or_alloc(obj=PTR14, id=0x1234, size=8, gfp_flags=GFP_KERNEL), ctor=PTR4, ctor_data=PTR12 = PTR13 test_klp_shadow_vars: got expected PTR13 -> PTR12 result test_klp_shadow_vars: shadow_dtor(obj=PTR1, shadow_data=PTR3) test_klp_shadow_vars: klp_shadow_free(obj=PTR1, id=0x1234, dtor=PTR17) test_klp_shadow_vars: klp_shadow_get(obj=PTR1, id=0x1234) = PTR0 test_klp_shadow_vars: got expected NULL result test_klp_shadow_vars: shadow_dtor(obj=PTR9, shadow_data=PTR8) test_klp_shadow_vars: klp_shadow_free(obj=PTR9, id=0x1234, dtor=PTR17) test_klp_shadow_vars: klp_shadow_get(obj=PTR9, id=0x1234) = PTR0 test_klp_shadow_vars: got expected NULL result test_klp_shadow_vars: shadow_dtor(obj=PTR14, shadow_data=PTR13) test_klp_shadow_vars: klp_shadow_free(obj=PTR14, id=0x1234, dtor=PTR17) test_klp_shadow_vars: klp_shadow_get(obj=PTR14, id=0x1234) = PTR0 test_klp_shadow_vars: got expected NULL result test_klp_shadow_vars: klp_shadow_get(obj=PTR1, id=0x1235) = PTR6 test_klp_shadow_vars: got expected PTR6 -> PTR5 result test_klp_shadow_vars: klp_shadow_get(obj=PTR9, id=0x1235) = PTR11 test_klp_shadow_vars: got expected PTR11 -> PTR10 result test_klp_shadow_vars: klp_shadow_get(obj=PTR14, id=0x1235) = PTR16 test_klp_shadow_vars: got expected PTR16 -> PTR15 result test_klp_shadow_vars: klp_shadow_free_all(id=0x1235, dtor=PTR0) test_klp_shadow_vars: klp_shadow_get(obj=PTR1, id=0x1235) = PTR0 test_klp_shadow_vars: got expected NULL result test_klp_shadow_vars: klp_shadow_get(obj=PTR9, id=0x1235) = PTR0 test_klp_shadow_vars: got expected NULL result test_klp_shadow_vars: klp_shadow_get(obj=PTR14, id=0x1235) = PTR0 test_klp_shadow_vars: got expected NULL result % rmmod test_klp_shadow_vars livepatch: kernel.ftrace_enabled = 1 % modprobe test_klp_state livepatch: enabling patch 'test_klp_state' livepatch: 'test_klp_state': initializing patching transition test_klp_state: pre_patch_callback: vmlinux test_klp_state: allocate_loglevel_state: allocating space to store console_loglevel livepatch: 'test_klp_state': starting patching transition livepatch: 'test_klp_state': completing patching transition test_klp_state: post_patch_callback: vmlinux test_klp_state: fix_console_loglevel: fixing console_loglevel livepatch: 'test_klp_state': patching complete % echo 0 > /sys/kernel/livepatch/test_klp_state/enabled livepatch: 'test_klp_state': initializing unpatching transition test_klp_state: pre_unpatch_callback: vmlinux test_klp_state: restore_console_loglevel: restoring console_loglevel livepatch: 'test_klp_state': starting unpatching transition livepatch: 'test_klp_state': completing unpatching transition test_klp_state: post_unpatch_callback: vmlinux test_klp_state: free_loglevel_state: freeing space for the stored console_loglevel livepatch: 'test_klp_state': unpatching complete % rmmod test_klp_state % modprobe test_klp_state livepatch: enabling patch 'test_klp_state' livepatch: 'test_klp_state': initializing patching transition test_klp_state: pre_patch_callback: vmlinux test_klp_state: allocate_loglevel_state: allocating space to store console_loglevel livepatch: 'test_klp_state': starting patching transition livepatch: 'test_klp_state': completing patching transition test_klp_state: post_patch_callback: vmlinux test_klp_state: fix_console_loglevel: fixing console_loglevel livepatch: 'test_klp_state': patching complete % modprobe test_klp_state2 livepatch: enabling patch 'test_klp_state2' livepatch: 'test_klp_state2': initializing patching transition test_klp_state2: pre_patch_callback: vmlinux test_klp_state2: allocate_loglevel_state: space to store console_loglevel already allocated livepatch: 'test_klp_state2': starting patching transition livepatch: 'test_klp_state2': completing patching transition test_klp_state2: post_patch_callback: vmlinux test_klp_state2: fix_console_loglevel: taking over the console_loglevel change livepatch: 'test_klp_state2': patching complete % rmmod test_klp_state % echo 0 > /sys/kernel/livepatch/test_klp_state2/enabled livepatch: 'test_klp_state2': initializing unpatching transition test_klp_state2: pre_unpatch_callback: vmlinux test_klp_state2: restore_console_loglevel: restoring console_loglevel livepatch: 'test_klp_state2': starting unpatching transition livepatch: 'test_klp_state2': completing unpatching transition test_klp_state2: post_unpatch_callback: vmlinux test_klp_state2: free_loglevel_state: freeing space for the stored console_loglevel livepatch: 'test_klp_state2': unpatching complete % rmmod test_klp_state2 % modprobe test_klp_state2 livepatch: enabling patch 'test_klp_state2' livepatch: 'test_klp_state2': initializing patching transition test_klp_state2: pre_patch_callback: vmlinux test_klp_state2: allocate_loglevel_state: allocating space to store console_loglevel livepatch: 'test_klp_state2': starting patching transition livepatch: 'test_klp_state2': completing patching transition test_klp_state2: post_patch_callback: vmlinux test_klp_state2: fix_console_loglevel: fixing console_loglevel livepatch: 'test_klp_state2': patching complete % modprobe test_klp_state3 livepatch: enabling patch 'test_klp_state3' livepatch: 'test_klp_state3': initializing patching transition test_klp_state3: pre_patch_callback: vmlinux test_klp_state3: allocate_loglevel_state: space to store console_loglevel already allocated livepatch: 'test_klp_state3': starting patching transition livepatch: 'test_klp_state3': completing patching transition test_klp_state3: post_patch_callback: vmlinux test_klp_state3: fix_console_loglevel: taking over the console_loglevel change livepatch: 'test_klp_state3': patching complete % rmmod test_klp_state2 % modprobe test_klp_state2 livepatch: enabling patch 'test_klp_state2' livepatch: 'test_klp_state2': initializing patching transition test_klp_state2: pre_patch_callback: vmlinux test_klp_state2: allocate_loglevel_state: space to store console_loglevel already allocated livepatch: 'test_klp_state2': starting patching transition livepatch: 'test_klp_state2': completing patching transition test_klp_state2: post_patch_callback: vmlinux test_klp_state2: fix_console_loglevel: taking over the console_loglevel change livepatch: 'test_klp_state2': patching complete % echo 0 > /sys/kernel/livepatch/test_klp_state2/enabled livepatch: 'test_klp_state2': initializing unpatching transition test_klp_state2: pre_unpatch_callback: vmlinux test_klp_state2: restore_console_loglevel: restoring console_loglevel livepatch: 'test_klp_state2': starting unpatching transition livepatch: 'test_klp_state2': completing unpatching transition test_klp_state2: post_unpatch_callback: vmlinux test_klp_state2: free_loglevel_state: freeing space for the stored console_loglevel livepatch: 'test_klp_state2': unpatching complete % rmmod test_klp_state2 % rmmod test_klp_state3 % modprobe test_klp_state2 livepatch: enabling patch 'test_klp_state2' livepatch: 'test_klp_state2': initializing patching transition test_klp_state2: pre_patch_callback: vmlinux test_klp_state2: allocate_loglevel_state: allocating space to store console_loglevel livepatch: 'test_klp_state2': starting patching transition livepatch: 'test_klp_state2': completing patching transition test_klp_state2: post_patch_callback: vmlinux test_klp_state2: fix_console_loglevel: fixing console_loglevel livepatch: 'test_klp_state2': patching complete % modprobe test_klp_state livepatch: Livepatch patch (test_klp_state) is not compatible with the already installed livepatches. modprobe: ERROR: could not insert 'test_klp_state': Invalid argument % echo 0 > /sys/kernel/livepatch/test_klp_state2/enabled livepatch: 'test_klp_state2': initializing unpatching transition test_klp_state2: pre_unpatch_callback: vmlinux test_klp_state2: restore_console_loglevel: restoring console_loglevel livepatch: 'test_klp_state2': starting unpatching transition livepatch: 'test_klp_state2': completing unpatching transition test_klp_state2: post_unpatch_callback: vmlinux test_klp_state2: free_loglevel_state: freeing space for the stored console_loglevel livepatch: 'test_klp_state2': unpatching complete % rmmod test_klp_state2 livepatch: kernel.ftrace_enabled = 1 livepatch: kernel.ftrace_enabled = 0 % modprobe test_klp_livepatch livepatch: enabling patch 'test_klp_livepatch' livepatch: 'test_klp_livepatch': initializing patching transition livepatch: failed to register ftrace handler for function 'cmdline_proc_show' (-16) livepatch: failed to patch object 'vmlinux' livepatch: failed to enable patch 'test_klp_livepatch' livepatch: 'test_klp_livepatch': canceling patching transition, going to unpatch livepatch: 'test_klp_livepatch': completing unpatching transition livepatch: 'test_klp_livepatch': unpatching complete modprobe: ERROR: could not insert 'test_klp_livepatch': Device or resource busy livepatch: kernel.ftrace_enabled = 1 % modprobe test_klp_livepatch livepatch: enabling patch 'test_klp_livepatch' livepatch: 'test_klp_livepatch': initializing patching transition livepatch: 'test_klp_livepatch': starting patching transition livepatch: 'test_klp_livepatch': completing patching transition livepatch: 'test_klp_livepatch': patching complete livepatch: sysctl: setting key "kernel.ftrace_enabled": Device or resource busy % echo 0 > /sys/kernel/livepatch/test_klp_livepatch/enabled livepatch: 'test_klp_livepatch': initializing unpatching transition livepatch: 'test_klp_livepatch': starting unpatching transition livepatch: 'test_klp_livepatch': completing unpatching transition livepatch: 'test_klp_livepatch': unpatching complete % rmmod test_klp_livepatch livepatch: kernel.ftrace_enabled = 1 % modprobe test_klp_livepatch livepatch: enabling patch 'test_klp_livepatch' livepatch: 'test_klp_livepatch': initializing patching transition livepatch: 'test_klp_livepatch': starting patching transition livepatch: 'test_klp_livepatch': completing patching transition livepatch: 'test_klp_livepatch': patching complete % echo 0 > /sys/kernel/livepatch/test_klp_livepatch/enabled livepatch: 'test_klp_livepatch': initializing unpatching transition livepatch: 'test_klp_livepatch': starting unpatching transition livepatch: 'test_klp_livepatch': completing unpatching transition livepatch: 'test_klp_livepatch': unpatching complete % rmmod test_klp_livepatch % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': patching complete % modprobe test_klp_callbacks_mod livepatch: applying patch 'test_klp_callbacks_demo' to loading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_demo: post_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_mod: test_klp_callbacks_mod_init % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away livepatch: reverting patch 'test_klp_callbacks_demo' on unloading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo livepatch: kernel.ftrace_enabled = 1 % modprobe test_klp_livepatch livepatch: enabling patch 'test_klp_livepatch' livepatch: 'test_klp_livepatch': initializing patching transition livepatch: 'test_klp_livepatch': starting patching transition livepatch: 'test_klp_livepatch': completing patching transition livepatch: 'test_klp_livepatch': patching complete % echo 0 > /sys/kernel/livepatch/test_klp_livepatch/enabled livepatch: 'test_klp_livepatch': initializing unpatching transition livepatch: 'test_klp_livepatch': starting unpatching transition livepatch: 'test_klp_livepatch': completing unpatching transition livepatch: 'test_klp_livepatch': unpatching complete % rmmod test_klp_livepatch % modprobe test_klp_livepatch livepatch: enabling patch 'test_klp_livepatch' livepatch: 'test_klp_livepatch': initializing patching transition livepatch: 'test_klp_livepatch': starting patching transition livepatch: 'test_klp_livepatch': completing patching transition livepatch: 'test_klp_livepatch': patching complete test_klp_livepatch: this has been live patched % modprobe test_klp_atomic_replace replace=0 livepatch: enabling patch 'test_klp_atomic_replace' livepatch: 'test_klp_atomic_replace': initializing patching transition livepatch: 'test_klp_atomic_replace': starting patching transition livepatch: 'test_klp_atomic_replace': completing patching transition livepatch: 'test_klp_atomic_replace': patching complete test_klp_livepatch: this has been live patched test_klp_atomic_replace: this has been live patched % echo 0 > /sys/kernel/livepatch/test_klp_atomic_replace/enabled livepatch: 'test_klp_atomic_replace': initializing unpatching transition livepatch: 'test_klp_atomic_replace': starting unpatching transition livepatch: 'test_klp_atomic_replace': completing unpatching transition livepatch: 'test_klp_atomic_replace': unpatching complete % rmmod test_klp_atomic_replace test_klp_livepatch: this has been live patched % echo 0 > /sys/kernel/livepatch/test_klp_livepatch/enabled livepatch: 'test_klp_livepatch': initializing unpatching transition livepatch: 'test_klp_livepatch': starting unpatching transition livepatch: 'test_klp_livepatch': completing unpatching transition livepatch: 'test_klp_livepatch': unpatching complete % rmmod test_klp_livepatch % modprobe test_klp_livepatch livepatch: enabling patch 'test_klp_livepatch' livepatch: 'test_klp_livepatch': initializing patching transition livepatch: 'test_klp_livepatch': starting patching transition livepatch: 'test_klp_livepatch': completing patching transition livepatch: 'test_klp_livepatch': patching complete test_klp_livepatch: this has been live patched % modprobe test_klp_atomic_replace replace=1 livepatch: enabling patch 'test_klp_atomic_replace' livepatch: 'test_klp_atomic_replace': initializing patching transition livepatch: 'test_klp_atomic_replace': starting patching transition livepatch: 'test_klp_atomic_replace': completing patching transition livepatch: 'test_klp_atomic_replace': patching complete test_klp_atomic_replace: this has been live patched % rmmod test_klp_livepatch test_klp_atomic_replace: this has been live patched % echo 0 > /sys/kernel/livepatch/test_klp_atomic_replace/enabled livepatch: 'test_klp_atomic_replace': initializing unpatching transition livepatch: 'test_klp_atomic_replace': starting unpatching transition livepatch: 'test_klp_atomic_replace': completing unpatching transition livepatch: 'test_klp_atomic_replace': unpatching complete % rmmod test_klp_atomic_replace livepatch: kernel.ftrace_enabled = 1 % modprobe test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_init % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux test_klp_callbacks_demo: post_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': patching complete % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': patching complete % modprobe test_klp_callbacks_mod livepatch: applying patch 'test_klp_callbacks_demo' to loading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_demo: post_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_mod: test_klp_callbacks_mod_init % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit % modprobe test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_init % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux test_klp_callbacks_demo: post_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state livepatch: 'test_klp_callbacks_demo': patching complete % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away livepatch: reverting patch 'test_klp_callbacks_demo' on unloading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': patching complete % modprobe test_klp_callbacks_mod livepatch: applying patch 'test_klp_callbacks_demo' to loading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: pre_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_demo: post_patch_callback: test_klp_callbacks_mod -> [MODULE_STATE_COMING] Full formed, running module_init test_klp_callbacks_mod: test_klp_callbacks_mod_init % rmmod test_klp_callbacks_mod test_klp_callbacks_mod: test_klp_callbacks_mod_exit test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away livepatch: reverting patch 'test_klp_callbacks_demo' on unloading module 'test_klp_callbacks_mod' test_klp_callbacks_demo: post_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_GOING] Going away % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo % modprobe test_klp_callbacks_demo livepatch: enabling patch 'test_klp_callbacks_demo' livepatch: 'test_klp_callbacks_demo': initializing patching transition test_klp_callbacks_demo: pre_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting patching transition livepatch: 'test_klp_callbacks_demo': completing patching transition test_klp_callbacks_demo: post_patch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': patching complete % echo 0 > /sys/kernel/livepatch/test_klp_callbacks_demo/enabled livepatch: 'test_klp_callbacks_demo': initializing unpatching transition test_klp_callbacks_demo: pre_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': starting unpatching transition livepatch: 'test_klp_callbacks_demo': completing unpatching transition test_klp_callbacks_demo: post_unpatch_callback: vmlinux livepatch: 'test_klp_callbacks_demo': unpatching complete % rmmod test_klp_callbacks_demo