€• Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ'/translations/zh_CN/livepatch/livepatch”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/zh_TW/livepatch/livepatch”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/it_IT/livepatch/livepatch”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/ja_JP/livepatch/livepatch”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/ko_KR/livepatch/livepatch”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/pt_BR/livepatch/livepatch”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/sp_SP/livepatch/livepatch”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ Livepatch”h]”hŒ Livepatch”…””}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³ŒA/var/lib/git/docbuild/linux/Documentation/livepatch/livepatch.rst”h´KubhŒ paragraph”“”)”}”(hŒCThis document outlines basic information about kernel livepatching.”h]”hŒCThis document outlines basic information about kernel livepatching.”…””}”(hhÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhŒcomment”“”)”}”(hŒTable of Contents:”h]”hŒTable of Contents:”…””}”hhÝsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hÛhh·h²hh³hÊh´KubhŒtopic”“”)”}”(hhh]”hŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hhh]”hÌ)”}”(hhh]”hŒ reference”“”)”}”(hhh]”hŒ 1. Motivation”…””}”(hjh²hh³Nh´Nubah}”(h]”Œid3”ah ]”h"]”h$]”h&]”Œrefid”Œ motivation”uh1hÿhhüubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhhùubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hhôubhø)”}”(hhh]”hÌ)”}”(hhh]”j)”}”(hhh]”hŒ 2. Kprobes, Ftrace, Livepatching”…””}”(hj#h²hh³Nh´Nubah}”(h]”Œid4”ah ]”h"]”h$]”h&]”Œrefid”Œkprobes-ftrace-livepatching”uh1hÿhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhjubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hhôubhø)”}”(hhh]”(hÌ)”}”(hhh]”j)”}”(hhh]”hŒ3. Consistency model”…””}”(hjEh²hh³Nh´Nubah}”(h]”Œid5”ah ]”h"]”h$]”h&]”Œrefid”Œconsistency-model”uh1hÿhjBubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhj?ubhó)”}”(hhh]”hø)”}”(hhh]”hÌ)”}”(hhh]”j)”}”(hhh]”hŒ93.1 Adding consistency model support to new architectures”…””}”(hjdh²hh³Nh´Nubah}”(h]”Œid6”ah ]”h"]”h$]”h&]”Œrefid”Œ5adding-consistency-model-support-to-new-architectures”uh1hÿhjaubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhj^ubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hj[ubah}”(h]”h ]”h"]”h$]”h&]”uh1hòhj?ubeh}”(h]”h ]”h"]”h$]”h&]”uh1h÷hhôubhø)”}”(hhh]”(hÌ)”}”(hhh]”j)”}”(hhh]”hŒ4. Livepatch module”…””}”(hj’h²hh³Nh´Nubah}”(h]”Œid7”ah ]”h"]”h$]”h&]”Œrefid”Œlivepatch-module”uh1hÿhjubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhjŒubhó)”}”(hhh]”(hø)”}”(hhh]”hÌ)”}”(hhh]”j)”}”(hhh]”hŒ4.1. New functions”…””}”(hj±h²hh³Nh´Nubah}”(h]”Œid8”ah ]”h"]”h$]”h&]”Œrefid”Œ new-functions”uh1hÿhj®ubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhj«ubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hj¨ubhø)”}”(hhh]”hÌ)”}”(hhh]”j)”}”(hhh]”hŒ 4.2. Metadata”…””}”(hjÓh²hh³Nh´Nubah}”(h]”Œid9”ah ]”h"]”h$]”h&]”Œrefid”Œmetadata”uh1hÿhjÐubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhjÍubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hj¨ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hòhjŒubeh}”(h]”h ]”h"]”h$]”h&]”uh1h÷hhôubhø)”}”(hhh]”(hÌ)”}”(hhh]”j)”}”(hhh]”hŒ5. Livepatch life-cycle”…””}”(hjh²hh³Nh´Nubah}”(h]”Œid10”ah ]”h"]”h$]”h&]”Œrefid”Œlivepatch-life-cycle”uh1hÿhjþubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhjûubhó)”}”(hhh]”(hø)”}”(hhh]”hÌ)”}”(hhh]”j)”}”(hhh]”hŒ 5.1. Loading”…””}”(hj h²hh³Nh´Nubah}”(h]”Œid11”ah ]”h"]”h$]”h&]”Œrefid”Œloading”uh1hÿhjubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhjubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjubhø)”}”(hhh]”hÌ)”}”(hhh]”j)”}”(hhh]”hŒ 5.2. Enabling”…””}”(hjBh²hh³Nh´Nubah}”(h]”Œid12”ah ]”h"]”h$]”h&]”Œrefid”Œenabling”uh1hÿhj?ubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhj<ubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjubhø)”}”(hhh]”hÌ)”}”(hhh]”j)”}”(hhh]”hŒ5.3. Replacing”…””}”(hjdh²hh³Nh´Nubah}”(h]”Œid13”ah ]”h"]”h$]”h&]”Œrefid”Œ replacing”uh1hÿhjaubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhj^ubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjubhø)”}”(hhh]”hÌ)”}”(hhh]”j)”}”(hhh]”hŒ5.4. Disabling”…””}”(hj†h²hh³Nh´Nubah}”(h]”Œid14”ah ]”h"]”h$]”h&]”Œrefid”Œ disabling”uh1hÿhjƒubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhj€ubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjubhø)”}”(hhh]”hÌ)”}”(hhh]”j)”}”(hhh]”hŒ 5.5. Removing”…””}”(hj¨h²hh³Nh´Nubah}”(h]”Œid15”ah ]”h"]”h$]”h&]”Œrefid”Œremoving”uh1hÿhj¥ubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhj¢ubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1hòhjûubeh}”(h]”h ]”h"]”h$]”h&]”uh1h÷hhôubhø)”}”(hhh]”hÌ)”}”(hhh]”j)”}”(hhh]”hŒ6. Sysfs”…””}”(hjÖh²hh³Nh´Nubah}”(h]”Œid16”ah ]”h"]”h$]”h&]”Œrefid”Œsysfs”uh1hÿhjÓubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhjÐubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hhôubhø)”}”(hhh]”hÌ)”}”(hhh]”j)”}”(hhh]”hŒ7. Limitations”…””}”(hjøh²hh³Nh´Nubah}”(h]”Œid17”ah ]”h"]”h$]”h&]”Œrefid”Œ limitations”uh1hÿhjõubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhjòubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hhôubeh}”(h]”h ]”h"]”h$]”h&]”uh1hòhhïh²hh³Nh´Nubah}”(h]”Œcontents”ah ]”(Œcontents”Œlocal”eh"]”Œcontents”ah$]”h&]”uh1híh³hÊh´K hh·h²hubh¶)”}”(hhh]”(h»)”}”(hŒ 1. Motivation”h]”hŒ 1. Motivation”…””}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefid”j uh1hºhj$h²hh³hÊh´K ubhÌ)”}”(hX¦There are many situations where users are reluctant to reboot a system. It may be because their system is performing complex scientific computations or under heavy load during peak usage. In addition to keeping systems up and running, users want to also have a stable and secure system. Livepatching gives users both by allowing for function calls to be redirected; thus, fixing critical functions without a system reboot.”h]”hX¦There are many situations where users are reluctant to reboot a system. It may be because their system is performing complex scientific computations or under heavy load during peak usage. In addition to keeping systems up and running, users want to also have a stable and secure system. Livepatching gives users both by allowing for function calls to be redirected; thus, fixing critical functions without a system reboot.”…””}”(hj6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khj$h²hubeh}”(h]”jah ]”h"]”Œ 1. motivation”ah$]”h&]”uh1hµhh·h²hh³hÊh´K ubh¶)”}”(hhh]”(h»)”}”(hŒ 2. Kprobes, Ftrace, Livepatching”h]”hŒ 2. Kprobes, Ftrace, Livepatching”…””}”(hjNh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j5j,uh1hºhjKh²hh³hÊh´KubhÌ)”}”(hŒ¨There are multiple mechanisms in the Linux kernel that are directly related to redirection of code execution; namely: kernel probes, function tracing, and livepatching:”h]”hŒ¨There are multiple mechanisms in the Linux kernel that are directly related to redirection of code execution; namely: kernel probes, function tracing, and livepatching:”…””}”(hj\h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KhjKh²hubhŒ block_quote”“”)”}”(hXè- The kernel probes are the most generic. The code can be redirected by putting a breakpoint instruction instead of any instruction. - The function tracer calls the code from a predefined location that is close to the function entry point. This location is generated by the compiler using the '-pg' gcc option. - Livepatching typically needs to redirect the code at the very beginning of the function entry before the function parameters or the stack are in any way modified. ”h]”hó)”}”(hhh]”(hø)”}”(hŒƒThe kernel probes are the most generic. The code can be redirected by putting a breakpoint instruction instead of any instruction. ”h]”hÌ)”}”(hŒ‚The kernel probes are the most generic. The code can be redirected by putting a breakpoint instruction instead of any instruction.”h]”hŒ‚The kernel probes are the most generic. The code can be redirected by putting a breakpoint instruction instead of any instruction.”…””}”(hjwh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khjsubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjpubhø)”}”(hŒ°The function tracer calls the code from a predefined location that is close to the function entry point. This location is generated by the compiler using the '-pg' gcc option. ”h]”hÌ)”}”(hŒ¯The function tracer calls the code from a predefined location that is close to the function entry point. This location is generated by the compiler using the '-pg' gcc option.”h]”hŒ³The function tracer calls the code from a predefined location that is close to the function entry point. This location is generated by the compiler using the ‘-pg’ gcc option.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K!hj‹ubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjpubhø)”}”(hŒ£Livepatching typically needs to redirect the code at the very beginning of the function entry before the function parameters or the stack are in any way modified. ”h]”hÌ)”}”(hŒ¢Livepatching typically needs to redirect the code at the very beginning of the function entry before the function parameters or the stack are in any way modified.”h]”hŒ¢Livepatching typically needs to redirect the code at the very beginning of the function entry before the function parameters or the stack are in any way modified.”…””}”(hj§h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K%hj£ubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjpubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1hòh³hÊh´Khjlubah}”(h]”h ]”h"]”h$]”h&]”uh1jjh³hÊh´KhjKh²hubhÌ)”}”(hXáAll three approaches need to modify the existing code at runtime. Therefore they need to be aware of each other and not step over each other's toes. Most of these problems are solved by using the dynamic ftrace framework as a base. A Kprobe is registered as a ftrace handler when the function entry is probed, see CONFIG_KPROBES_ON_FTRACE. Also an alternative function from a live patch is called with the help of a custom ftrace handler. But there are some limitations, see below.”h]”hXãAll three approaches need to modify the existing code at runtime. Therefore they need to be aware of each other and not step over each other’s toes. Most of these problems are solved by using the dynamic ftrace framework as a base. A Kprobe is registered as a ftrace handler when the function entry is probed, see CONFIG_KPROBES_ON_FTRACE. Also an alternative function from a live patch is called with the help of a custom ftrace handler. But there are some limitations, see below.”…””}”(hjÉh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K)hjKh²hubeh}”(h]”j2ah ]”h"]”Œ 2. kprobes, ftrace, livepatching”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)”}”(hhh]”(h»)”}”(hŒ3. Consistency model”h]”hŒ3. Consistency model”…””}”(hjáh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j5jNuh1hºhjÞh²hh³hÊh´K3ubhÌ)”}”(hŒàFunctions are there for a reason. They take some input parameters, acquire or release locks, read, process, and even write some data in a defined way, have return values. In other words, each function has a defined semantic.”h]”hŒàFunctions are there for a reason. They take some input parameters, acquire or release locks, read, process, and even write some data in a defined way, have return values. In other words, each function has a defined semantic.”…””}”(hjïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K5hjÞh²hubhÌ)”}”(hX‘Many fixes do not change the semantic of the modified functions. For example, they add a NULL pointer or a boundary check, fix a race by adding a missing memory barrier, or add some locking around a critical section. Most of these changes are self contained and the function presents itself the same way to the rest of the system. In this case, the functions might be updated independently one by one.”h]”hX‘Many fixes do not change the semantic of the modified functions. For example, they add a NULL pointer or a boundary check, fix a race by adding a missing memory barrier, or add some locking around a critical section. Most of these changes are self contained and the function presents itself the same way to the rest of the system. In this case, the functions might be updated independently one by one.”…””}”(hjýh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K9hjÞh²hubhÌ)”}”(hX But there are more complex fixes. For example, a patch might change ordering of locking in multiple functions at the same time. Or a patch might exchange meaning of some temporary structures and update all the relevant functions. In this case, the affected unit (thread, whole kernel) need to start using all new versions of the functions at the same time. Also the switch must happen only when it is safe to do so, e.g. when the affected locks are released or no data are stored in the modified structures at the moment.”h]”hX But there are more complex fixes. For example, a patch might change ordering of locking in multiple functions at the same time. Or a patch might exchange meaning of some temporary structures and update all the relevant functions. In this case, the affected unit (thread, whole kernel) need to start using all new versions of the functions at the same time. Also the switch must happen only when it is safe to do so, e.g. when the affected locks are released or no data are stored in the modified structures at the moment.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K@hjÞh²hubhÌ)”}”(hŒéThe theory about how to apply functions a safe way is rather complex. The aim is to define a so-called consistency model. It attempts to define conditions when the new implementation could be used so that the system stays consistent.”h]”hŒéThe theory about how to apply functions a safe way is rather complex. The aim is to define a so-called consistency model. It attempts to define conditions when the new implementation could be used so that the system stays consistent.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KIhjÞh²hubhÌ)”}”(hXLivepatch has a consistency model which is a hybrid of kGraft and kpatch: it uses kGraft's per-task consistency and syscall barrier switching combined with kpatch's stack trace switching. There are also a number of fallback options which make it quite flexible.”h]”hX Livepatch has a consistency model which is a hybrid of kGraft and kpatch: it uses kGraft’s per-task consistency and syscall barrier switching combined with kpatch’s stack trace switching. There are also a number of fallback options which make it quite flexible.”…””}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KNhjÞh²hubhÌ)”}”(hXƒPatches are applied on a per-task basis, when the task is deemed safe to switch over. When a patch is enabled, livepatch enters into a transition state where tasks are converging to the patched state. Usually this transition state can complete in a few seconds. The same sequence occurs when a patch is disabled, except the tasks converge from the patched state to the unpatched state.”h]”hXƒPatches are applied on a per-task basis, when the task is deemed safe to switch over. When a patch is enabled, livepatch enters into a transition state where tasks are converging to the patched state. Usually this transition state can complete in a few seconds. The same sequence occurs when a patch is disabled, except the tasks converge from the patched state to the unpatched state.”…””}”(hj5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KShjÞh²hubhÌ)”}”(hŒ¢An interrupt handler inherits the patched state of the task it interrupts. The same is true for forked tasks: the child inherits the patched state of the parent.”h]”hŒ¢An interrupt handler inherits the patched state of the task it interrupts. The same is true for forked tasks: the child inherits the patched state of the parent.”…””}”(hjCh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KZhjÞh²hubhÌ)”}”(hŒ[Livepatch uses several complementary approaches to determine when it's safe to patch tasks:”h]”hŒ]Livepatch uses several complementary approaches to determine when it’s safe to patch tasks:”…””}”(hjQh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K^hjÞh²hubhŒenumerated_list”“”)”}”(hhh]”(hø)”}”(hXtThe first and most effective approach is stack checking of sleeping tasks. If no affected functions are on the stack of a given task, the task is patched. In most cases this will patch most or all of the tasks on the first try. Otherwise it'll keep trying periodically. This option is only available if the architecture has reliable stacks (HAVE_RELIABLE_STACKTRACE). ”h]”hÌ)”}”(hXsThe first and most effective approach is stack checking of sleeping tasks. If no affected functions are on the stack of a given task, the task is patched. In most cases this will patch most or all of the tasks on the first try. Otherwise it'll keep trying periodically. This option is only available if the architecture has reliable stacks (HAVE_RELIABLE_STACKTRACE).”h]”hXuThe first and most effective approach is stack checking of sleeping tasks. If no affected functions are on the stack of a given task, the task is patched. In most cases this will patch most or all of the tasks on the first try. Otherwise it’ll keep trying periodically. This option is only available if the architecture has reliable stacks (HAVE_RELIABLE_STACKTRACE).”…””}”(hjhh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kahjdubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjah²hh³hÊh´Nubhø)”}”(hX The second approach, if needed, is kernel exit switching. A task is switched when it returns to user space from a system call, a user space IRQ, or a signal. It's useful in the following cases: a) Patching I/O-bound user tasks which are sleeping on an affected function. In this case you have to send SIGSTOP and SIGCONT to force it to exit the kernel and be patched. b) Patching CPU-bound user tasks. If the task is highly CPU-bound then it will get patched the next time it gets interrupted by an IRQ. ”h]”(hÌ)”}”(hŒÃThe second approach, if needed, is kernel exit switching. A task is switched when it returns to user space from a system call, a user space IRQ, or a signal. It's useful in the following cases:”h]”hŒÅThe second approach, if needed, is kernel exit switching. A task is switched when it returns to user space from a system call, a user space IRQ, or a signal. It’s useful in the following cases:”…””}”(hj€h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khhj|ubj`)”}”(hhh]”(hø)”}”(hŒ«Patching I/O-bound user tasks which are sleeping on an affected function. In this case you have to send SIGSTOP and SIGCONT to force it to exit the kernel and be patched.”h]”hÌ)”}”(hŒ«Patching I/O-bound user tasks which are sleeping on an affected function. In this case you have to send SIGSTOP and SIGCONT to force it to exit the kernel and be patched.”h]”hŒ«Patching I/O-bound user tasks which are sleeping on an affected function. In this case you have to send SIGSTOP and SIGCONT to force it to exit the kernel and be patched.”…””}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Klhj‘ubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjŽubhø)”}”(hŒ†Patching CPU-bound user tasks. If the task is highly CPU-bound then it will get patched the next time it gets interrupted by an IRQ. ”h]”hÌ)”}”(hŒ…Patching CPU-bound user tasks. If the task is highly CPU-bound then it will get patched the next time it gets interrupted by an IRQ.”h]”hŒ…Patching CPU-bound user tasks. If the task is highly CPU-bound then it will get patched the next time it gets interrupted by an IRQ.”…””}”(hj­h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kohj©ubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjŽubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œ loweralpha”Œprefix”hŒsuffix”Œ)”uh1j_hj|ubeh}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjah²hh³Nh´Nubhø)”}”(hXFor idle "swapper" tasks, since they don't ever exit the kernel, they instead have a klp_update_patch_state() call in the idle loop which allows them to be patched before the CPU enters the idle state. (Note there's not yet such an approach for kthreads.) ”h]”(hÌ)”}”(hŒÉFor idle "swapper" tasks, since they don't ever exit the kernel, they instead have a klp_update_patch_state() call in the idle loop which allows them to be patched before the CPU enters the idle state.”h]”hŒÏFor idle “swapper†tasks, since they don’t ever exit the kernel, they instead have a klp_update_patch_state() call in the idle loop which allows them to be patched before the CPU enters the idle state.”…””}”(hjÖh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KshjÒubhÌ)”}”(hŒ5(Note there's not yet such an approach for kthreads.)”h]”hŒ7(Note there’s not yet such an approach for kthreads.)”…””}”(hjäh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KwhjÒubeh}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjah²hh³hÊh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jÇŒarabic”jÉhjÊŒ.”uh1j_hjÞh²hh³hÊh´KaubhÌ)”}”(hXArchitectures which don't have HAVE_RELIABLE_STACKTRACE solely rely on the second approach. It's highly likely that some tasks may still be running with an old version of the function, until that function returns. In this case you would have to signal the tasks. This especially applies to kthreads. They may not be woken up and would need to be forced. See below for more information.”h]”hX…Architectures which don’t have HAVE_RELIABLE_STACKTRACE solely rely on the second approach. It’s highly likely that some tasks may still be running with an old version of the function, until that function returns. In this case you would have to signal the tasks. This especially applies to kthreads. They may not be woken up and would need to be forced. See below for more information.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KyhjÞh²hubhÌ)”}”(hŒ§Unless we can come up with another way to patch kthreads, architectures without HAVE_RELIABLE_STACKTRACE are not considered fully supported by the kernel livepatching.”h]”hŒ§Unless we can come up with another way to patch kthreads, architectures without HAVE_RELIABLE_STACKTRACE are not considered fully supported by the kernel livepatching.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K€hjÞh²hubhÌ)”}”(hŒþThe /sys/kernel/livepatch//transition file shows whether a patch is in transition. Only a single patch can be in transition at a given time. A patch can remain in transition indefinitely, if any of the tasks are stuck in the initial patch state.”h]”hŒþThe /sys/kernel/livepatch//transition file shows whether a patch is in transition. Only a single patch can be in transition at a given time. A patch can remain in transition indefinitely, if any of the tasks are stuck in the initial patch state.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K„hjÞh²hubhÌ)”}”(hŒùA transition can be reversed and effectively canceled by writing the opposite value to the /sys/kernel/livepatch//enabled file while the transition is in progress. Then all the tasks will attempt to converge back to the original patch state.”h]”hŒùA transition can be reversed and effectively canceled by writing the opposite value to the /sys/kernel/livepatch//enabled file while the transition is in progress. Then all the tasks will attempt to converge back to the original patch state.”…””}”(hj*h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K‰hjÞh²hubhÌ)”}”(hXThere's also a /proc//patch_state file which can be used to determine which tasks are blocking completion of a patching operation. If a patch is in transition, this file shows 0 to indicate the task is unpatched and 1 to indicate it's patched. Otherwise, if no patch is in transition, it shows -1. Any tasks which are blocking the transition can be signaled with SIGSTOP and SIGCONT to force them to change their patched state. This may be harmful to the system though. Sending a fake signal to all remaining blocking tasks is a better alternative. No proper signal is actually delivered (there is no data in signal pending structures). Tasks are interrupted or woken up, and forced to change their patched state. The fake signal is automatically sent every 15 seconds.”h]”hX There’s also a /proc//patch_state file which can be used to determine which tasks are blocking completion of a patching operation. If a patch is in transition, this file shows 0 to indicate the task is unpatched and 1 to indicate it’s patched. Otherwise, if no patch is in transition, it shows -1. Any tasks which are blocking the transition can be signaled with SIGSTOP and SIGCONT to force them to change their patched state. This may be harmful to the system though. Sending a fake signal to all remaining blocking tasks is a better alternative. No proper signal is actually delivered (there is no data in signal pending structures). Tasks are interrupted or woken up, and forced to change their patched state. The fake signal is automatically sent every 15 seconds.”…””}”(hj8h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KŽhjÞh²hubhÌ)”}”(hXÈAdministrator can also affect a transition through /sys/kernel/livepatch//force attribute. Writing 1 there clears TIF_PATCH_PENDING flag of all tasks and thus forces the tasks to the patched state. Important note! The force attribute is intended for cases when the transition gets stuck for a long time because of a blocking task. Administrator is expected to collect all necessary data (namely stack traces of such blocking tasks) and request a clearance from a patch distributor to force the transition. Unauthorized usage may cause harm to the system. It depends on the nature of the patch, which functions are (un)patched, and which functions the blocking tasks are sleeping in (/proc//stack may help here). Removal (rmmod) of patch modules is permanently disabled when the force feature is used. It cannot be guaranteed there is no task sleeping in such module. It implies unbounded reference count if a patch module is disabled and enabled in a loop.”h]”hXÈAdministrator can also affect a transition through /sys/kernel/livepatch//force attribute. Writing 1 there clears TIF_PATCH_PENDING flag of all tasks and thus forces the tasks to the patched state. Important note! The force attribute is intended for cases when the transition gets stuck for a long time because of a blocking task. Administrator is expected to collect all necessary data (namely stack traces of such blocking tasks) and request a clearance from a patch distributor to force the transition. Unauthorized usage may cause harm to the system. It depends on the nature of the patch, which functions are (un)patched, and which functions the blocking tasks are sleeping in (/proc//stack may help here). Removal (rmmod) of patch modules is permanently disabled when the force feature is used. It cannot be guaranteed there is no task sleeping in such module. It implies unbounded reference count if a patch module is disabled and enabled in a loop.”…””}”(hjFh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KšhjÞh²hubhÌ)”}”(hXMoreover, the usage of force may also affect future applications of live patches and cause even more harm to the system. Administrator should first consider to simply cancel a transition (see above). If force is used, reboot should be planned and no more live patches applied.”h]”hXMoreover, the usage of force may also affect future applications of live patches and cause even more harm to the system. Administrator should first consider to simply cancel a transition (see above). If force is used, reboot should be planned and no more live patches applied.”…””}”(hjTh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¨hjÞh²hubh¶)”}”(hhh]”(h»)”}”(hŒ93.1 Adding consistency model support to new architectures”h]”hŒ93.1 Adding consistency model support to new architectures”…””}”(hjeh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j5jmuh1hºhjbh²hh³hÊh´K®ubhÌ)”}”(hŒSFor adding consistency model support to new architectures, there are a few options:”h]”hŒSFor adding consistency model support to new architectures, there are a few options:”…””}”(hjsh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K°hjbh²hubj`)”}”(hhh]”(hø)”}”(hŒ¼Add CONFIG_HAVE_RELIABLE_STACKTRACE. This means porting objtool, and for non-DWARF unwinders, also making sure there's a way for the stack tracing code to detect interrupts on the stack. ”h]”hÌ)”}”(hŒ»Add CONFIG_HAVE_RELIABLE_STACKTRACE. This means porting objtool, and for non-DWARF unwinders, also making sure there's a way for the stack tracing code to detect interrupts on the stack.”h]”hŒ½Add CONFIG_HAVE_RELIABLE_STACKTRACE. This means porting objtool, and for non-DWARF unwinders, also making sure there’s a way for the stack tracing code to detect interrupts on the stack.”…””}”(hjˆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K³hj„ubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjh²hh³hÊh´Nubhø)”}”(hXƒAlternatively, ensure that every kthread has a call to klp_update_patch_state() in a safe location. Kthreads are typically in an infinite loop which does some action repeatedly. The safe location to switch the kthread's patch state would be at a designated point in the loop where there are no locks taken and all data structures are in a well-defined state. The location is clear when using workqueues or the kthread worker API. These kthreads process independent actions in a generic loop. It's much more complicated with kthreads which have a custom loop. There the safe location must be carefully selected on a case-by-case basis. In that case, arches without HAVE_RELIABLE_STACKTRACE would still be able to use the non-stack-checking parts of the consistency model: a) patching user tasks when they cross the kernel/user space boundary; and b) patching kthreads and idle tasks at their designated patch points. This option isn't as good as option 1 because it requires signaling user tasks and waking kthreads to patch them. But it could still be a good backup option for those architectures which don't have reliable stack traces yet. ”h]”(hÌ)”}”(hXhAlternatively, ensure that every kthread has a call to klp_update_patch_state() in a safe location. Kthreads are typically in an infinite loop which does some action repeatedly. The safe location to switch the kthread's patch state would be at a designated point in the loop where there are no locks taken and all data structures are in a well-defined state.”h]”hXjAlternatively, ensure that every kthread has a call to klp_update_patch_state() in a safe location. Kthreads are typically in an infinite loop which does some action repeatedly. The safe location to switch the kthread’s patch state would be at a designated point in the loop where there are no locks taken and all data structures are in a well-defined state.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K·hjœubhÌ)”}”(hŒ…The location is clear when using workqueues or the kthread worker API. These kthreads process independent actions in a generic loop.”h]”hŒ…The location is clear when using workqueues or the kthread worker API. These kthreads process independent actions in a generic loop.”…””}”(hj®h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¾hjœubhÌ)”}”(hŒŽIt's much more complicated with kthreads which have a custom loop. There the safe location must be carefully selected on a case-by-case basis.”h]”hŒIt’s much more complicated with kthreads which have a custom loop. There the safe location must be carefully selected on a case-by-case basis.”…””}”(hj¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÁhjœubhÌ)”}”(hŒ‡In that case, arches without HAVE_RELIABLE_STACKTRACE would still be able to use the non-stack-checking parts of the consistency model:”h]”hŒ‡In that case, arches without HAVE_RELIABLE_STACKTRACE would still be able to use the non-stack-checking parts of the consistency model:”…””}”(hjÊh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÅhjœubj`)”}”(hhh]”(hø)”}”(hŒHpatching user tasks when they cross the kernel/user space boundary; and ”h]”hÌ)”}”(hŒGpatching user tasks when they cross the kernel/user space boundary; and”h]”hŒGpatching user tasks when they cross the kernel/user space boundary; and”…””}”(hjßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÈhjÛubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjØubhø)”}”(hŒCpatching kthreads and idle tasks at their designated patch points. ”h]”hÌ)”}”(hŒBpatching kthreads and idle tasks at their designated patch points.”h]”hŒBpatching kthreads and idle tasks at their designated patch points.”…””}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KËhjóubah}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjØubeh}”(h]”h ]”h"]”h$]”h&]”jÇjÈjÉhjÊjËuh1j_hjœubhÌ)”}”(hŒáThis option isn't as good as option 1 because it requires signaling user tasks and waking kthreads to patch them. But it could still be a good backup option for those architectures which don't have reliable stack traces yet.”h]”hŒåThis option isn’t as good as option 1 because it requires signaling user tasks and waking kthreads to patch them. But it could still be a good backup option for those architectures which don’t have reliable stack traces yet.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÍhjœubeh}”(h]”h ]”h"]”h$]”h&]”uh1h÷hjh²hh³hÊh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jÇjþjÉhjÊjËuh1j_hjbh²hh³hÊh´K³ubeh}”(h]”jsah ]”h"]”Œ93.1 adding consistency model support to new architectures”ah$]”h&]”uh1hµhjÞh²hh³hÊh´K®ubeh}”(h]”jTah ]”h"]”Œ3. consistency model”ah$]”h&]”uh1hµhh·h²hh³hÊh´K3ubh¶)”}”(hhh]”(h»)”}”(hŒ4. Livepatch module”h]”hŒ4. Livepatch module”…””}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j5j›uh1hºhj9h²hh³hÊh´KÔubhÌ)”}”(hŒ[Livepatches are distributed using kernel modules, see samples/livepatch/livepatch-sample.c.”h]”hŒ[Livepatches are distributed using kernel modules, see samples/livepatch/livepatch-sample.c.”…””}”(hjJh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÖhj9h²hubhÌ)”}”(hX¬The module includes a new implementation of functions that we want to replace. In addition, it defines some structures describing the relation between the original and the new implementation. Then there is code that makes the kernel start using the new code when the livepatch module is loaded. Also there is code that cleans up before the livepatch module is removed. All this is explained in more details in the next sections.”h]”hX¬The module includes a new implementation of functions that we want to replace. In addition, it defines some structures describing the relation between the original and the new implementation. Then there is code that makes the kernel start using the new code when the livepatch module is loaded. Also there is code that cleans up before the livepatch module is removed. All this is explained in more details in the next sections.”…””}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÙhj9h²hubh¶)”}”(hhh]”(h»)”}”(hŒ4.1. New functions”h]”hŒ4.1. New functions”…””}”(hjih²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j5jºuh1hºhjfh²hh³hÊh´KãubhÌ)”}”(hX=New versions of functions are typically just copied from the original sources. A good practice is to add a prefix to the names so that they can be distinguished from the original ones, e.g. in a backtrace. Also they can be declared as static because they are not called directly and do not need the global visibility.”h]”hX=New versions of functions are typically just copied from the original sources. A good practice is to add a prefix to the names so that they can be distinguished from the original ones, e.g. in a backtrace. Also they can be declared as static because they are not called directly and do not need the global visibility.”…””}”(hjwh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kåhjfh²hubhÌ)”}”(hXHThe patch contains only functions that are really modified. But they might want to access functions or data from the original source file that may only be locally accessible. This can be solved by a special relocation section in the generated livepatch module, see Documentation/livepatch/module-elf-format.rst for more details.”h]”hXHThe patch contains only functions that are really modified. But they might want to access functions or data from the original source file that may only be locally accessible. This can be solved by a special relocation section in the generated livepatch module, see Documentation/livepatch/module-elf-format.rst for more details.”…””}”(hj…h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Këhjfh²hubeh}”(h]”jÀah ]”h"]”Œ4.1. new functions”ah$]”h&]”uh1hµhj9h²hh³hÊh´Kãubh¶)”}”(hhh]”(h»)”}”(hŒ 4.2. Metadata”h]”hŒ 4.2. Metadata”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j5jÜuh1hºhjšh²hh³hÊh´KóubhÌ)”}”(hŒZThe patch is described by several structures that split the information into three levels:”h]”hŒZThe patch is described by several structures that split the information into three levels:”…””}”(hj«h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kõhjšh²hubjk)”}”(hX”- struct klp_func is defined for each patched function. It describes the relation between the original and the new implementation of a particular function. The structure includes the name, as a string, of the original function. The function address is found via kallsyms at runtime. Then it includes the address of the new function. It is defined directly by assigning the function pointer. Note that the new function is typically defined in the same source file. As an optional parameter, the symbol position in the kallsyms database can be used to disambiguate functions of the same name. This is not the absolute position in the database, but rather the order it has been found only for a particular object ( vmlinux or a kernel module ). Note that kallsyms allows for searching symbols according to the object name. - struct klp_object defines an array of patched functions (struct klp_func) in the same object. Where the object is either vmlinux (NULL) or a module name. The structure helps to group and handle functions for each object together. Note that patched modules might be loaded later than the patch itself and the relevant functions might be patched only when they are available. - struct klp_patch defines an array of patched objects (struct klp_object). This structure handles all patched functions consistently and eventually, synchronously. The whole patch is applied only when all patched symbols are found. The only exception are symbols from objects (kernel modules) that have not been loaded yet. For more details on how the patch is applied on a per-task basis, see the "Consistency model" section. ”h]”hó)”}”(hhh]”(hø)”}”(hX5struct klp_func is defined for each patched function. It describes the relation between the original and the new implementation of a particular function. The structure includes the name, as a string, of the original function. The function address is found via kallsyms at runtime. Then it includes the address of the new function. It is defined directly by assigning the function pointer. Note that the new function is typically defined in the same source file. As an optional parameter, the symbol position in the kallsyms database can be used to disambiguate functions of the same name. This is not the absolute position in the database, but rather the order it has been found only for a particular object ( vmlinux or a kernel module ). Note that kallsyms allows for searching symbols according to the object name. ”h]”(hÌ)”}”(hŒ™struct klp_func is defined for each patched function. It describes the relation between the original and the new implementation of a particular function.”h]”hŒ™struct klp_func is defined for each patched function. It describes the relation between the original and the new implementation of a particular function.”…””}”(hjÄh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KøhjÀubhÌ)”}”(hŒ~The structure includes the name, as a string, of the original function. The function address is found via kallsyms at runtime.”h]”hŒ~The structure includes the name, as a string, of the original function. The function address is found via kallsyms at runtime.”…””}”(hjÒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KühjÀubhÌ)”}”(hŒ´Then it includes the address of the new function. It is defined directly by assigning the function pointer. Note that the new function is typically defined in the same source file.”h]”hŒ´Then it includes the address of the new function. It is defined directly by assigning the function pointer. Note that the new function is typically defined in the same source file.”…””}”(hjàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÿhjÀubhÌ)”}”(hXcAs an optional parameter, the symbol position in the kallsyms database can be used to disambiguate functions of the same name. This is not the absolute position in the database, but rather the order it has been found only for a particular object ( vmlinux or a kernel module ). Note that kallsyms allows for searching symbols according to the object name.”h]”hXcAs an optional parameter, the symbol position in the kallsyms database can be used to disambiguate functions of the same name. This is not the absolute position in the database, but rather the order it has been found only for a particular object ( vmlinux or a kernel module ). Note that kallsyms allows for searching symbols according to the object name.”…””}”(hjîh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MhjÀubeh}”(h]”h ]”h"]”h$]”h&]”uh1h÷hj½ubhø)”}”(hXxstruct klp_object defines an array of patched functions (struct klp_func) in the same object. Where the object is either vmlinux (NULL) or a module name. The structure helps to group and handle functions for each object together. Note that patched modules might be loaded later than the patch itself and the relevant functions might be patched only when they are available. ”h]”(hÌ)”}”(hŒ™struct klp_object defines an array of patched functions (struct klp_func) in the same object. Where the object is either vmlinux (NULL) or a module name.”h]”hŒ™struct klp_object defines an array of patched functions (struct klp_func) in the same object. Where the object is either vmlinux (NULL) or a module name.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M hjubhÌ)”}”(hŒÛThe structure helps to group and handle functions for each object together. Note that patched modules might be loaded later than the patch itself and the relevant functions might be patched only when they are available.”h]”hŒÛThe structure helps to group and handle functions for each object together. Note that patched modules might be loaded later than the patch itself and the relevant functions might be patched only when they are available.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1h÷hj½ubhø)”}”(hX­struct klp_patch defines an array of patched objects (struct klp_object). This structure handles all patched functions consistently and eventually, synchronously. The whole patch is applied only when all patched symbols are found. The only exception are symbols from objects (kernel modules) that have not been loaded yet. For more details on how the patch is applied on a per-task basis, see the "Consistency model" section. ”h]”(hÌ)”}”(hŒIstruct klp_patch defines an array of patched objects (struct klp_object).”h]”hŒIstruct klp_patch defines an array of patched objects (struct klp_object).”…””}”(hj,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj(ubhÌ)”}”(hŒøThis structure handles all patched functions consistently and eventually, synchronously. The whole patch is applied only when all patched symbols are found. The only exception are symbols from objects (kernel modules) that have not been loaded yet.”h]”hŒøThis structure handles all patched functions consistently and eventually, synchronously. The whole patch is applied only when all patched symbols are found. The only exception are symbols from objects (kernel modules) that have not been loaded yet.”…””}”(hj:h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj(ubhÌ)”}”(hŒfFor more details on how the patch is applied on a per-task basis, see the "Consistency model" section.”h]”hŒjFor more details on how the patch is applied on a per-task basis, see the “Consistency model†section.”…””}”(hjHh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj(ubeh}”(h]”h ]”h"]”h$]”h&]”uh1h÷hj½ubeh}”(h]”h ]”h"]”h$]”h&]”jÁjÂuh1hòh³hÊh´Køhj¹ubah}”(h]”h ]”h"]”h$]”h&]”uh1jjh³hÊh´Køhjšh²hubeh}”(h]”jâah ]”h"]”Œ 4.2. metadata”ah$]”h&]”uh1hµhj9h²hh³hÊh´Kóubeh}”(h]”j¡ah ]”h"]”Œ4. livepatch module”ah$]”h&]”uh1hµhh·h²hh³hÊh´KÔubh¶)”}”(hhh]”(h»)”}”(hŒ5. Livepatch life-cycle”h]”hŒ5. Livepatch life-cycle”…””}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j5j uh1hºhjvh²hh³hÊh´M ubhÌ)”}”(hŒjLivepatching can be described by five basic operations: loading, enabling, replacing, disabling, removing.”h]”hŒjLivepatching can be described by five basic operations: loading, enabling, replacing, disabling, removing.”…””}”(hj‡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M"hjvh²hubhÌ)”}”(hŒŽWhere the replacing and the disabling operations are mutually exclusive. They have the same result for the given patch but not for the system.”h]”hŒŽWhere the replacing and the disabling operations are mutually exclusive. They have the same result for the given patch but not for the system.”…””}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M%hjvh²hubh¶)”}”(hhh]”(h»)”}”(hŒ 5.1. Loading”h]”hŒ 5.1. Loading”…””}”(hj¦h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j5j)uh1hºhj£h²hh³hÊh´M+ubhÌ)”}”(hŒÉThe only reasonable way is to enable the patch when the livepatch kernel module is being loaded. For this, klp_enable_patch() has to be called in the module_init() callback. There are two main reasons:”h]”hŒÉThe only reasonable way is to enable the patch when the livepatch kernel module is being loaded. For this, klp_enable_patch() has to be called in the module_init() callback. There are two main reasons:”…””}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M-hj£h²hubhÌ)”}”(hŒJFirst, only the module has an easy access to the related struct klp_patch.”h]”hŒJFirst, only the module has an easy access to the related struct klp_patch.”…””}”(hjÂh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M1hj£h²hubhÌ)”}”(hŒdSecond, the error code might be used to refuse loading the module when the patch cannot get enabled.”h]”hŒdSecond, the error code might be used to refuse loading the module when the patch cannot get enabled.”…””}”(hjÐh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M3hj£h²hubeh}”(h]”j/ah ]”h"]”Œ 5.1. loading”ah$]”h&]”uh1hµhjvh²hh³hÊh´M+ubh¶)”}”(hhh]”(h»)”}”(hŒ 5.2. Enabling”h]”hŒ 5.2. Enabling”…””}”(hjèh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j5jKuh1hºhjåh²hh³hÊh´M8ubhÌ)”}”(hŒ´The livepatch gets enabled by calling klp_enable_patch() from the module_init() callback. The system will start using the new implementation of the patched functions at this stage.”h]”hŒ´The livepatch gets enabled by calling klp_enable_patch() from the module_init() callback. The system will start using the new implementation of the patched functions at this stage.”…””}”(hjöh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M:hjåh²hubhÌ)”}”(hXFirst, the addresses of the patched functions are found according to their names. The special relocations, mentioned in the section "New functions", are applied. The relevant entries are created under /sys/kernel/livepatch/. The patch is rejected when any above operation fails.”h]”hX First, the addresses of the patched functions are found according to their names. The special relocations, mentioned in the section “New functionsâ€, are applied. The relevant entries are created under /sys/kernel/livepatch/. The patch is rejected when any above operation fails.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M>hjåh²hubhÌ)”}”(hXŸSecond, livepatch enters into a transition state where tasks are converging to the patched state. If an original function is patched for the first time, a function specific struct klp_ops is created and an universal ftrace handler is registered\ [#]_. This stage is indicated by a value of '1' in /sys/kernel/livepatch//transition. For more information about this process, see the "Consistency model" section.”h]”(hŒöSecond, livepatch enters into a transition state where tasks are converging to the patched state. If an original function is patched for the first time, a function specific struct klp_ops is created and an universal ftrace handler is registered ”…””}”(hjh²hh³Nh´NubhŒfootnote_reference”“”)”}”(hŒ[#]_”h]”hŒ1”…””}”(hjh²hh³Nh´Nubah}”(h]”Œid1”ah ]”h"]”h$]”h&]”Œauto”Kj5Œid2”Œdocname”Œlivepatch/livepatch”uh1jhjŒresolved”KubhŒ­. This stage is indicated by a value of ‘1’ in /sys/kernel/livepatch//transition. For more information about this process, see the “Consistency model†section.”…””}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MDhjåh²hubhÌ)”}”(hŒQFinally, once all tasks have been patched, the 'transition' value changes to '0'.”h]”hŒYFinally, once all tasks have been patched, the ‘transition’ value changes to ‘0’.”…””}”(hj:h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MKhjåh²hubhŒfootnote”“”)”}”(hX Note that functions might be patched multiple times. The ftrace handler is registered only once for a given function. Further patches just add an entry to the list (see field `func_stack`) of the struct klp_ops. The right implementation is selected by the ftrace handler, see the "Consistency model" section. That said, it is highly recommended to use cumulative livepatches because they help keeping the consistency of all changes. In this case, functions might be patched two times only during the transition period. ”h]”(hŒlabel”“”)”}”(hhh]”hŒ1”…””}”(hjPh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jNhjJh²hh³Nh´NubhÌ)”}”(hX4Note that functions might be patched multiple times. The ftrace handler is registered only once for a given function. Further patches just add an entry to the list (see field `func_stack`) of the struct klp_ops. The right implementation is selected by the ftrace handler, see the "Consistency model" section.”h]”(hŒ¯Note that functions might be patched multiple times. The ftrace handler is registered only once for a given function. Further patches just add an entry to the list (see field ”…””}”(hj]h²hh³Nh´NubhŒtitle_reference”“”)”}”(hŒ `func_stack`”h]”hŒ func_stack”…””}”(hjgh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jehj]ubhŒ}) of the struct klp_ops. The right implementation is selected by the ftrace handler, see the “Consistency model†section.”…””}”(hj]h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MPhjJubhÌ)”}”(hŒÑThat said, it is highly recommended to use cumulative livepatches because they help keeping the consistency of all changes. In this case, functions might be patched two times only during the transition period.”h]”hŒÑThat said, it is highly recommended to use cumulative livepatches because they help keeping the consistency of all changes. In this case, functions might be patched two times only during the transition period.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MVhjJubeh}”(h]”j,ah ]”h"]”Œ1”ah$]”h&]”j&aj+Kj-j.uh1jHh³hÊh´MNhjåh²hubeh}”(h]”jQah ]”h"]”Œ 5.2. enabling”ah$]”h&]”uh1hµhjvh²hh³hÊh´M8ubh¶)”}”(hhh]”(h»)”}”(hŒ5.3. Replacing”h]”hŒ5.3. Replacing”…””}”(hjžh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j5jmuh1hºhj›h²hh³hÊh´M\ubhÌ)”}”(hŒ\All enabled patches might get replaced by a cumulative patch that has the .replace flag set.”h]”hŒ\All enabled patches might get replaced by a cumulative patch that has the .replace flag set.”…””}”(hj¬h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M^hj›h²hubhÌ)”}”(hXbOnce the new patch is enabled and the 'transition' finishes then all the functions (struct klp_func) associated with the replaced patches are removed from the corresponding struct klp_ops. Also the ftrace handler is unregistered and the struct klp_ops is freed when the related function is not modified by the new patch and func_stack list becomes empty.”h]”hXfOnce the new patch is enabled and the ‘transition’ finishes then all the functions (struct klp_func) associated with the replaced patches are removed from the corresponding struct klp_ops. Also the ftrace handler is unregistered and the struct klp_ops is freed when the related function is not modified by the new patch and func_stack list becomes empty.”…””}”(hjºh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mahj›h²hubhÌ)”}”(hŒDSee Documentation/livepatch/cumulative-patches.rst for more details.”h]”hŒDSee Documentation/livepatch/cumulative-patches.rst for more details.”…””}”(hjÈh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhhj›h²hubeh}”(h]”jsah ]”h"]”Œ5.3. replacing”ah$]”h&]”uh1hµhjvh²hh³hÊh´M\ubh¶)”}”(hhh]”(h»)”}”(hŒ5.4. Disabling”h]”hŒ5.4. Disabling”…””}”(hjàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j5juh1hºhjÝh²hh³hÊh´MlubhÌ)”}”(hŒZEnabled patches might get disabled by writing '0' to /sys/kernel/livepatch//enabled.”h]”hŒ^Enabled patches might get disabled by writing ‘0’ to /sys/kernel/livepatch//enabled.”…””}”(hjîh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MnhjÝh²hubhÌ)”}”(hXjFirst, livepatch enters into a transition state where tasks are converging to the unpatched state. The system starts using either the code from the previously enabled patch or even the original one. This stage is indicated by a value of '1' in /sys/kernel/livepatch//transition. For more information about this process, see the "Consistency model" section.”h]”hXrFirst, livepatch enters into a transition state where tasks are converging to the unpatched state. The system starts using either the code from the previously enabled patch or even the original one. This stage is indicated by a value of ‘1’ in /sys/kernel/livepatch//transition. For more information about this process, see the “Consistency model†section.”…””}”(hjüh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MqhjÝh²hubhÌ)”}”(hX=Second, once all tasks have been unpatched, the 'transition' value changes to '0'. All the functions (struct klp_func) associated with the to-be-disabled patch are removed from the corresponding struct klp_ops. The ftrace handler is unregistered and the struct klp_ops is freed when the func_stack list becomes empty.”h]”hXESecond, once all tasks have been unpatched, the ‘transition’ value changes to ‘0’. All the functions (struct klp_func) associated with the to-be-disabled patch are removed from the corresponding struct klp_ops. The ftrace handler is unregistered and the struct klp_ops is freed when the func_stack list becomes empty.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MxhjÝh²hubhÌ)”}”(hŒ(Third, the sysfs interface is destroyed.”h]”hŒ(Third, the sysfs interface is destroyed.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M~hjÝh²hubeh}”(h]”j•ah ]”h"]”Œ5.4. disabling”ah$]”h&]”uh1hµhjvh²hh³hÊh´Mlubh¶)”}”(hhh]”(h»)”}”(hŒ 5.5. Removing”h]”hŒ 5.5. Removing”…””}”(hj0 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j5j±uh1hºhj- h²hh³hÊh´M‚ubhÌ)”}”(hXQModule removal is only safe when there are no users of functions provided by the module. This is the reason why the force feature permanently disables the removal. Only when the system is successfully transitioned to a new patch state (patched/unpatched) without being forced it is guaranteed that no task sleeps or runs in the old code.”h]”hXQModule removal is only safe when there are no users of functions provided by the module. This is the reason why the force feature permanently disables the removal. Only when the system is successfully transitioned to a new patch state (patched/unpatched) without being forced it is guaranteed that no task sleeps or runs in the old code.”…””}”(hj> h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M„hj- h²hubeh}”(h]”j·ah ]”h"]”Œ 5.5. removing”ah$]”h&]”uh1hµhjvh²hh³hÊh´M‚ubeh}”(h]”jah ]”h"]”Œ5. livepatch life-cycle”ah$]”h&]”uh1hµhh·h²hh³hÊh´M ubh¶)”}”(hhh]”(h»)”}”(hŒ6. Sysfs”h]”hŒ6. Sysfs”…””}”(hj] h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j5jßuh1hºhjZ h²hh³hÊh´MŒubhÌ)”}”(hŒŽInformation about the registered patches can be found under /sys/kernel/livepatch. The patches could be enabled and disabled by writing there.”h]”hŒŽInformation about the registered patches can be found under /sys/kernel/livepatch. The patches could be enabled and disabled by writing there.”…””}”(hjk h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MŽhjZ h²hubhÌ)”}”(hŒb/sys/kernel/livepatch//force attributes allow administrator to affect a patching operation.”h]”hŒb/sys/kernel/livepatch//force attributes allow administrator to affect a patching operation.”…””}”(hjy h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M’hjZ h²hubhÌ)”}”(hŒFSee Documentation/ABI/testing/sysfs-kernel-livepatch for more details.”h]”hŒFSee Documentation/ABI/testing/sysfs-kernel-livepatch for more details.”…””}”(hj‡ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M•hjZ h²hubeh}”(h]”jåah ]”h"]”Œ6. sysfs”ah$]”h&]”uh1hµhh·h²hh³hÊh´MŒubh¶)”}”(hhh]”(h»)”}”(hŒ7. Limitations”h]”hŒ7. Limitations”…””}”(hjŸ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j5juh1hºhjœ h²hh³hÊh´M™ubhÌ)”}”(hŒ=The current Livepatch implementation has several limitations:”h]”hŒ=The current Livepatch implementation has several limitations:”…””}”(hj­ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M›hjœ h²hubjk)”}”(hXˆ- Only functions that can be traced could be patched. Livepatch is based on the dynamic ftrace. In particular, functions implementing ftrace or the livepatch ftrace handler could not be patched. Otherwise, the code would end up in an infinite loop. A potential mistake is prevented by marking the problematic functions by "notrace". - Livepatch works reliably only when the dynamic ftrace is located at the very beginning of the function. The function need to be redirected before the stack or the function parameters are modified in any way. For example, livepatch requires using -fentry gcc compiler option on x86_64. One exception is the PPC port. It uses relative addressing and TOC. Each function has to handle TOC and save LR before it could call the ftrace handler. This operation has to be reverted on return. Fortunately, the generic ftrace code has the same problem and all this is handled on the ftrace level. - Kretprobes using the ftrace framework conflict with the patched functions. Both kretprobes and livepatches use a ftrace handler that modifies the return address. The first user wins. Either the probe or the patch is rejected when the handler is already in use by the other. - Kprobes in the original function are ignored when the code is redirected to the new implementation. There is a work in progress to add warnings about this situation.”h]”hó)”}”(hhh]”(hø)”}”(hXNOnly functions that can be traced could be patched. Livepatch is based on the dynamic ftrace. In particular, functions implementing ftrace or the livepatch ftrace handler could not be patched. Otherwise, the code would end up in an infinite loop. A potential mistake is prevented by marking the problematic functions by "notrace". ”h]”(hÌ)”}”(hŒ3Only functions that can be traced could be patched.”h]”hŒ3Only functions that can be traced could be patched.”…””}”(hjÆ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj ubhÌ)”}”(hXLivepatch is based on the dynamic ftrace. In particular, functions implementing ftrace or the livepatch ftrace handler could not be patched. Otherwise, the code would end up in an infinite loop. A potential mistake is prevented by marking the problematic functions by "notrace".”h]”hXLivepatch is based on the dynamic ftrace. In particular, functions implementing ftrace or the livepatch ftrace handler could not be patched. Otherwise, the code would end up in an infinite loop. A potential mistake is prevented by marking the problematic functions by “notraceâ€.”…””}”(hjÔ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MŸhj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1h÷hj¿ ubhø)”}”(hXMLivepatch works reliably only when the dynamic ftrace is located at the very beginning of the function. The function need to be redirected before the stack or the function parameters are modified in any way. For example, livepatch requires using -fentry gcc compiler option on x86_64. One exception is the PPC port. It uses relative addressing and TOC. Each function has to handle TOC and save LR before it could call the ftrace handler. This operation has to be reverted on return. Fortunately, the generic ftrace code has the same problem and all this is handled on the ftrace level. ”h]”(hÌ)”}”(hŒgLivepatch works reliably only when the dynamic ftrace is located at the very beginning of the function.”h]”hŒgLivepatch works reliably only when the dynamic ftrace is located at the very beginning of the function.”…””}”(hjì h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M§hjè ubhÌ)”}”(hŒ´The function need to be redirected before the stack or the function parameters are modified in any way. For example, livepatch requires using -fentry gcc compiler option on x86_64.”h]”hŒ´The function need to be redirected before the stack or the function parameters are modified in any way. For example, livepatch requires using -fentry gcc compiler option on x86_64.”…””}”(hjú h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mªhjè ubhÌ)”}”(hX,One exception is the PPC port. It uses relative addressing and TOC. Each function has to handle TOC and save LR before it could call the ftrace handler. This operation has to be reverted on return. Fortunately, the generic ftrace code has the same problem and all this is handled on the ftrace level.”h]”hX,One exception is the PPC port. It uses relative addressing and TOC. Each function has to handle TOC and save LR before it could call the ftrace handler. This operation has to be reverted on return. Fortunately, the generic ftrace code has the same problem and all this is handled on the ftrace level.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M®hjè ubeh}”(h]”h ]”h"]”h$]”h&]”uh1h÷hj¿ ubhø)”}”(hXKretprobes using the ftrace framework conflict with the patched functions. Both kretprobes and livepatches use a ftrace handler that modifies the return address. The first user wins. Either the probe or the patch is rejected when the handler is already in use by the other. ”•0h]”(hÌ)”}”(hŒJKretprobes using the ftrace framework conflict with the patched functions.”h]”hŒJKretprobes using the ftrace framework conflict with the patched functions.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mµhj ubhÌ)”}”(hŒÆBoth kretprobes and livepatches use a ftrace handler that modifies the return address. The first user wins. Either the probe or the patch is rejected when the handler is already in use by the other.”h]”hŒÆBoth kretprobes and livepatches use a ftrace handler that modifies the return address. The first user wins. Either the probe or the patch is rejected when the handler is already in use by the other.”…””}”(hj. h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M¸hj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1h÷hj¿ ubhø)”}”(hŒ¦Kprobes in the original function are ignored when the code is redirected to the new implementation. There is a work in progress to add warnings about this situation.”h]”(hÌ)”}”(hŒcKprobes in the original function are ignored when the code is redirected to the new implementation.”h]”hŒcKprobes in the original function are ignored when the code is redirected to the new implementation.”…””}”(hjF h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M½hjB ubhÌ)”}”(hŒAThere is a work in progress to add warnings about this situation.”h]”hŒAThere is a work in progress to add warnings about this situation.”…””}”(hjT h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MÀhjB ubeh}”(h]”h ]”h"]”h$]”h&]”uh1h÷hj¿ ubeh}”(h]”h ]”h"]”h$]”h&]”jÁjÂuh1hòh³hÊh´Mhj» ubah}”(h]”h ]”h"]”h$]”h&]”uh1jjh³hÊh´Mhjœ h²hubeh}”(h]”jah ]”h"]”Œ7. limitations”ah$]”h&]”uh1hµhh·h²hh³hÊh´M™ubeh}”(h]”Œ livepatch”ah ]”h"]”Œ livepatch”ah$]”h&]”uh1hµhhh²hh³hÊh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÊuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hºNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j¦ Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÊŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”j,]”jasŒnameids”}”(j€ j} j!jjHjjÛj2j6jTj/jsjsj¡j—jÀjljâjW jjâj/j˜jQjÚjsj* j•jP j·j™ jåjx jj‘j,uŒ nametypes”}”(j€ ‰j!‰jH‰jÛ‰j6‰j/‰js‰j—‰jl‰jW ‰jâ‰j˜‰jÚ‰j* ‰jP ‰j™ ‰jx ‰j‘ˆuh}”(j} h·jhïjj$j2jKjTjÞjsjbj¡j9jÀjfjâjšjjvj/j£jQjåj&jj,jJjsj›j•jÝj·j- jåjZ jjœ j jj,j#jNjEjmjdj›j’jºj±jÜjÓj jj)j jKjBjmjdjj†j±j¨jßjÖjjøuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”jJaŒautofootnote_refs”]”jaŒsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”j´ Ks…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.