Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching
Merge commit. Changes below are compared with the first parent: 7a324b3f.
Changes
2 files changed · +6 −7
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| kernel/livepatch/core.c | modified | +6 | −0 | View file |
| kernel/livepatch/transition.c | modified | +0 | −7 | View file |
kernel/livepatch/core.c
View filediff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c
index 3a4656f..5b77a73 100644
--- a/kernel/livepatch/core.c
+++ b/kernel/livepatch/core.c
@@ -678,6 +678,9 @@ static int klp_init_func(struct klp_object *obj, struct klp_func *func)
if (!func->old_name || !func->new_func)
return -EINVAL;
+ if (strlen(func->old_name) >= KSYM_NAME_LEN)
+ return -EINVAL;
+
INIT_LIST_HEAD(&func->stack_node);
func->patched = false;
func->transition = false;
@@ -751,6 +754,9 @@ static int klp_init_object(struct klp_patch *patch, struct klp_object *obj)
if (!obj->funcs)
return -EINVAL;
+ if (klp_is_module(obj) && strlen(obj->name) >= MODULE_NAME_LEN)
+ return -EINVAL;
+
obj->patched = false;
obj->mod = NULL;
kernel/livepatch/transition.c
View filediff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c
index 7c6631e..5bc3498 100644
--- a/kernel/livepatch/transition.c
+++ b/kernel/livepatch/transition.c
@@ -310,13 +310,6 @@ static bool klp_try_switch_task(struct task_struct *task)
return true;
/*
- * For arches which don't have reliable stack traces, we have to rely
- * on other methods (e.g., switching tasks at kernel exit).
- */
- if (!klp_have_reliable_stack())
- return false;
-
- /*
* Now try to check the stack for any to-be-patched or to-be-unpatched
* functions. If all goes well, switch the task to the target patch
* state.