livepatch/core: Allow implementation without ftrace
euler inclusion
category: feature
bugzilla: 51921
CVE: NA
----------------------------------------
support for livepatch without ftrace mode
new config for WO_FTRACE
CONFIG_LIVEPATCH_WO_FTRACE=y
CONFIG_LIVEPATCH_STACK=y
Implements livepatch without ftrace by direct jump, we
directly modify the first few instructions(usually one,
but four for long jumps under ARM64) of the old function
as jump instructions by stop_machine, so it will jump to
the first address of the new function when livepatch enable
KERNEL/MODULE
call/bl A---------------old_A------------
| jump new_A----+--------|
| | |
| | |
----------------- |
|
|
|
livepatch_module------------- |
| | |
|new_A <--------------------+--------------------|
| |
| |
|---------------------------|
| .plt |
| ......PLTS for livepatch |
-----------------------------
something we need to consider under different architectures:
1. jump instruction
2. partial relocation in new function requires for livepatch.
3. long jumps may be required if the jump address exceeds the
offset. both for livepatch relocation and livepatch enable.
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
Reviewed-by: NLi Bin <huawei.libin@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
Signed-off-by: NDong Kai <dongkai11@huawei.com>
Signed-off-by: NYe Weihua <yeweihua4@huawei.com>
Reviewed-by: NYang Jihong <yangjihong1@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Showing
想要评论请 注册 或 登录