[ 128.533414] livepatch: kernel.ftrace_enabled = 1 [ 128.551073] ===== TEST: system state modification ===== [ 128.560773] % modprobe test_klp_state [ 128.565639] livepatch: enabling patch 'test_klp_state' [ 128.566405] livepatch: 'test_klp_state': initializing patching transition [ 128.566625] test_klp_state: pre_patch_callback: vmlinux [ 128.567386] test_klp_state: allocate_loglevel_state: allocating space to store console_loglevel [ 128.568662] livepatch: 'test_klp_state': starting patching transition [ 128.570622] livepatch: 'test_klp_state': completing patching transition [ 128.570712] test_klp_state: post_patch_callback: vmlinux [ 128.571430] test_klp_state: fix_console_loglevel: fixing console_loglevel [ 128.572338] livepatch: 'test_klp_state': patching complete [ 128.577042] % echo 0 > /sys/kernel/livepatch/test_klp_state/enabled [ 128.578014] livepatch: 'test_klp_state': initializing unpatching transition [ 128.579008] test_klp_state: pre_unpatch_callback: vmlinux [ 128.579744] test_klp_state: restore_console_loglevel: restoring console_loglevel [ 128.580725] livepatch: 'test_klp_state': starting unpatching transition [ 128.582125] livepatch: 'test_klp_state': completing unpatching transition [ 128.582187] test_klp_state: post_unpatch_callback: vmlinux [ 128.582939] test_klp_state: free_loglevel_state: freeing space for the stored console_loglevel [ 128.584081] livepatch: 'test_klp_state': unpatching complete [ 128.586571] % rmmod test_klp_state [ 128.607347] ===== TEST: taking over system state modification ===== [ 128.616747] % modprobe test_klp_state [ 128.622214] livepatch: enabling patch 'test_klp_state' [ 128.623023] livepatch: 'test_klp_state': initializing patching transition [ 128.623188] test_klp_state: pre_patch_callback: vmlinux [ 128.624074] test_klp_state: allocate_loglevel_state: allocating space to store console_loglevel [ 128.625300] livepatch: 'test_klp_state': starting patching transition [ 128.627056] livepatch: 'test_klp_state': completing patching transition [ 128.627140] test_klp_state: post_patch_callback: vmlinux [ 128.627869] test_klp_state: fix_console_loglevel: fixing console_loglevel [ 128.628783] livepatch: 'test_klp_state': patching complete [ 128.641359] % modprobe test_klp_state2 [ 128.646359] livepatch: enabling patch 'test_klp_state2' [ 128.647097] livepatch: 'test_klp_state2': initializing patching transition [ 128.648137] test_klp_state2: pre_patch_callback: vmlinux [ 128.648860] test_klp_state2: allocate_loglevel_state: space to store console_loglevel already allocated [ 128.650101] livepatch: 'test_klp_state2': starting patching transition [ 128.651713] livepatch: 'test_klp_state2': completing patching transition [ 128.652674] test_klp_state2: post_patch_callback: vmlinux [ 128.653391] test_klp_state2: fix_console_loglevel: taking over the console_loglevel change [ 128.654494] livepatch: 'test_klp_state2': patching complete [ 128.659745] % rmmod test_klp_state [ 128.673311] % echo 0 > /sys/kernel/livepatch/test_klp_state2/enabled [ 128.674239] livepatch: 'test_klp_state2': initializing unpatching transition [ 128.675338] test_klp_state2: pre_unpatch_callback: vmlinux [ 128.676167] test_klp_state2: restore_console_loglevel: restoring console_loglevel [ 128.677290] livepatch: 'test_klp_state2': starting unpatching transition [ 128.678942] livepatch: 'test_klp_state2': completing unpatching transition [ 128.679035] test_klp_state2: post_unpatch_callback: vmlinux [ 128.679863] test_klp_state2: free_loglevel_state: freeing space for the stored console_loglevel [ 128.681056] livepatch: 'test_klp_state2': unpatching complete [ 128.683725] % rmmod test_klp_state2 [ 128.706987] ===== TEST: compatible cumulative livepatches ===== [ 128.716597] % modprobe test_klp_state2 [ 128.721820] livepatch: enabling patch 'test_klp_state2' [ 128.722562] livepatch: 'test_klp_state2': initializing patching transition [ 128.722717] test_klp_state2: pre_patch_callback: vmlinux [ 128.723424] test_klp_state2: allocate_loglevel_state: allocating space to store console_loglevel [ 128.724587] livepatch: 'test_klp_state2': starting patching transition [ 128.726193] livepatch: 'test_klp_state2': completing patching transition [ 128.726272] test_klp_state2: post_patch_callback: vmlinux [ 128.727012] test_klp_state2: fix_console_loglevel: fixing console_loglevel [ 128.727935] livepatch: 'test_klp_state2': patching complete [ 128.740486] % modprobe test_klp_state3 [ 128.745818] livepatch: enabling patch 'test_klp_state3' [ 128.746572] livepatch: 'test_klp_state3': initializing patching transition [ 128.747634] test_klp_state3: pre_patch_callback: vmlinux [ 128.748342] test_klp_state3: allocate_loglevel_state: space to store console_loglevel already allocated [ 128.749584] livepatch: 'test_klp_state3': starting patching transition [ 130.162702] livepatch: 'test_klp_state3': completing patching transition [ 130.163814] test_klp_state3: post_patch_callback: vmlinux [ 130.164550] test_klp_state3: fix_console_loglevel: taking over the console_loglevel change [ 130.165673] livepatch: 'test_klp_state3': patching complete [ 130.201755] % rmmod test_klp_state2 [ 130.224547] % modprobe test_klp_state2 [ 130.229484] livepatch: enabling patch 'test_klp_state2' [ 130.230174] livepatch: 'test_klp_state2': initializing patching transition [ 130.231188] test_klp_state2: pre_patch_callback: vmlinux [ 130.231888] test_klp_state2: allocate_loglevel_state: space to store console_loglevel already allocated [ 130.233103] livepatch: 'test_klp_state2': starting patching transition [ 130.234868] livepatch: 'test_klp_state2': completing patching transition [ 130.235923] test_klp_state2: post_patch_callback: vmlinux [ 130.236736] test_klp_state2: fix_console_loglevel: taking over the console_loglevel change [ 130.237814] livepatch: 'test_klp_state2': patching complete [ 130.241786] % echo 0 > /sys/kernel/livepatch/test_klp_state2/enabled [ 130.242688] livepatch: 'test_klp_state2': initializing unpatching transition [ 130.243664] test_klp_state2: pre_unpatch_callback: vmlinux [ 130.244365] test_klp_state2: restore_console_loglevel: restoring console_loglevel [ 130.245331] livepatch: 'test_klp_state2': starting unpatching transition [ 130.246950] livepatch: 'test_klp_state2': completing unpatching transition [ 130.247025] test_klp_state2: post_unpatch_callback: vmlinux [ 130.247856] test_klp_state2: free_loglevel_state: freeing space for the stored console_loglevel [ 130.249025] livepatch: 'test_klp_state2': unpatching complete [ 130.251911] % rmmod test_klp_state2 [ 130.262922] % rmmod test_klp_state3 [ 130.284794] ===== TEST: incompatible cumulative livepatches ===== [ 130.294675] % modprobe test_klp_state2 [ 130.299593] livepatch: enabling patch 'test_klp_state2' [ 130.300385] livepatch: 'test_klp_state2': initializing patching transition [ 130.300540] test_klp_state2: pre_patch_callback: vmlinux [ 130.301259] test_klp_state2: allocate_loglevel_state: allocating space to store console_loglevel [ 130.302446] livepatch: 'test_klp_state2': starting patching transition [ 131.122718] livepatch: 'test_klp_state2': completing patching transition [ 131.122946] test_klp_state2: post_patch_callback: vmlinux [ 131.123724] test_klp_state2: fix_console_loglevel: fixing console_loglevel [ 131.124644] livepatch: 'test_klp_state2': patching complete [ 131.134431] % modprobe test_klp_state [ 131.141072] livepatch: Livepatch patch (test_klp_state) is not compatible with the already installed livepatches. [ 131.157254] modprobe: ERROR: could not insert 'test_klp_state': Invalid argument [ 131.158384] % echo 0 > /sys/kernel/livepatch/test_klp_state2/enabled [ 131.159259] livepatch: 'test_klp_state2': initializing unpatching transition [ 131.160315] test_klp_state2: pre_unpatch_callback: vmlinux [ 131.161035] test_klp_state2: restore_console_loglevel: restoring console_loglevel [ 131.162007] livepatch: 'test_klp_state2': starting unpatching transition [ 131.163807] livepatch: 'test_klp_state2': completing unpatching transition [ 131.163892] test_klp_state2: post_unpatch_callback: vmlinux [ 131.164632] test_klp_state2: free_loglevel_state: freeing space for the stored console_loglevel [ 131.165749] livepatch: 'test_klp_state2': unpatching complete [ 131.168350] % rmmod test_klp_state2