Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/jikos/livepatching

Pull livepatching updates from Jiri Kosina:
 "Code cleanups from Kamalesh Babulal"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching:
  livepatch: Validate module/old func name length
  livepatch: Remove reliable stacktrace check in klp_try_switch_task()
  • Loading branch information
torvalds committed Aug 20, 2018
2 parents 7a324b3 + badf58a commit 3933ec7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 6 additions & 0 deletions kernel/livepatch/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
7 changes: 0 additions & 7 deletions kernel/livepatch/transition.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,6 @@ static bool klp_try_switch_task(struct task_struct *task)
if (task->patch_state == klp_target_state)
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
Expand Down

0 comments on commit 3933ec7

Please sign in to comment.