Commit Graph

938 Commits

Author SHA1 Message Date
Seth Jennings e731530ffc ensure scmversion consistency across builds
Signed-off-by: Seth Jennings <sjenning@redhat.com>
2015-01-23 16:17:09 -06:00
Josh Poimboeuf ac7ddc55dd Merge pull request #477 from spartacus06/compat2
add livepatch API support
2015-01-22 13:36:49 -06:00
Seth Jennings cd92020f71 add *hook.c files and make target dep for patch-hook.o
Signed-off-by: Seth Jennings <sjenning@redhat.com>
2015-01-22 11:39:34 -06:00
Seth Jennings 0325e43d93 add naming convention documentation and fixes
Signed-off-by: Seth Jennings <sjenning@redhat.com>
2015-01-22 11:39:34 -06:00
Seth Jennings 923d36ffbc review fixups
Signed-off-by: Seth Jennings <sjenning@redhat.com>
2015-01-22 10:35:11 -06:00
Seth Jennings f1903de1eb add livepatch API support
Adds a new patch module scaffold for use when building against a kernel
with CONFIG_LIVE_PATCHING=y.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
2015-01-21 18:28:31 -06:00
Seth Jennings 4c6e54b2d2 Merge pull request #475 from rousya/master
fix two bugs
2015-01-19 08:52:38 -06:00
Xie XiuQi 6b446cba67 create-diff-object: fix a potential overflow for rela type
rela.type should be unsigned int instead of unsighed char.

/usr/include/gelf.h:#define GELF_R_TYPE(info)   ELF64_R_TYPE (info)
/usr/include/elf.h:#define ELF64_R_TYPE(i)      ((i) & 0xffffffff)

Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com>
2015-01-19 22:43:26 +08:00
Seth Jennings 97c2bea0c0 Merge pull request #467 from flaming-toast/sysfs_perm
Restrict reading old_addr and new_addr to root only
2015-01-05 11:13:04 -06:00
Seth Jennings c163bf5c2e Merge pull request #464 from jpoimboe/readme-force-unsafe
update README with some new frequently asked questions
2015-01-05 11:12:52 -06:00
Seth Jennings 5e1c6e44c4 Merge pull request #463 from jpoimboe/force-description-update
remove obsolete warning for KPATCH_FORCE_UNSAFE
2015-01-05 11:12:31 -06:00
Seth Jennings 1a18417aa0 Merge pull request #474 from jpoimboe/readme-rhel7-dep
readme: add ncurses-devel to RHEL dependencies
2014-12-18 15:03:40 -06:00
Josh Poimboeuf f4ee5d2a3a readme: add ncurses-devel to RHEL dependencies 2014-12-18 14:55:16 -06:00
Seth Jennings 489e6e2407 Merge pull request #473 from jpoimboe/dracut-dependencies
fix dracut dependencies (and "kpatch install")
2014-12-03 17:38:28 -05:00
Josh Poimboeuf 07fccdb577 change inst_symlink to inst for insmod
Use "inst" instead of "inst_symlink" for insmod, since insmod might not
necessarily be a symlink on some distros.  inst_symlink is functionally
the same as inst, with an additional check to make sure that it's a
symlink (which we don't care about either way).
2014-12-03 16:10:21 -06:00
Josh Poimboeuf 6cdb5011c5 fix dracut dependencies
The "kpatch install" command is broken because the kpatch script has
some missing dependencies in the initramfs.  Make sure the new
dependencies (readelf and awk) are added to the initramfs.
2014-12-03 16:09:50 -06:00
Josh Poimboeuf f817265c5a Merge pull request #472 from jpoimboe/0.2.2
bump version to 0.2.2
2014-12-03 09:03:24 -06:00
Josh Poimboeuf 874c438bb6 bump version to 0.2.2 2014-12-03 09:02:55 -06:00
Seth Jennings 7fed248205 Merge pull request #469 from jstancek/issue468
wait for outstanding shadow variables free requests in kpatch_exit
2014-11-21 11:45:01 -05:00
Jan Stancek 6e67e57a42 wait for outstanding shadow variables free requests in kpatch_exit
Unload of kpatch module (and kpatch_shadow_hash table) before
all shadow variables free requests are processed can lead to
kernel crash.

Add rcu_barrier() to kpatch_exit() to wait for all outstanding
RCU callbacks to complete.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
2014-11-21 17:19:51 +01:00
Jessica Yu cd4c0ce02d kpatch-patch-hook: change old_addr and new_addr perms to readable by root only 2014-11-07 21:30:32 -08:00
Josh Poimboeuf 0fbb7856e4 update README with some new frequently asked questions 2014-10-31 11:45:48 -05:00
Josh Poimboeuf 76de86ab75 remove obsolete warning for KPATCH_FORCE_UNSAFE
This warning no longer applies thanks to #398.
2014-10-31 11:39:14 -05:00
Josh Poimboeuf f0ab1caad1 Merge pull request #459 from ColinIanKing/master
Fix memory leak on dest buffer on early return path
2014-10-21 10:03:09 -05:00
Josh Poimboeuf d0697718da Merge pull request #458 from arges/master
kpatch-build: fixup source package version construction
2014-10-21 10:02:13 -05:00
Colin Ian King a41ce8d409 Fix memory leak on dest buffer on early return path
dest is allocated but not freed on an early return path
where dest is not used

Signed-off-by: Colin Ian King <colin.king@canonical.com>
2014-10-20 09:42:44 +01:00
Chris J Arges 1831030c1d kpatch-build: fixup source package version construction
Bash doesn't correctly format the version string which causes the source
package to not be downloaded correctly.

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
2014-10-17 15:38:05 +02:00
Seth Jennings a31a31f184 Merge pull request #457 from jpoimboe/warn-fix
warn detection fix
2014-10-08 11:24:35 -05:00
Josh Poimboeuf fca189152a fix review comment 2014-10-08 11:16:09 -05:00
Seth Jennings 664fb2a8a2 Merge pull request #453 from jpoimboe/rs-special-static
make _rs a "special" static local variable
2014-10-08 10:58:11 -05:00
Josh Poimboeuf ea819a18b0 warn detection fix
The current WARN detection logic catches the majority of cases, but
there are still a lot of outliers which it doesn't catch (thanks, gcc).

I looked at a much larger sample of WARN calls and came up with a more
generic algorithm.
2014-10-07 22:01:14 -05:00
Josh Poimboeuf 128bc9fb31 fix review comments
- rela sections don't have secsyms
- add some comments
2014-10-07 19:47:38 -05:00
Seth Jennings 440a7b06c0 Merge pull request #455 from jpoimboe/detect-warn-change
detect and ignore WARN-only changes
2014-10-07 16:49:40 -05:00
Josh Poimboeuf 027e2b3b4e fix review comment 2014-10-07 16:47:25 -05:00
Josh Poimboeuf 4c7fb9119a detect and ignore WARN-only changes
WARN-only function changes are very common, and a serious PITA for patch
authors.  Detect and ignore them.

Fixes #454.
2014-10-07 11:56:41 -05:00
Josh Poimboeuf c799ecc55f make _rs a special static local
The _rs variable is used for printk ratelimiting, similar to __warned,
which makes it a logical candidate to be "special": don't correlate it,
yet don't mark a function as changed just because it references it.
2014-10-07 08:09:20 -05:00
Josh Poimboeuf fe846f4d56 refactor is_special_static
Make is_special_static()'s implementation more generic to make it easier
to add special static variables in the future
2014-10-07 08:09:20 -05:00
Josh Poimboeuf c705c767af change special_static_prefix to is_special_static
We no longer need to return the prefix, so change it to a boolean
function.
2014-10-07 08:09:20 -05:00
Josh Poimboeuf 0e8f1ae02d use kpatch_mangled_strcmp in rela_equal
Use kpatch_mangled_strcmp() to compare the prefixes of special static
locals.
2014-10-07 08:09:20 -05:00
Josh Poimboeuf 050d7933d7 refactor rela_equal
Make it easier to read and reduce the indent levels
2014-10-07 08:09:20 -05:00
Seth Jennings bb6edd16f9 Merge pull request #452 from jpoimboe/module-call-external
allow patched modules to call external functions
2014-10-07 00:04:43 -05:00
Seth Jennings 31852c0dfa Merge pull request #451 from jpoimboe/sections-syms-fix
section reference replacement for references inside symbols
2014-10-07 00:01:20 -05:00
Seth Jennings 8e9aa2b559 Merge pull request #448 from jpoimboe/static-local-fixes
improve static local variable correlation
2014-10-06 23:56:24 -05:00
Seth Jennings 5ebe1f6a6e Merge pull request #450 from jpoimboe/unlink-err-fix
fix error path typo
2014-10-06 23:55:26 -05:00
Josh Poimboeuf f5de932b8d allow patched modules to call external functions
When patching a kernel module, if we can't find a needed dynrela symbol,
we currently assume it's exported.  However, it's also possible that
it's provided by another .o in the patch module.  Add support for that.

Fixes #445.
2014-10-06 23:16:13 -05:00
Josh Poimboeuf 2a29d8704e fix review comment 2014-10-06 22:56:53 -05:00
Josh Poimboeuf 3dd442b12d section reference replacement for references inside symbols
Currently unbundled section references are only replaced if the start of
the symbol is referenced.  It's also useful to support replacement of
references which point to inside the symbol.
2014-10-06 22:52:01 -05:00
Josh Poimboeuf b6ef92bf6c fix error path typo 2014-10-06 22:38:06 -05:00
Josh Poimboeuf bb35e37c47 small replace_sections_syms refactor
Move this code block to a more logical place, outside of the symbol
loop.
2014-10-06 22:16:22 -05:00
Josh Poimboeuf 731de44ecf Merge pull request #449 from jpoimboe/test-cleanup-fix
test: make sure TMP.patch is cleaned up
2014-10-06 14:43:14 -05:00