• C
    livepatch/core: Restrict livepatch patched/unpatched when plant kprobe · c8f9d7a3
    Cheng Jian 提交于
    euler inclusion
    category: feature
    Bugzilla: 5507
    CVE: N/A
    
    ----------------------------------------
    
    livepatch wo_ftrace and kprobe are in conflict, because kprobe
    may modify the instructions anywhere in the function.
    
    So it's dangerous to patched/unpatched an function when there are
    some kprobes registed on it. Restrict these situation.
    
    we should hold kprobe_mutex in klp_check_patch_kprobed, but it's
    static and can't export, so protect klp_check_patch_probe in
    stop_machine to avoid registing kprobes when patching.
    
    we do nothing for (un)register kprobes on the (old) function
    which has been patched. because there are sone engineers need this.
    certainly, it will not lead to hangs, but not recommended.
    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>
    c8f9d7a3
Kconfig 1.8 KB