lkml.org 
[lkml]   [2014]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 2/2] kernel: add support for live patching
    On Thu, Nov 06, 2014 at 10:20:49AM -0600, Seth Jennings wrote:
    > On Thu, Nov 06, 2014 at 04:11:37PM +0100, Jiri Kosina wrote:
    > > On Thu, 6 Nov 2014, Seth Jennings wrote:
    > > > +/****************************************
    > > > + * dynamic relocations (load-time linker)
    > > > + ****************************************/
    > > > +
    > > > +/*
    > > > + * external symbols are located outside the parent object (where the parent
    > > > + * object is either vmlinux or the kmod being patched).
    > > > + */
    > >
    > > I have no ideas what dynrela is, and quickly reading the source doesn't
    > > really help too much.
    > >
    > > Could you please provide some explanation / pointer to some documentation,
    > > explaining what exactly it is, and why should it be part of the common
    > > infrastructure?
    >
    > Yes, I should explain it.
    >
    > This is something that is currently only used in the kpatch approach.
    > It allows the patching core to do dynamic relocations on the new
    > function code, similar to what the kernel module linker does, but this
    > works for non-exported symbols as well.
    >
    > This is so the patch module doesn't have to do a kallsyms lookup on
    > every non-exported symbol that the new functions use.
    >
    > The fields of the dynrela structure are those of a normal ELF rela
    > entry, except for the "external" field, which conveys information about
    > where the core module should go looking for the symbol referenced in the
    > dynrela entry.

    BTW, use of the dynrelas is optional, but highly recommended. The
    kGraft approach of manually doing a kallsyms lookup for each
    non-exported symbol is inherently dangerous because of duplicate
    symbols.

    --
    Josh


    \
     
     \ /
      Last update: 2014-11-06 17:41    [W:6.538 / U:0.072 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site