livepatch/ppc32: Fix func size less than limit
euler inclusion
category: feature
bugzilla: 51924
CVE: N/A
----------------------------------------
we need to modify the first 4 instructions of a livepatch function to
complete the long jump if offset out of short-range. So it's important
that this function must have more than 4 instructions, so we checked it
when the livepatch module insmod.
testcase : testEL_HOTPATCH_ADDFUNTOMULTIFILE_FUN-001
before this patch:
insmod ./klp_patch.ko
echo 1 > /sys/kernel/livepatch/klp_patch/enable
echo 3 > /proc/sys/vm/drop_caches
kernel crash, the call trace is like
Call Trace:
Unable to handler kernel paging request for instruction fetch
Fualting instruction address: 0x00000000
invalidate_mapping_pages+x0cc/0x180
drop_pagecache_sb+0x84/0x94
iterate_supers+0xf8/0xfc
drop_caches_sysctl_handler+0x88/0x108
proc_sys_call_handler+0xbc/0xfc
__vfs_write+0x3c/0x154
vfs_write+0xa0/0x114
Sys_write+0x4c/0xc4
ret_from_syscall+0x0/0x38
after this patch:
insmod ./klp_patch.ko
insmod: can't insert './klp_patch.ko': Operation not permitted
dmesg -c
livepatch: func drop_slab size(2) less than limit(4)
Signed-off-by:
Cheng Jian <cj.chengjian@huawei.com>
Signed-off-by:
Li Bin <huawei.libin@huawei.com>
Tested-by:
Cheng Jian <cj.chengjian@huawei.com>
Tested-by:
Wang Feng <wangfeng59@huawei.com>
Tested-by:
Lin DingYu <lindingyu@huawei.com>
Tested-by:
Yang ZuoTing <yangzuoting@huawei.com>
Reviewed-by:
Xie XiuQi <xiexiuqi@huawei.com>
Signed-off-by:
zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by:
Dong Kai <dongkai11@huawei.com>
Signed-off-by:
Wang ShaoBo <bobo.shaobowang@huawei.com>
Signed-off-by:
Ye Weihua <yeweihua4@huawei.com>
Reviewed-by:
Kuohai Xu <xukuohai@huawei.com>
Reviewed-by:
Yang Jihong <yangjihong1@huawei.com>
Signed-off-by:
Zheng Zengkai <zhengzengkai@huawei.com>
Loading
Please sign in to comment