Commit Graph

351 Commits

Author SHA1 Message Date
Seth Jennings
47d4109f7e fixup review comments
Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-04-22 11:01:01 -05:00
Josh Poimboeuf
d1d79084a3 readme: recommend use of the kpatch utility
The kpatch utility is now user friendly enough that it can be used
instead of direct insmods.  We should encourage people to use it, since
we will soon be adding user space functionality above and beyond
insmod/rmmod when loading and unloading.
2014-04-21 21:44:40 -05:00
Josh Poimboeuf
ed31d7af3d kpatch: look for core module in git dir
Allow "kpatch load" to find the core module when kpatch is run directly
from the git tree.  This gives the user the option to use the kpatch
utility directly without having to do a "make install".
2014-04-21 21:38:00 -05:00
Seth Jennings
ab07805166 add info to expected rela sym error
While debugging the code for the bug table logic, I found it useful to
know which rela section and entry the error occurred on.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-04-21 17:40:38 -05:00
Seth Jennings
7cfcce1ed6 add bug table support
This commit adds a new function to properly handle the bug table.
It works by going through .rela__bug_table, after the changed
function symbols have already been marked, and rewrites the section
including only the relocations pertaining to bug entries for
changed functions.

The __bug_table section itself is not modified resulting in
"blank" bug entries: ones whose IP and filename pointers will
not be relocated and, therefore, will be zero.  While a waste
of space, it simplifies the code not to remove these blank
entries. They do no harm.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-04-21 17:40:38 -05:00
Seth Jennings
3753f06de4 use d_size instead of sh_size
The section header size is calculated at output time by libelf
and we use it as a read-only value from read files.

With the next patch we are changing the size of the .rela__bug_table
section.  Lets use d_size instead since it is the value that tells
libelf how to calculate sh_size at output time.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-04-21 17:40:38 -05:00
Seth Jennings
09262d4d67 support .bss.* bundling
Allow bundling of .bss.* sections that are the result of -fdata-sections
so that rela sections referencing data in bss sections by section symbol
can be replaced with the object symbol so it can be linked to the existing
data object in the kernel.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-04-21 17:40:38 -05:00
Seth Jennings
39200f2d9a Merge pull request #132 from jpoimboe/debug-keep-logfile
kpatch-build: don't delete logfile in debug mode
2014-04-21 16:27:53 -05:00
Josh Poimboeuf
cfd1ce3b34 kpatch-build: don't delete logfile in debug mode 2014-04-21 16:26:23 -05:00
Seth Jennings
4fb8d76eb3 Merge pull request #130 from jpoimboe/cdo-log-obj-name
create-diff-object logging improvements
2014-04-17 14:41:59 -05:00
Josh Poimboeuf
9b038039dd create-diff-object: removed unused function
kpatch_find_changed_functions isn't called by anybody, so remove it.
2014-04-15 19:17:40 -05:00
Seth Jennings
3775692aa0 Merge pull request #131 from jpoimboe/tmpdir-name
kpatch-build: put kpatch-build in the tmp dir name
2014-04-15 17:17:21 -05:00
Seth Jennings
56d036004f Merge pull request #129 from jpoimboe/kpatch-load-file
kpatch: allow kpatch load/unload/info for files
2014-04-15 17:09:34 -05:00
Seth Jennings
c7a59142b5 Merge pull request #128 from jpoimboe/fentry
kmod/core: require fentry
2014-04-15 17:09:06 -05:00
Josh Poimboeuf
0684c2f772 kpatch-build: put kpatch-build in the tmp dir name 2014-04-15 16:57:56 -05:00
Josh Poimboeuf
37a66ee57c create-diff-object: show object name in log messages
For log_normal and DIFF_FATAL messages, prefix them with the object name
to give more context, which is useful for patches which change multiple
objects.  Also, no need to add the function and line number to
DIFF_FATAL messages, as the error strings already give enough
information.

Example messages:

  meminfo.o: changed function: meminfo_proc_show
  cmdline.o: no changed functions were found
2014-04-15 16:49:59 -05:00
Josh Poimboeuf
44c4ecd3ff kpatch: allow kpatch load/unload/info for files
A user may want to load a module without having to install it to the
initrd.  In fact, 99% of the time I think that will be the typical usage
of "kpatch load", with a given file as an argument rather than a DB
module.

Have "kpatch load" and other commands take a file as input.  If the file
is not found, then check the DB.
2014-04-15 14:59:47 -05:00
Josh Poimboeuf
991b25b067 kmod/core: require fentry
Only compile the core module if the compiler supports -mfentry.
2014-04-15 14:40:03 -05:00
Seth Jennings
27980527cd Merge pull request #127 from jpoimboe/pr_err
kmod/core: use pr_err instead of printk
2014-04-15 14:28:42 -05:00
Josh Poimboeuf
e6cad4f0b1 kmod/core: use pr_err instead of printk 2014-04-15 14:21:19 -05:00
Seth Jennings
2fd20a7a30 Merge pull request #124 from jpoimboe/taint
kmod/core: taint kernel with TAINT_USER
2014-04-15 13:52:47 -05:00
Seth Jennings
2802086a37 Merge pull request #126 from jpoimboe/rm-kpatch-service
remove systemd service unit file
2014-04-15 13:52:42 -05:00
Seth Jennings
fc42abebd1 Merge pull request #125 from jpoimboe/patch-module-terminology
update patch module terminology
2014-04-15 13:52:19 -05:00
Josh Poimboeuf
ac53b4e7a0 remove systemd service unit file
Now that we're using dracut instead of systemd to load modules at boot
time, the systemd unit file is no longer needed.
2014-04-15 13:50:18 -05:00
Josh Poimboeuf
a7efb05c81 update patch module terminology
Try to be more consistent with the terminology.  In various places we
call it a "hotpatch module", "hot patch module", or "patch module".  How
about we just call it a "patch module" everywhere?
2014-04-15 13:47:56 -05:00
Seth Jennings
afd3669746 Merge pull request #123 from lulinqing/patch-1
Fix issue #122 (subcommand unload not recognized)
2014-04-15 13:34:24 -05:00
Josh Poimboeuf
56645d346d kmod/core: taint kernel with TAINT_USER
For now, taint with TAINT_USER when loading a patch module so that the
user can always detect when a kpatch module has been previously loaded.
Eventually we will want a dedicated TAINT_KPATCH flag in the kernel.
2014-04-15 13:34:01 -05:00
Seth Jennings
18a583b6bf Merge pull request #120 from jpoimboe/revert-115
Revert "kpatch-build: prevent die if only part of objects have no change...
2014-04-15 11:41:51 -05:00
Linqing Lu
9470c385d8 Fix issue #122 (subcommand unload not recognized) 2014-04-15 12:12:15 +08:00
Seth Jennings
6006cb074b Merge pull request #121 from jpoimboe/dracutdir
fix DRACUTDIR to be in /usr/lib/dracut
2014-04-14 12:51:27 -05:00
Seth Jennings
8195a2f79a Merge pull request #119 from jpoimboe/load-into
kpatch: change wording of "load to" to "load into"
2014-04-14 12:41:04 -05:00
Seth Jennings
ba5899b312 Merge pull request #118 from jpoimboe/kpatch-load-2
contrib: change kpatch-apply-all to kpatch-load-all
2014-04-14 12:40:45 -05:00
Josh Poimboeuf
ea945f6121 fix DRACUTDIR to be in /usr/lib/dracut
Unforunately the dracut module doesn't work if installed in
/usr/local/lib/dracut.  It must always be installed in
/usr/lib/dracut regardless of the install prefix.
2014-04-14 12:39:19 -05:00
Josh Poimboeuf
e00d1394c4 Revert "kpatch-build: prevent die if only part of objects have no change"
This reverts commit ab29b1ff59.

Reverting this commit because it causes kpatch-build to ignore any
errors reported by create-diff-object, treating all errors as meaning
that no changes occurred, which is a dangerous assumption to make.
2014-04-14 12:34:44 -05:00
Josh Poimboeuf
68e4cff461 kpatch: change wording of "load to" to "load into" 2014-04-14 12:30:11 -05:00
Josh Poimboeuf
3083d4ef85 contrib: change kpatch-apply-all to kpatch-load-all 2014-04-14 12:27:55 -05:00
Seth Jennings
e1099dbbc1 Merge pull request #115 from madper/master
kpatch-build: prevent die if only part of objects have no change
2014-04-10 22:40:18 -05:00
Madper Xie
ab29b1ff59 kpatch-build: prevent die if only part of objects have no change
Consider following patch: https://lkml.org/lkml/diff/2014/1/7/637/1
Kpatch-build will generate two objects for it. however mlock.o has no
changed function and will cause kpatch-build die.
Signed-off-by: Madper Xie <cxie@redhat.com>
2014-04-11 11:24:05 +08:00
Seth Jennings
35736db592 Merge pull request #117 from useidel/master
changelog of SPEC updated ... forgotten before :-(
2014-04-10 16:56:32 -05:00
Udo Seidel
f0b5756267 changelog of SPEC updated ... forgotten before :-( 2014-04-10 23:53:45 +02:00
Seth Jennings
dd204989e6 Merge pull request #114 from spartacus06/reject-init-changes
fail if init section has changed
2014-04-10 16:12:12 -05:00
Seth Jennings
fcbf46978f Merge pull request #111 from spartacus06/change-subcommands
change 'apply/remove' to 'load/unload'
2014-04-10 16:11:54 -05:00
Seth Jennings
205a508489 Merge pull request #116 from useidel/master
adapted Makefile.inc contrib/Makefile and SPEC file for dracut modules
2014-04-10 16:06:47 -05:00
Udo Seidel
177b42d951 adapted Makefile.inc contrib/Makefile and SPEC file for dracut modules 2014-04-10 22:23:00 +02:00
Seth Jennings
7b15e23149 fail on changed init section
fixes issue #103

Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-04-08 12:45:55 -05:00
Seth Jennings
6626db1ad8 add debug message when section has changed
Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-04-08 12:40:23 -05:00
Seth Jennings
53f051ea18 Merge pull request #110 from spartacus06/fixups
Fixups
2014-04-07 12:15:36 -05:00
Seth Jennings
c4d652c5da remove vim metadata from files
Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-04-07 12:13:53 -05:00
Seth Jennings
6655d00c60 change 'apply/remove' to 'load/unload'
After removing the distinction between 'enabled' modules and 'applied'
modules in 022e42bc, we can change the 'apply' and 'remove' subcommands,
to more intuitive 'load' and 'unload' subcommands.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-04-07 12:12:40 -05:00
Seth Jennings
8ba2d549cc add -R to remove directory
Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-04-07 12:06:58 -05:00