1. 07 3月, 2016 1 次提交
  2. 04 12月, 2015 2 次提交
    • C
      livepatch: add sympos as disambiguator field to klp_reloc · 064c89df
      Chris J Arges 提交于
      In cases of duplicate symbols, sympos will be used to disambiguate instead
      of val. By default sympos will be 0, and patching will only succeed if
      the symbol is unique. Specifying a positive value will ensure that
      occurrence of the symbol in kallsyms for the patched object will be used
      for patching if it is valid. For external relocations sympos is not
      supported.
      
      Remove klp_verify_callback, klp_verify_args and klp_verify_vmlinux_symbol
      as they are no longer used.
      
      From the klp_reloc structure remove val, as it can be refactored as a
      local variable in klp_write_object_relocations.
      Signed-off-by: NChris J Arges <chris.j.arges@canonical.com>
      Reviewed-by: NPetr Mladek <pmladek@suse.com>
      Acked-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      064c89df
    • C
      livepatch: add old_sympos as disambiguator field to klp_func · b2b018ef
      Chris J Arges 提交于
      Currently, patching objects with duplicate symbol names fail because the
      creation of the sysfs function directory collides with the previous
      attempt. Appending old_addr to the function name is problematic as it
      reveals the address of the function being patch to a normal user. Using
      the symbol's occurrence in kallsyms to postfix the function name in the
      sysfs directory solves the issue of having consistent unique names and
      ensuring that the address is not exposed to a normal user.
      
      In addition, using the symbol position as the user's method to disambiguate
      symbols instead of addr allows for disambiguating symbols in modules as
      well for both function addresses and for relocs. This also simplifies much
      of the code. Special handling for kASLR is no longer needed and can be
      removed. The klp_find_verify_func_addr function can be replaced by
      klp_find_object_symbol, and klp_verify_vmlinux_symbol and its callback can
      be removed completely.
      
      In cases of duplicate symbols, old_sympos will be used to disambiguate
      instead of old_addr. By default old_sympos will be 0, and patching will
      only succeed if the symbol is unique. Specifying a positive value will
      ensure that occurrence of the symbol in kallsyms for the patched object
      will be used for patching if it is valid.
      
      In addition, make old_addr an internal structure field not to be specified
      by the user. Finally, remove klp_find_verify_func_addr as it can be
      replaced by klp_find_object_symbol directly.
      
      Support for symbol position disambiguation for relocations is added in the
      next patch in this series.
      Signed-off-by: NChris J Arges <chris.j.arges@canonical.com>
      Reviewed-by: NPetr Mladek <pmladek@suse.com>
      Acked-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      b2b018ef
  3. 20 5月, 2015 2 次提交
  4. 19 2月, 2015 1 次提交
  5. 04 2月, 2015 1 次提交
  6. 21 1月, 2015 1 次提交
    • J
      livepatch: support for repatching a function · 3c33f5b9
      Josh Poimboeuf 提交于
      Add support for patching a function multiple times.  If multiple patches
      affect a function, the function in the most recently enabled patch
      "wins".  This enables a cumulative patch upgrade path, where each patch
      is a superset of previous patches.
      
      This requires restructuring the data a little bit.  With the current
      design, where each klp_func struct has its own ftrace_ops, we'd have to
      unregister the old ops and then register the new ops, because
      FTRACE_OPS_FL_IPMODIFY prevents us from having two ops registered for
      the same function at the same time.  That would leave a regression
      window where the function isn't patched at all (not good for a patch
      upgrade path).
      
      This patch replaces the per-klp_func ftrace_ops with a global klp_ops
      list, with one ftrace_ops per original function.  A single ftrace_ops is
      shared between all klp_funcs which have the same old_addr.  This allows
      the switch between function versions to happen instantaneously by
      updating the klp_ops struct's func_stack list.  The winner is the
      klp_func at the top of the func_stack (front of the list).
      
      [ jkosina@suse.cz: turn WARN_ON() into WARN_ON_ONCE() in ftrace handler to
        avoid storm in pathological cases ]
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Reviewed-by: NJiri Slaby <jslaby@suse.cz>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      3c33f5b9
  7. 22 12月, 2014 1 次提交