Commit 92c2ec1a authored by Zheng Yejian's avatar Zheng Yejian
Browse files

livepatch: Complete check calltrace for running tasks

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I9R2TB



--------------------------------

As before, task calltrace checking was assumed being performed under
stop_machine and tasks to be checked are all not in running state.
So there is one case that old function not needed to check, that is:
  preemption disabled and 'force' field not be KLP_NORMAL_FORCE and
  no 'call' instructions in livepatch replace area.

But when using breakpoint optimization without stop_machine, tasks
may be running, we can not ignore above check.

Signed-off-by: default avatarZheng Yejian <zhengyejian1@huawei.com>
parent 2bd1731b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -138,6 +138,7 @@ int arch_klp_check_activeness_func(struct klp_patch *patch, int enable,
				 * complete.
				 */
				if (IS_ENABLED(CONFIG_PREEMPTION) ||
				    IS_ENABLED(CONFIG_LIVEPATCH_BREAKPOINT_NO_STOP_MACHINE) ||
				    (func->force == KLP_NORMAL_FORCE) ||
				    check_jump_insn(func_addr)) {
					ret = add_func(func_list, &pcheck,
+1 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ int arch_klp_check_activeness_func(struct klp_patch *patch, int enable,
				 * complete.
				 */
				if (IS_ENABLED(CONFIG_PREEMPTION) ||
				    IS_ENABLED(CONFIG_LIVEPATCH_BREAKPOINT_NO_STOP_MACHINE) ||
				    (func->force == KLP_NORMAL_FORCE) ||
				    check_jump_insn(func_addr)) {
					ret = add_func(func_list, &pcheck,
+1 −0
Original line number Diff line number Diff line
@@ -128,6 +128,7 @@ int arch_klp_check_activeness_func(struct klp_patch *patch, int enable,
				 * complete.
				 */
				if (IS_ENABLED(CONFIG_PREEMPTION) ||
				    IS_ENABLED(CONFIG_LIVEPATCH_BREAKPOINT_NO_STOP_MACHINE) ||
				    (func->force == KLP_NORMAL_FORCE) ||
				    check_jump_insn(func_addr)) {
					ret = add_func(func_list, &pcheck,
+1 −0
Original line number Diff line number Diff line
@@ -131,6 +131,7 @@ int arch_klp_check_activeness_func(struct klp_patch *patch, int enable,
				 * complete.
				 */
				if (IS_ENABLED(CONFIG_PREEMPTION) ||
				    IS_ENABLED(CONFIG_LIVEPATCH_BREAKPOINT_NO_STOP_MACHINE) ||
				    (func->force == KLP_NORMAL_FORCE) ||
				    check_jump_insn(func_addr)) {
					ret = add_func(func_list, &pcheck,
+1 −0
Original line number Diff line number Diff line
@@ -124,6 +124,7 @@ int arch_klp_check_activeness_func(struct klp_patch *patch, int enable,
				 * complete.
				 */
				if (IS_ENABLED(CONFIG_PREEMPTION) ||
				    IS_ENABLED(CONFIG_LIVEPATCH_BREAKPOINT_NO_STOP_MACHINE) ||
				    (func->force == KLP_NORMAL_FORCE) ||
				    check_jump_insn(func_addr)) {
					ret = add_func(func_list, &pcheck,