Skip to content

Potential bug in create-kpatch-module #813

@abk-code

Description

@abk-code

Potential bug in create-kpatch-module when running kpatch-build inside docker to build
against 4.4.27 kernel.

I did use the following link to install necessary dependencies.
https://github.com/dynup/kpatch

Since we are building inside docker against an older kernel, my understanding is
Kpatch-build will try to build older format of live patch using create-kpatch-module.
I do see both original .o and patched .o in the relevant directories inside docker.

But create-kpatch-module is not being called and I'm getting an error
indicating "Makefile target missing".

Upon further inspection (with -d oputput and from the script itself)

+ /usr/local/libexec/kpatch/create-kpatch-module /home/xyz/.kpatch/tmp/patch/tmp_output.o /home/xyz/.kpatch/tmp/patch/output.o
+ local to_stdout=1
+ [[ 1 -ge 2 ]]
+ [[ 1 -eq 1 ]]
+ tee -a /home/racker/.kpatch/build.log
+ check_pipe_status create-kpatch-module
+ rc=0
+ [[ 0 = 139 ]]
+ cd /home/xyz/.kpatch/tmp/patch
+ logger
+ KPATCH_BUILD=/source/linux
+ KPATCH_NAME=kpatch-4-4-0-2-modules-0-3-2-3-x86_64
+ KBUILD_EXTRA_SYMBOLS=/usr/lib/modules/4.4.0+2/extra/kpatch/Module.symvers
+ KPATCH_LDFLAGS=
+ make

This is where it's failing. The script comparison is with 139 which is SIGSEGV. I don't see
any core files either in the working directory.

I'm re-running the build again and will append any logs and more details.

  • host kernel version
 uname -a
Darwin MVG0PGG8WL 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64
  • container OS :
Linux 15e882430758 4.9.87-linuxkit-aufs #1 SMP Wed Mar 14 15:12:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  • container gcc version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  • patch-build line
kpatch-build -d -n kpatch-4.4.0+2-modules-0.3.2-3.x86_64 -c ./kernel-x86_64.config -s . -v /usr/lib/debug/lib/modules/4.4.0+2/vmlinux meminfo-string2.patch --skip-cleanup
  • attach the input patch file
diff --git i/fs/proc/meminfo.c w/fs/proc/meminfo.c
index 9155a5a0d3b9..45dba271f01c 100644
--- i/fs/proc/meminfo.c
+++ w/fs/proc/meminfo.c
@@ -131,7 +131,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
 		"Committed_AS:   %8lu kB\n"
 		"VmallocTotal:   %8lu kB\n"
 		"VmallocUsed:    %8lu kB\n"
-		"VmallocChunk:   %8lu kB\n"
+		"VmallocChunk temp:   %8lu kB\n"
 #ifdef CONFIG_MEMORY_FAILURE
 		"HardwareCorrupted: %5lu kB\n"
 #endif

edit: @joe-lawrence, formatting cleanup

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions