mirror of
https://github.com/dynup/kpatch
synced 2024-12-26 07:12:03 +00:00
2e93c5e1e3
Some functions in the kernel are always on the stack of some thread in the system. Attempts to patch these function will currently always fail the activeness safety check. However, through human inspection, it can be determined that, for a particular function, consistency is maintained even if the old and new versions of the function run concurrently. This commit introduces a KPATCH_FORCE_UNSAFE() macro to define patched functions that such be exempted from the activeness safety check. Signed-off-by: Seth Jennings <sjenning@redhat.com>
33 lines
1008 B
Plaintext
33 lines
1008 B
Plaintext
__kpatch_funcs = ADDR(.kpatch.funcs);
|
|
__kpatch_funcs_end = ADDR(.kpatch.funcs) + SIZEOF(.kpatch.funcs);
|
|
__kpatch_dynrelas = ADDR(.kpatch.dynrelas);
|
|
__kpatch_dynrelas_end = ADDR(.kpatch.dynrelas) + SIZEOF(.kpatch.dynrelas);
|
|
SECTIONS
|
|
{
|
|
.kpatch.hooks.load : {
|
|
__kpatch_hooks_load = . ;
|
|
*(.kpatch.hooks.load)
|
|
__kpatch_hooks_load_end = . ;
|
|
/*
|
|
* Pad the end of the section with zeros in case the section is empty.
|
|
* This prevents the kernel from discarding the section at module
|
|
* load time. __kpatch_hooks_load_end will still point to the end of
|
|
* the section before the padding. If the .kpatch.hooks.load section
|
|
* is empty, __kpatch_hooks_load equals __kpatch_hooks_load_end.
|
|
*/
|
|
QUAD(0);
|
|
}
|
|
.kpatch.hooks.unload : {
|
|
__kpatch_hooks_unload = . ;
|
|
*(.kpatch.hooks.unload)
|
|
__kpatch_hooks_unload_end = . ;
|
|
QUAD(0);
|
|
}
|
|
.kpatch.force : {
|
|
__kpatch_force_funcs = . ;
|
|
*(.kpatch.force)
|
|
__kpatch_force_funcs_end = . ;
|
|
QUAD(0);
|
|
}
|
|
}
|