lkml.org 
[lkml]   [2018]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/8] livepatch: Add atomic replace
On Fri, Mar 23, 2018 at 01:00:23PM +0100, Petr Mladek wrote:
> @@ -687,7 +858,14 @@ static void klp_free_patch(struct klp_patch *patch)
>
> static int klp_init_func(struct klp_object *obj, struct klp_func *func)
> {
> - if (!func->old_name || !func->new_func)
> + if (!func->old_name)
> + return -EINVAL;
> +
> + /*
> + * NOPs get the address later. The the patched module must be loaded,

"The the" -> "the"

> + * see klp_init_object_loaded().
> + */
> + if (!func->new_func && !func->nop)
> return -EINVAL;

>
> INIT_LIST_HEAD(&func->stack_node);
> @@ -742,6 +920,9 @@ static int klp_init_object_loaded(struct klp_patch *patch,
> return -ENOENT;
> }
>
> + if (func->nop)
> + func->new_func = (void *)func->old_addr;
> +

These changes make it more obvious that 'new_func' isn't quite the right
name. It should really be 'new_addr' IMO.

--
Josh

\
 
 \ /
  Last update: 2018-04-07 00:06    [W:0.106 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site