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

kpatch_create_dynamic_rela_sections: 2090: lookup_local_symbol .LC1 (aio.c) needed for __bug_table #359

Closed
jpoimboe opened this issue Aug 13, 2014 · 0 comments · Fixed by #365
Assignees

Comments

@jpoimboe
Copy link
Member

This patch probably won't work anyway because it patches a system call function, which is a known limitation of kpatch. But it gave me an unexpected error:

Index: src/fs/aio.c
===================================================================
--- src.orig/fs/aio.c
+++ src/fs/aio.c
@@ -1561,6 +1561,8 @@ static struct kiocb *lookup_kiocb(struct
        if (kiocb->ki_obj.user == iocb)
            return kiocb;
    }
+   if (!jiffies)
+       printk("lookup_kiocb\n");
    return NULL;
 }

@@ -1642,3 +1644,15 @@ SYSCALL_DEFINE5(io_getevents, aio_contex
    }
    return ret;
 }
+
+void kpatch_load_aio_max_nr(void)
+{
+   aio_max_nr = 0x40000;
+}
+void kpatch_unload_aio_max_nr(void)
+{
+   aio_max_nr = 0x10000;
+}
+#include "kpatch-macros.h"
+KPATCH_LOAD_HOOK(kpatch_load_aio_max_nr);
+KPATCH_UNLOAD_HOOK(kpatch_unload_aio_max_nr);
[master] ~/git/kpatch $ kpatch-build/kpatch-build -t vmlinux ~/aio.patch 
Using cache at /home/jpoimboe/.kpatch/src
Testing patch file
checking file fs/aio.c
Building original kernel
Building patched kernel
Extracting new and modified ELF sections
aio.o: changed function: SyS_io_cancel
aio.o: found hook: kpatch_unload_aio_max_nr
aio.o: found hook: kpatch_load_aio_max_nr
/home/jpoimboe/git/kpatch/kpatch-build/create-diff-object: kpatch_create_dynamic_rela_sections: 2090: lookup_local_symbol .LC1 (aio.c) needed for __bug_table
ERROR: kpatch build failed. Check /tmp/kpatch-build-1407945223.log for more details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants