[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151118140137.GA3620@treble.redhat.com>
Date: Wed, 18 Nov 2015 08:01:37 -0600
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Miroslav Benes <mbenes@...e.cz>
Cc: Chris J Arges <chris.j.arges@...onical.com>,
live-patching@...r.kernel.org, sjenning@...hat.com,
jikos@...nel.org, vojtech@...e.com, pmladek@...e.com,
jeyu@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3 v7] livepatch: add sympos as disambiguator field to
klp_reloc
On Wed, Nov 18, 2015 at 10:56:00AM +0100, Miroslav Benes wrote:
> On Mon, 16 Nov 2015, Chris J Arges wrote:
>
> > @@ -281,29 +243,26 @@ static int klp_write_object_relocations(struct module *pmod,
> > return -EINVAL;
> >
> > for (reloc = obj->relocs; reloc->name; reloc++) {
> > - if (!klp_is_module(obj)) {
> > - ret = klp_verify_vmlinux_symbol(reloc->name,
> > - reloc->val);
> > - if (ret)
> > - return ret;
> > - } else {
> > - /* module, reloc->val needs to be discovered */
> > - if (reloc->external)
> > - ret = klp_find_external_symbol(pmod,
> > - reloc->name,
> > - &reloc->val);
> > - else
> > - ret = klp_find_object_symbol(obj->mod->name,
> > - reloc->name,
> > - 0, &reloc->val);
> > - if (ret)
> > - return ret;
> > + if (reloc->sympos && (reloc->sympos != 1)) {
> > + pr_err("symbol '%s' is external and has sympos %lu\n",
> > + reloc->name, reloc->sympos);
> > + return -EINVAL;
> > }
>
> Oh, this check should not be here, right? I think it needs to be under 'if
> (reloc->external) {'.
>
> And
>
> if (reloc->sympos && (reloc->sympos != 1)) {
>
> can be written as
>
> if (reloc->sympos > 1) {
>
> Anyway, I am not sure if this is the right thing to do. I know Petr
> suggested it, but maybe it would be sufficient just to error out when
> reloc->sympos is specified for external symbols. Despite there is a valid
> value (== 1). Like it had been done before. Josh came up with the issue.
> So what is your opinion, Josh? It is a nitpick, but nevertheless.
I tend to agree. IMO, any non-zero value of sympos doesn't make sense
for external symbols.
--
Josh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists