Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1272378

Re: [PATCH 2/3 v7] livepatch: add sympos as disambiguator field to klp_reloc

From Petr Mladek <pmladek@suse.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/3 v7] livepatch: add sympos as disambiguator field to klp_reloc
Date 2015-11-18 17:50 +0100
Message-ID <qwe5I-5ul-15@gated-at.bofh.it> (permalink)
References <qupoC-ii-19@gated-at.bofh.it> <qvvrX-1EC-5@gated-at.bofh.it> <qvvrX-1EC-3@gated-at.bofh.it> <qw7GW-1aT-23@gated-at.bofh.it> <qwbAT-3W1-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed 2015-11-18 08:01:37, Josh Poimboeuf wrote:
> 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.

OK, I do not have a strong opinion here. I am fain with refusing any
non-zero value.

Just please improve the error message. If I find in dmesg
"symbol 'bla' is external and has sympos 1" I would worry what
the problem is.

Please, somehow express that sympos is not supported for external
relocated symbols. You are not limited by the 80 characters here!

Best Regards,
Petr
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 2/3 v7] livepatch: add sympos as disambiguator field to klp_reloc Chris J Arges <chris.j.arges@canonical.com> - 2015-11-16 18:10 +0100
  Re: [PATCH 2/3 v7] livepatch: add sympos as disambiguator field to  klp_reloc Miroslav Benes <mbenes@suse.cz> - 2015-11-18 11:00 +0100
    Re: [PATCH 2/3 v7] livepatch: add sympos as disambiguator field to  klp_reloc Josh Poimboeuf <jpoimboe@redhat.com> - 2015-11-18 15:10 +0100
      Re: [PATCH 2/3 v7] livepatch: add sympos as disambiguator field to  klp_reloc Petr Mladek <pmladek@suse.com> - 2015-11-18 17:50 +0100
  Re: [PATCH 2/3 v7] livepatch: add sympos as disambiguator field to  klp_reloc Petr Mladek <pmladek@suse.com> - 2015-11-18 17:40 +0100
    Re: [PATCH 2/3 v7] livepatch: add sympos as disambiguator field to  klp_reloc Chris J Arges <chris.j.arges@canonical.com> - 2015-11-18 17:40 +0100
      Re: [PATCH 2/3 v7] livepatch: add sympos as disambiguator field to  klp_reloc Petr Mladek <pmladek@suse.com> - 2015-11-18 18:00 +0100
        Re: [PATCH 2/3 v7] livepatch: add sympos as disambiguator field to  klp_reloc Jiri Kosina <jikos@kernel.org> - 2015-11-18 21:40 +0100

csiph-web