Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1283226

Re: [PATCH 0/3 v9] livepatch: disambiguate symbols with the same name

From Josh Poimboeuf <jpoimboe@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 0/3 v9] livepatch: disambiguate symbols with the same name
Date 2015-12-03 19:10 +0100
Message-ID <qBGul-98-1@gated-at.bofh.it> (permalink)
References <qwXFw-1Np-17@gated-at.bofh.it> <qB5Et-1am-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Dec 01, 2015 at 08:40:53PM -0600, Chris J Arges wrote:
> 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.
> 
> The following set of patches use symbol positioning instead of old
> addresses to disambiguate symbols that have the same name in a given
> object. This is necessary in order to be able to patch symbols with the
> same name within the same object. This requires modifications to the
> klp_func and klp_reloc structures to add an additional element. In addition
> the scheme used for the func directory in sysfs is modified to append the
> symbols occurrence in kallsyms.
> 
> In addition, I've tested this patchset against a modified kpatch. I
> modified the kpatch livepatch scaffolding to set lreloc->sympos = 0, and
> lfunc->old_sympos to the nth occurrence of the symbol for that object in
> kallsyms. I was able to patch the same test patch as described here:
>   https://github.com/dynup/kpatch/issues/493
> I've also tested this with sample livepatch code to test if the various
> old_sympos values work for unique and duplicate functions.
> 
> v9:
>  - use mod->name instead of mod->obj->name for klp_find_object_symbol in
>    klp_write_object_relocations
>  - rebase on current master
>  - tested with kpatch

For the series:

Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>

-- 
Josh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3 v9] livepatch: disambiguate symbols with the same name Chris J Arges <chris.j.arges@canonical.com> - 2015-12-02 03:50 +0100
  [PATCH 3/3 v9] livepatch: function,sympos scheme in livepatch sysfs directory Chris J Arges <chris.j.arges@canonical.com> - 2015-12-02 03:50 +0100
  [PATCH 1/3 v9] livepatch: add old_sympos as disambiguator field to klp_func Chris J Arges <chris.j.arges@canonical.com> - 2015-12-02 03:50 +0100
  Re: [PATCH 0/3 v9] livepatch: disambiguate symbols with the same name Petr Mladek <pmladek@suse.com> - 2015-12-02 16:30 +0100
  Re: [PATCH 0/3 v9] livepatch: disambiguate symbols with the same name Josh Poimboeuf <jpoimboe@redhat.com> - 2015-12-03 19:10 +0100
  Re: [PATCH 0/3 v9] livepatch: disambiguate symbols with the same  name Jiri Kosina <jikos@kernel.org> - 2015-12-03 23:10 +0100

csiph-web