[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190927053101.GA1781519@kroah.com>
Date: Fri, 27 Sep 2019 07:31:01 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Shaun Ruffell <sruffell@...ffell.net>
Cc: linux-kernel@...r.kernel.org, Martijn Coenen <maco@...roid.com>,
Joel Fernandes <joel@...lfernandes.org>,
Matthias Maennich <maennich@...gle.com>,
Jessica Yu <jeyu@...nel.org>
Subject: Re: [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@...roid.com>
> Cc: Joel Fernandes (Google) <joel@...lfernandes.org>
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Cc: Matthias Maennich <maennich@...gle.com>
> Cc: Jessica Yu <jeyu@...nel.org>
> Signed-off-by: Shaun Ruffell <sruffell@...ffell.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@...uxfoundation.org>
Powered by blists - more mailing lists