mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-06 22:42:10 +00:00
livepatch: store function sizes
For the consistency model we'll need to know the sizes of the old and new functions to determine if they're on the stacks of any tasks. Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Acked-by: Miroslav Benes <mbenes@suse.cz> Reviewed-by: Petr Mladek <pmladek@suse.com> Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
68ae4b2b68
commit
f5e547f4ac
2 changed files with 19 additions and 0 deletions
|
@ -584,6 +584,22 @@ static int klp_init_object_loaded(struct klp_patch *patch,
|
|||
&func->old_addr);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = kallsyms_lookup_size_offset(func->old_addr,
|
||||
&func->old_size, NULL);
|
||||
if (!ret) {
|
||||
pr_err("kallsyms size lookup failed for '%s'\n",
|
||||
func->old_name);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
ret = kallsyms_lookup_size_offset((unsigned long)func->new_func,
|
||||
&func->new_size, NULL);
|
||||
if (!ret) {
|
||||
pr_err("kallsyms size lookup failed for '%s' replacement\n",
|
||||
func->old_name);
|
||||
return -ENOENT;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue