Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: meminfo.o: 1 function(s) can not be patched #18

Open
aliceinwire opened this issue Jun 5, 2018 · 7 comments
Open

ERROR: meminfo.o: 1 function(s) can not be patched #18

aliceinwire opened this issue Jun 5, 2018 · 7 comments
Labels
D-Hard A task that takes serveral days to complete T-kpatch problem related with kpatch

Comments

@aliceinwire
Copy link
Collaborator

No description provided.

@aliceinwire
Copy link
Collaborator Author

Building modules, stage 2.
MODPOST 259 modules
ERROR: meminfo.o: 1 function(s) can not be patched
meminfo.o: function meminfo_proc_show has no fentry/mcount call, unable to patch
/usr/libexec/kpatch/create-diff-object: unreconcilable difference

@joe-lawrence
Copy link

I would first check your kernel .config file. kpatch-build already checks for a bunch of settings... I would have thought CONFIG_LIVEPATCH would be enough to enable most of the dependencies like CONFIG_FUNCTION_TRACER though.

@aliceinwire
Copy link
Collaborator Author

aliceinwire commented Jun 6, 2018

maybe would be useful if also kpatch-build could check for the kernel configurations settings and not only during compilation time when compiling core.c
https://github.com/dynup/kpatch/blob/1fa1e7a05a245d78b5326bb45eed0b413ce3c1bd/kmod/core/core.c#L57
the only check for CONFIG_LIVEPATCH is here: https://github.com/dynup/kpatch/blob/master/kpatch-build/kpatch-build#L666
and if there is no CONFIG_LIVEPATCH is preparing for using kpatch core module but maybe would be nice to check at least for FTRACE options.

@aliceinwire
Copy link
Collaborator Author

Building modules, stage 2.
MODPOST 259 modules
Extracting new and modified ELF sections
meminfo.o: changed function: meminfo_proc_show
/usr/libexec/kpatch/create-diff-object: ERROR: meminfo.o: kpatch_check_relocations: 1941: out-of-range relocation .debug_str+9668 in .rela.debug_info

@aliceinwire
Copy link
Collaborator Author

aliceinwire commented Jun 6, 2018

create-diff-object debug output
create-diff-patch.log

@aliceinwire
Copy link
Collaborator Author

this is the patch tested:

diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c
--- src.orig/fs/proc/meminfo.c  2017-11-17 15:58:41.113211972 -0500
+++ src/fs/proc/meminfo.c       2017-11-17 15:58:58.554211972 -0500
@@ -42,6 +42,8 @@ static void show_val_kb(struct seq_file
		seq_write(m, " kB\n", 4);
 }

+static int foo = 5;
+
 static int meminfo_proc_show(struct seq_file *m, void *v)
 {
		struct sysinfo i;
@@ -153,6 +155,7 @@ static int meminfo_proc_show(struct seq_
		show_val_kb(m, "CmaFree:        ",
					global_page_state(NR_FREE_CMA_PAGES));
 #endif
+       seq_printf(m, "kpatch: %d\n", foo);

		hugetlb_report_meminfo(m);


kpatch-build
	create-diff-object.c

@aliceinwire
Copy link
Collaborator Author

reported to kpatch upstream
kpatch issue #877

@aliceinwire aliceinwire changed the title Check compatibility with kpatch-0.6 version ERROR: meminfo.o: 1 function(s) can not be patched Nov 24, 2018
@aliceinwire aliceinwire added D-Hard A task that takes serveral days to complete T-kpatch problem related with kpatch labels Jun 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D-Hard A task that takes serveral days to complete T-kpatch problem related with kpatch
Projects
None yet
Development

No branches or pull requests

2 participants