summaryrefslogtreecommitdiffstats
path: root/Documentation/livepatch
diff options
context:
space:
mode:
authorMiroslav Benes <mbenes@suse.cz>2017-11-22 05:29:21 -0500
committerJiri Kosina <jkosina@suse.cz>2017-12-07 07:21:35 -0500
commitc99a2be790b07752d8cc694434d3450afd4c5a00 (patch)
tree086f38cd5bae5145e4677c552a8776990f12c2fb /Documentation/livepatch
parent43347d56c8d9dd732cee2f8efd384ad21dd1f6c4 (diff)
livepatch: force transition to finish
If a task sleeps in a set of patched functions uninterruptedly, it could block the whole transition indefinitely. Thus it may be useful to clear its TIF_PATCH_PENDING to allow the process to finish. Admin can do that now by writing to force sysfs attribute in livepatch sysfs directory. TIF_PATCH_PENDING is then cleared for all tasks and the transition can finish successfully. Important note! Administrator should not use this feature without a clearance from a patch distributor. It must be checked that by doing so the consistency model guarantees are not violated. Removal (rmmod) of patch modules is permanently disabled when the feature is used. It cannot be guaranteed there is no task sleeping in such module. Signed-off-by: Miroslav Benes <mbenes@suse.cz> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Reviewed-by: Petr Mladek <pmladek@suse.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'Documentation/livepatch')
-rw-r--r--Documentation/livepatch/livepatch.txt18
1 files changed, 16 insertions, 2 deletions
diff --git a/Documentation/livepatch/livepatch.txt b/Documentation/livepatch/livepatch.txt
index 9bcdef277a36..896ba8941702 100644
--- a/Documentation/livepatch/livepatch.txt
+++ b/Documentation/livepatch/livepatch.txt
@@ -183,6 +183,20 @@ tasks. No proper signal is actually delivered (there is no data in signal
183pending structures). Tasks are interrupted or woken up, and forced to change 183pending structures). Tasks are interrupted or woken up, and forced to change
184their patched state. 184their patched state.
185 185
186Administrator can also affect a transition through
187/sys/kernel/livepatch/<patch>/force attribute. Writing 1 there clears
188TIF_PATCH_PENDING flag of all tasks and thus forces the tasks to the patched
189state. Important note! The force attribute is intended for cases when the
190transition gets stuck for a long time because of a blocking task. Administrator
191is expected to collect all necessary data (namely stack traces of such blocking
192tasks) and request a clearance from a patch distributor to force the transition.
193Unauthorized usage may cause harm to the system. It depends on the nature of the
194patch, which functions are (un)patched, and which functions the blocking tasks
195are sleeping in (/proc/<pid>/stack may help here). Removal (rmmod) of patch
196modules is permanently disabled when the force feature is used. It cannot be
197guaranteed there is no task sleeping in such module. It implies unbounded
198reference count if a patch module is disabled and enabled in a loop.
199
1863.1 Adding consistency model support to new architectures 2003.1 Adding consistency model support to new architectures
187--------------------------------------------------------- 201---------------------------------------------------------
188 202
@@ -439,8 +453,8 @@ Information about the registered patches can be found under
439/sys/kernel/livepatch. The patches could be enabled and disabled 453/sys/kernel/livepatch. The patches could be enabled and disabled
440by writing there. 454by writing there.
441 455
442/sys/kernel/livepatch/<patch>/signal attribute allows administrator to affect a 456/sys/kernel/livepatch/<patch>/signal and /sys/kernel/livepatch/<patch>/force
443patching operation. 457attributes allow administrator to affect a patching operation.
444 458
445See Documentation/ABI/testing/sysfs-kernel-livepatch for more details. 459See Documentation/ABI/testing/sysfs-kernel-livepatch for more details.
446 460