lkml.org 
[lkml]   [2019]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] modpost: Copy namespace string into 'struct symbol'
    On Thu, Sep 26, 2019 at 05:24:46PM -0500, Shaun Ruffell wrote:
    > When building an out-of-tree module I was receiving many warnings from
    > modpost like:
    >
    > WARNING: module dahdi_vpmadt032_loader uses symbol __kmalloc from namespace ts/dahdi-linux/drivers/dahdi/dahdi-version.o: ..., but does not import it.
    > WARNING: module dahdi_vpmadt032_loader uses symbol vpmadtreg_register from namespace linux/drivers/dahdi/dahdi-version.o: ..., but does not import it.
    > WARNING: module dahdi_vpmadt032_loader uses symbol param_ops_int from namespace ahdi-linux/drivers/dahdi/dahdi-version.o: ..., but does not import it.
    > WARNING: module dahdi_vpmadt032_loader uses symbol __init_waitqueue_head from namespace ux/drivers/dahdi/dahdi-version.o: ..., but does not import it.
    > ...
    >
    > The fundamental issue appears to be that read_dump() is passing a
    > pointer to a statically allocated buffer for the namespace which is
    > reused as the file is parsed.
    >
    > This change makes it so that 'struct symbol' holds a copy of the
    > namespace string in the same way that it holds a copy of the symbol
    > string. Because a copy is being made, handle_modversion can now free the
    > temporary copy
    >
    > Fixes: cb9b55d21fe0 ("modpost: add support for symbol namespaces")
    > Cc: Martijn Coenen <maco@android.com>
    > Cc: Joel Fernandes (Google) <joel@joelfernandes.org>
    > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    > Cc: Matthias Maennich <maennich@google.com>
    > Cc: Jessica Yu <jeyu@kernel.org>
    > Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
    > ---
    >
    > Hi,
    >
    > I didn't test that this change works with the namespaces, or investigate why
    > read_dump() is only called first while building out-of-tree modules, but it does
    > seem correct to me for the symbol to own the memory backing the namespace
    > string.
    >
    > I also realize I'm jumping the gun a bit by testing against master before
    > 5.4-rc1 is tagged.

    Yes!!!

    This fixes the issue that I reported to Mattias a few days ago on irc.
    I am hitting this by just trying to build a single directory work of
    modules:
    make M=drivers/usb/

    I just tested this patch and it works for me, thanks so much!

    Tested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    \
     
     \ /
      Last update: 2019-09-27 07:32    [W:3.727 / U:0.620 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site