From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Artem Savkov <asavkov@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] objtool: fix .cold. functions parent symbols search
Date: Wed, 7 Nov 2018 14:29:42 -0600 [thread overview]
Message-ID: <20181107202942.s24ej5mnh4b3mflw@treble> (raw)
In-Reply-To: <20181107184246.GC11183@shodan.usersys.redhat.com>
On Wed, Nov 07, 2018 at 07:42:46PM +0100, Artem Savkov wrote:
> On Wed, Nov 07, 2018 at 11:08:56AM -0600, Josh Poimboeuf wrote:
> > On Wed, Nov 07, 2018 at 03:05:59PM +0100, Artem Savkov wrote:
> > > The way it is currently done it is possible for read_symbols() to find the
> > > same symbol as parent for ".cold" functions.
> >
> > I seem to remember having this discussion for kpatch-build, but I forget
> > the details. Can you explain how this can happen (and also add that
> > detail to the commit message)?
>
> find_symbol_by_name() traverses the same lists as read_symbols and when
> we change sym->name in place without copying it it changes in the list
> as well. So if child function is before parent in sec->symbol_list the
> same function will be returned as "parent".
Ah, I see.
> It is hard for me to put it into words worthy to be included into
> commit message.
The above description made sense to me, so it sounds like you're on the
right path :-)
> > I haven't seen any bug reports, is it purely theoretical?
>
> No, 4.20-rc1 (actually anything after 4a60aa05a063 "objtool: Support
> per-function rodata sections", before that add_switch_table() doesn't
> seem to be called for those .cold. funcs) fails to build for mewith
> KCFLAGS="-ffunction-sections -fdata-sections" because objtool is
> segfaulting.
If you only see it triggered with -ffunction-sections, that would be
another useful nugget for the commit log.
Also, if it's fixing a regression, be sure to add the 'Fixes' tag.
Thanks!
--
Josh
next prev parent reply other threads:[~2018-11-07 20:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-07 14:05 Artem Savkov
2018-11-07 17:08 ` Josh Poimboeuf
2018-11-07 18:42 ` Artem Savkov
2018-11-07 20:29 ` Josh Poimboeuf [this message]
2018-11-07 21:45 ` [PATCH v2] " Artem Savkov
2018-11-09 17:23 ` Josh Poimboeuf
2018-11-10 12:18 ` Artem Savkov
2018-11-12 3:38 ` Josh Poimboeuf
2018-11-12 12:55 ` [PATCH v3 0/2] objtool: read_symbols() fixes Artem Savkov
2018-11-12 12:55 ` [PATCH v3 1/2] objtool: fix failed cold symbol doublefree Artem Savkov
2018-11-19 17:57 ` Josh Poimboeuf
2018-11-12 12:55 ` [PATCH v3 2/2] objtool: fix .cold functions parent symbols search Artem Savkov
2018-11-19 18:02 ` Josh Poimboeuf
2018-11-20 8:05 ` [PATCH v4 0/2] objtool: read_symbols() fixes Artem Savkov
2018-11-20 8:05 ` [PATCH v4 1/2] objtool: fix failed cold symbol doublefree Artem Savkov
2018-11-20 8:05 ` [PATCH v4 2/2] objtool: fix .cold functions parent symbols search Artem Savkov
2018-11-20 14:12 ` [PATCH v4 0/2] objtool: read_symbols() fixes Josh Poimboeuf
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=20181107202942.s24ej5mnh4b3mflw@treble \
--to=jpoimboe@redhat.com \
--cc=asavkov@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.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
all inboxes | Powered by JetHome®