1. 21 1月, 2015 2 次提交
    • 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
    • J
      livepatch: enforce patch stacking semantics · 83a90bb1
      Josh Poimboeuf 提交于
      Only allow the topmost patch on the stack to be enabled or disabled, so
      that patches can't be removed or added in an arbitrary order.
      Suggested-by: NJiri Kosina <jkosina@suse.cz>
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Reviewed-by: NJiri Slaby <jslaby@suse.cz>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      83a90bb1
  2. 10 1月, 2015 1 次提交
    • J
      livepatch: fix deferred module patching order · 99590ba5
      Josh Poimboeuf 提交于
      When applying multiple patches to a module, if the module is loaded
      after the patches are loaded, the patches are applied in reverse order:
      
        $ insmod patch1.ko
        [   43.172992] livepatch: enabling patch 'patch1'
      
        $ insmod patch2.ko
        [   46.571563] livepatch: enabling patch 'patch2'
      
        $ modprobe nfsd
        [   52.888922] livepatch: applying patch 'patch2' to loading module 'nfsd'
        [   52.899847] livepatch: applying patch 'patch1' to loading module 'nfsd'
      
      Fix the loading order by storing the klp_patches list in queue order.
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      99590ba5
  3. 09 1月, 2015 1 次提交
  4. 23 12月, 2014 1 次提交
  5. 22 12月, 2014 2 次提交