From: Alexander Lobakin <aleksander.lobakin@intel.com>
To: Nick Alcock <nick.alcock@oracle.com>
Cc: Steven Rostedt <rostedt@goodmis.org>, <mcgrof@kernel.org>,
<masahiroy@kernel.org>, <linux-modules@vger.kernel.org>,
<linux-trace-kernel@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <arnd@arndb.de>,
<akpm@linux-foundation.org>, <eugene.loh@oracle.com>,
<kris.van.hees@oracle.com>, <bpf@vger.kernel.org>,
Jiri Olsa <jolsa@redhat.com>
Subject: Re: [PATCH modules-next v10 00/13] kallsyms: reliable symbol->address lookup with /proc/kallmodsyms
Date: Fri, 19 May 2023 17:50:35 +0200 [thread overview]
Message-ID: <e6662717-61a1-3e3d-5804-66629a1691e2@intel.com> (raw)
In-Reply-To: <20230508180653.4791819e@rorschach.local.home>
From: Steven Rostedt <rostedt@goodmis.org>
Date: Mon, 8 May 2023 18:06:53 -0400
> This topic came up at LSFMM, presented by Jiri.
>
> I'm Cc'ing this email to the BPF mailing list.
>
> -- Steve
>
>
> On Mon, 5 Dec 2022 16:31:44 +0000
> Nick Alcock <nick.alcock@oracle.com> wrote:
>
>> The kallmodsyms patch series was originally posted in Nov 2019, and the thread
>> (https://lore.kernel.org/linux-kbuild/20191114223036.9359-1-eugene.loh@oracle.com/t/#u)
>> shows review comments, questions, and feedback from interested parties.
>> Most recent posting: <https://lore.kernel.org/linux-modules/20221109134132.9052-1-nick.alcock@oracle.com/T/#t>.
>>
>> All review comments have been satisfied, as far as I know: in particular
>> Yamada's note about translation units that are shared between built-in
>> modules is satisfied with a better representation which is also much, much
>> smaller, and we are no longer using modules_thick.builtin but Luis's new
>> modules.builtin.objs.
>>
>> A kernel tree containing this series alone:
>> https://github.com/oracle/dtrace-linux-kernel kallmodsyms/6.1-rc4-modules-next
>>
>>
>> The whole point of symbols is that their names are unique: you can look up a
>> symbol and get back a unique address, and vice versa. Alas, because
>> /proc/kallsyms (rightly) reports all symbols, even hidden ones, it does not
>> really satisfy this requirement. Large numbers of symbols are duplicated
>> many times (just search for __list_del_entry!), and while usually these are
>> just out-of-lined things defined in header files and thus all have the same
>> implementation, it does make it needlessly hard to figure out which one is
>> which in stack dumps, when tracing, and such things. Some configuration
>> options make things much worse: my test make allyesconfig runs introduced
>> thousands of text symbols named _sub_I_65535_1, one per compiler-generated
>> object file, and it was fairly easy to make them appear in ftrace output.
FYI for devs: I posted RFC of kallsyms with file paths almost a year
ago[0], but it went unnoticed =\
`file name + function name` is not a unique pair: in one of FG-KASLR
discussions, someone even wrote simple script, which showed around 40
collisions in the kernel. My approach was to include file path starting
at the kernel root folder, i.e. `net/core/dev.o:register_netdev`.
I'm not sure why no comments happened back then tho. Maybe you could
take a look, I'm pretty busy with other projects, but if you find
anything useful there in the RFC, I could join to a little bit.
[0]
https://lore.kernel.org/all/20220818115306.1109642-1-alexandr.lobakin@intel.com
Thanks,
Olek
next prev parent reply other threads:[~2023-05-19 15:51 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-05 16:31 [PATCH modules-next v10 00/13] kallsyms: reliable symbol->address lookup with /proc/kallmodsyms Nick Alcock
2022-12-05 16:31 ` [PATCH v10 01/13] kbuild: add modules.builtin.objs Nick Alcock
2022-12-05 16:31 ` [PATCH v10 02/13] kbuild: bring back tristate.conf Nick Alcock
2023-03-05 8:10 ` Masahiro Yamada
2022-12-05 16:31 ` [PATCH v10 03/13] kbuild: add tristate checker Nick Alcock
2023-03-05 15:10 ` Masahiro Yamada
2022-12-05 16:31 ` [PATCH v10 04/13] kbuild: fix up substitutions in makefiles to allow for " Nick Alcock
2023-03-05 15:11 ` Masahiro Yamada
2022-12-05 16:31 ` [PATCH v10 05/13] kbuild: remove MODULE_LICENSE/AUTHOR/DESCRIPTION in non-modules Nick Alcock
2022-12-06 9:11 ` Geert Uytterhoeven
2022-12-06 20:03 ` Nick Alcock
2022-12-06 21:02 ` Arnd Bergmann
2022-12-07 5:03 ` Luis Chamberlain
2022-12-07 5:10 ` Luis Chamberlain
2022-12-07 8:21 ` Christoph Hellwig
2023-03-05 8:09 ` Masahiro Yamada
2022-12-05 16:31 ` [PATCH v10 06/13] build: add a simple iterator over modules.builtin.objs Nick Alcock
2022-12-05 16:31 ` [PATCH v10 07/13] kbuild: generate an address ranges map at vmlinux link time Nick Alcock
2022-12-05 16:31 ` [PATCH v10 08/13] kbuild: make address ranges map work with IBT Nick Alcock
2022-12-05 16:31 ` [PATCH v10 09/13] kallsyms: introduce sections needed to map symbols to built-in modules Nick Alcock
2022-12-05 16:31 ` [PATCH v10 10/13] kallsyms: optimize .kallsyms_modules* Nick Alcock
2022-12-05 16:31 ` [PATCH v10 11/13] kallsyms: distinguish text symbols fully using object file names Nick Alcock
2022-12-05 16:31 ` [PATCH v10 12/13] kallsyms: add /proc/kallmodsyms for text symbol disambiguation Nick Alcock
2022-12-05 16:31 ` [PATCH v10 13/13] perf: proof-of-concept kallmodsyms support Nick Alcock
2022-12-16 15:21 ` [PING] [PATCH modules-next v10 00/13] kallsyms: reliable symbol->address lookup with /proc/kallmodsyms Nick Alcock
2023-01-17 19:51 ` Luis Chamberlain
2023-02-09 16:54 ` Nick Alcock
2023-02-09 23:53 ` Nick Alcock
2023-02-21 21:48 ` Luis Chamberlain
2023-02-22 12:08 ` Nick Alcock
2023-02-22 22:25 ` Luis Chamberlain
2023-04-07 23:21 ` Josh Poimboeuf
2023-04-10 13:08 ` Joe Lawrence
2023-04-24 19:47 ` Luis Chamberlain
2023-04-25 8:27 ` Petr Mladek
2023-05-08 22:06 ` Steven Rostedt
2023-05-19 15:50 ` Alexander Lobakin [this message]
2023-05-22 23:21 ` Luis Chamberlain
2023-05-24 15:02 ` Nick Alcock
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e6662717-61a1-3e3d-5804-66629a1691e2@intel.com \
--to=aleksander.lobakin@intel.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=bpf@vger.kernel.org \
--cc=eugene.loh@oracle.com \
--cc=jolsa@redhat.com \
--cc=kris.van.hees@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=mcgrof@kernel.org \
--cc=nick.alcock@oracle.com \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).