[ 313.352405] livepatch: kernel.ftrace_enabled = 1 [ 313.393672] ===== TEST: system state modification ===== [ 313.460929] % modprobe test_klp_state [ 313.494085] livepatch: enabling patch 'test_klp_state' [ 313.497714] livepatch: 'test_klp_state': initializing patching transition [ 313.497934] test_klp_state: pre_patch_callback: vmlinux [ 313.502017] test_klp_state: allocate_loglevel_state: allocating space to store console_loglevel [ 313.506549] livepatch: 'test_klp_state': starting patching transition [ 313.512786] livepatch: 'test_klp_state': completing patching transition [ 313.512948] test_klp_state: post_patch_callback: vmlinux [ 313.516625] test_klp_state: fix_console_loglevel: fixing console_loglevel [ 313.520626] livepatch: 'test_klp_state': patching complete [ 313.553480] % echo 0 > /sys/kernel/livepatch/test_klp_state/enabled [ 313.558218] livepatch: 'test_klp_state': initializing unpatching transition [ 313.562669] test_klp_state: pre_unpatch_callback: vmlinux [ 313.566349] test_klp_state: restore_console_loglevel: restoring console_loglevel [ 313.570503] livepatch: 'test_klp_state': starting unpatching transition [ 313.576536] livepatch: 'test_klp_state': completing unpatching transition [ 313.576898] test_klp_state: post_unpatch_callback: vmlinux [ 313.580913] test_klp_state: free_loglevel_state: freeing space for the stored console_loglevel [ 313.585822] livepatch: 'test_klp_state': unpatching complete [ 313.608955] % rmmod test_klp_state [ 313.769819] ===== TEST: taking over system state modification ===== [ 313.836896] % modprobe test_klp_state [ 313.868324] livepatch: enabling patch 'test_klp_state' [ 313.871987] livepatch: 'test_klp_state': initializing patching transition [ 313.872195] test_klp_state: pre_patch_callback: vmlinux [ 313.876354] test_klp_state: allocate_loglevel_state: allocating space to store console_loglevel [ 313.880755] livepatch: 'test_klp_state': starting patching transition [ 313.887122] livepatch: 'test_klp_state': completing patching transition [ 313.887307] test_klp_state: post_patch_callback: vmlinux [ 313.890866] test_klp_state: fix_console_loglevel: fixing console_loglevel [ 313.894767] livepatch: 'test_klp_state': patching complete [ 314.000174] % modprobe test_klp_state2 [ 314.033738] livepatch: enabling patch 'test_klp_state2' [ 314.037485] livepatch: 'test_klp_state2': initializing patching transition [ 314.041677] test_klp_state2: pre_patch_callback: vmlinux [ 314.045248] test_klp_state2: allocate_loglevel_state: space to store console_loglevel already allocated [ 314.049908] livepatch: 'test_klp_state2': starting patching transition [ 314.056740] livepatch: 'test_klp_state2': completing patching transition [ 314.061424] test_klp_state2: post_patch_callback: vmlinux [ 314.065149] test_klp_state2: fix_console_loglevel: taking over the console_loglevel change [ 314.069561] livepatch: 'test_klp_state2': patching complete [ 314.119590] % rmmod test_klp_state [ 314.169031] % echo 0 > /sys/kernel/livepatch/test_klp_state2/enabled [ 314.174721] livepatch: 'test_klp_state2': initializing unpatching transition [ 314.179323] test_klp_state2: pre_unpatch_callback: vmlinux [ 314.183124] test_klp_state2: restore_console_loglevel: restoring console_loglevel [ 314.187436] livepatch: 'test_klp_state2': starting unpatching transition [ 314.194445] livepatch: 'test_klp_state2': completing unpatching transition [ 314.194684] test_klp_state2: post_unpatch_callback: vmlinux [ 314.198757] test_klp_state2: free_loglevel_state: freeing space for the stored console_loglevel [ 314.203485] livepatch: 'test_klp_state2': unpatching complete [ 314.225400] % rmmod test_klp_state2 [ 314.392727] ===== TEST: compatible cumulative livepatches ===== [ 314.462238] % modprobe test_klp_state2 [ 314.499326] livepatch: enabling patch 'test_klp_state2' [ 314.503406] livepatch: 'test_klp_state2': initializing patching transition [ 314.503695] test_klp_state2: pre_patch_callback: vmlinux [ 314.508298] test_klp_state2: allocate_loglevel_state: allocating space to store console_loglevel [ 314.513551] livepatch: 'test_klp_state2': starting patching transition [ 314.520531] livepatch: 'test_klp_state2': completing patching transition [ 314.520731] test_klp_state2: post_patch_callback: vmlinux [ 314.524628] test_klp_state2: fix_console_loglevel: fixing console_loglevel [ 314.528821] livepatch: 'test_klp_state2': patching complete [ 314.628359] % modprobe test_klp_state3 [ 314.661967] livepatch: enabling patch 'test_klp_state3' [ 314.665946] livepatch: 'test_klp_state3': initializing patching transition [ 314.670490] test_klp_state3: pre_patch_callback: vmlinux [ 314.674316] test_klp_state3: allocate_loglevel_state: space to store console_loglevel already allocated [ 314.679226] livepatch: 'test_klp_state3': starting patching transition [ 314.686189] livepatch: 'test_klp_state3': completing patching transition [ 314.691016] test_klp_state3: post_patch_callback: vmlinux [ 314.694863] test_klp_state3: fix_console_loglevel: taking over the console_loglevel change [ 314.699444] livepatch: 'test_klp_state3': patching complete [ 314.751092] % rmmod test_klp_state2 [ 314.867871] % modprobe test_klp_state2 [ 314.899940] livepatch: enabling patch 'test_klp_state2' [ 314.903812] livepatch: 'test_klp_state2': initializing patching transition [ 314.908216] test_klp_state2: pre_patch_callback: vmlinux [ 314.911963] test_klp_state2: allocate_loglevel_state: space to store console_loglevel already allocated [ 314.916789] livepatch: 'test_klp_state2': starting patching transition [ 314.923572] livepatch: 'test_klp_state2': completing patching transition [ 314.928240] test_klp_state2: post_patch_callback: vmlinux [ 314.932067] test_klp_state2: fix_console_loglevel: taking over the console_loglevel change [ 314.936628] livepatch: 'test_klp_state2': patching complete [ 314.970888] % echo 0 > /sys/kernel/livepatch/test_klp_state2/enabled [ 314.976323] livepatch: 'test_klp_state2': initializing unpatching transition [ 314.981549] test_klp_state2: pre_unpatch_callback: vmlinux [ 314.985622] test_klp_state2: restore_console_loglevel: restoring console_loglevel [ 314.990314] livepatch: 'test_klp_state2': starting unpatching transition [ 314.997125] livepatch: 'test_klp_state2': completing unpatching transition [ 314.998388] test_klp_state2: post_unpatch_callback: vmlinux [ 315.002591] test_klp_state2: free_loglevel_state: freeing space for the stored console_loglevel [ 315.007764] livepatch: 'test_klp_state2': unpatching complete [ 315.032853] % rmmod test_klp_state2 [ 315.101963] % rmmod test_klp_state3 [ 315.270837] ===== TEST: incompatible cumulative livepatches ===== [ 315.341593] % modprobe test_klp_state2 [ 315.374728] livepatch: enabling patch 'test_klp_state2' [ 315.378810] livepatch: 'test_klp_state2': initializing patching transition [ 315.379021] test_klp_state2: pre_patch_callback: vmlinux [ 315.383588] test_klp_state2: allocate_loglevel_state: allocating space to store console_loglevel [ 315.388346] livepatch: 'test_klp_state2': starting patching transition [ 315.395103] livepatch: 'test_klp_state2': completing patching transition [ 315.395288] test_klp_state2: post_patch_callback: vmlinux [ 315.399130] test_klp_state2: fix_console_loglevel: fixing console_loglevel [ 315.403278] livepatch: 'test_klp_state2': patching complete [ 315.435415] % modprobe test_klp_state [ 315.467276] livepatch: Livepatch patch (test_klp_state) is not compatible with the already installed livepatches. [ 315.501394] modprobe: ERROR: could not insert 'test_klp_state': Invalid argument [ 315.507508] % echo 0 > /sys/kernel/livepatch/test_klp_state2/enabled [ 315.512691] livepatch: 'test_klp_state2': initializing unpatching transition [ 315.517845] test_klp_state2: pre_unpatch_callback: vmlinux [ 315.521991] test_klp_state2: restore_console_loglevel: restoring console_loglevel [ 315.526709] livepatch: 'test_klp_state2': starting unpatching transition [ 315.533966] livepatch: 'test_klp_state2': completing unpatching transition [ 315.534187] test_klp_state2: post_unpatch_callback: vmlinux [ 315.538221] test_klp_state2: free_loglevel_state: freeing space for the stored console_loglevel [ 315.543045] livepatch: 'test_klp_state2': unpatching complete [ 315.567469] % rmmod test_klp_state2