All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	julien.grall@arm.com, sstabellini@kernel.org,
	xen-devel@lists.xen.org, ross.lagerwall@citrix.com
Subject: Re: [PATCH 2/2] xen/livepatch: Don't crash on encountering STN_UNDEF relocations
Date: Tue, 20 Jun 2017 09:30:30 -0400	[thread overview]
Message-ID: <20170620133030.GE8119@char.us.oracle.com> (raw)
In-Reply-To: <5948E7A60200007800164559@prv-mh.provo.novell.com>

On Tue, Jun 20, 2017 at 01:15:18AM -0600, Jan Beulich wrote:
> >>> On 20.06.17 at 01:05, <andrew.cooper3@citrix.com> wrote:
> > On 19/06/2017 19:30, Konrad Rzeszutek Wilk wrote:
> >> On Wed, Jun 14, 2017 at 12:49:21PM -0600, Jan Beulich wrote:
> >>>>>> Andrew Cooper <andrew.cooper3@citrix.com> 06/14/17 8:34 PM >>>
> >>>> Well - I've got a livepatch with such a relocation.  It is probably a
> >>>> livepatch build tools issue, but the question is whether Xen should ever
> >>>> accept such a livepatch or not (irrespective of whether this exact
> >>>> relocation is permitted within the ELF spec).
> >>> Since the spec explicitly mentions that case, I think we'd better support 
> > it.
> >>> But it wouldn't be the end of the world if we didn't, as presumably there
> >>> aren't that many use cases for it.
> >> OK. In that case:
> >>
> >> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> 
> I have to admit that I'm surprised by that, not only because of
> what Andrew says below, but also because imo the patch would
> imo need to be done somewhat differently, as outlined earlier
> (making STN_UNDEF less of a special case).

My line of thinking was - if the ELF spec is OK, then lets support it.

But then your point about just giving -EOPNOTSUPP is an excellent
way of "supporting" it - and better yet - we can give the system
admin an nice warning: "Fix your livepatch build-tool as your livepatch
is trying to dereference a NULL point which is unhealthy."

(or such).

Andrew you OK posting a patch like that?

> 
> >> Do you think it would be possible to generate an test-case for this
> >> in arch/test/livepatch?
> > 
> > I can trivially cause this situation to occur with the current build
> > tools, but we are currently presuming a build tools bug to be the
> > underlying issue behind getting a STN_UNDEF relocation in the livepatch.
> > 
> > Given that a STN_UNDEF relocation (appears to) mean a NULL dereference
> > once the relocations are evaluated, I am not happy with supporting such
> > a case.
> 
> Well, quite clearly this can be of use only to produce constants,
> not to produce pointers (unless chained ["expression"] relocations
> are being used, where the result of one element in the chain is the
> addend of the next one, albeit even then this would effectively be
> a NOP relocation, so may be useful only when post-editing binaries
> where the tool doesn't want to change [relocation] section sizes).
> 
> > Therefore, I'm going to insist that we take a concrete decision as to
> > what to do in the hypervisor code, before adding a test case, and
> > advocate for excluding it outright rather than tolerating it in the
> > (certain?) knowledge that Xen will subsequently crash.
> 
> As per the explanation above, we can't tell whether Xen will
> subsequently crash, as we don't know what it is that is being
> relocated by such an relocation. While, as indicated before, I'd like
> to see us support everything the standard mandates, I wouldn't
> view it as a big problem to simply return -EOPNOTSUPP for this case
> for the time being.
> 
> Jan
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-06-20 13:30 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-13 20:51 [PATCH 1/2] xen/livepatch: Clean up arch relocation handling Andrew Cooper
2017-06-13 20:51 ` [PATCH 2/2] xen/livepatch: Don't crash on encountering STN_UNDEF relocations Andrew Cooper
2017-06-13 21:13   ` Andrew Cooper
2017-06-14 10:03     ` Jan Beulich
2017-06-14 10:11   ` Jan Beulich
2017-06-14 10:13     ` Andrew Cooper
2017-06-14 10:24       ` Jan Beulich
2017-06-14 14:18         ` Konrad Rzeszutek Wilk
2017-06-14 18:33           ` Andrew Cooper
2017-06-14 18:49             ` Jan Beulich
2017-06-19 18:30               ` Konrad Rzeszutek Wilk
2017-06-19 23:05                 ` Andrew Cooper
2017-06-20  7:15                   ` Jan Beulich
2017-06-20 13:30                     ` Konrad Rzeszutek Wilk [this message]
2017-06-14 19:08             ` Konrad Rzeszutek Wilk
2017-06-21 18:13   ` [PATCH for-4.9 v2] " Andrew Cooper
2017-06-22  1:26     ` Konrad Rzeszutek Wilk
2017-06-22 15:27       ` Konrad Rzeszutek Wilk
2017-06-22 16:10         ` Konrad Rzeszutek Wilk
2017-06-22 16:33           ` Konrad Rzeszutek Wilk
2017-06-22 17:05             ` Konrad Rzeszutek Wilk
2017-06-23  9:44               ` Jan Beulich
2017-06-22  7:40     ` Jan Beulich
2017-06-22  9:49     ` Ross Lagerwall
2017-06-14  9:25 ` [PATCH 1/2] xen/livepatch: Clean up arch relocation handling Jan Beulich
2017-06-14 13:44 ` Konrad Rzeszutek Wilk
2017-06-14 14:02   ` Jan Beulich
2017-06-14 18:28     ` Andrew Cooper
2017-06-19 18:18       ` Konrad Rzeszutek Wilk
2017-06-20  7:36         ` Jan Beulich
2017-06-20  7:39           ` Andrew Cooper
2017-06-20  7:41             ` Andrew Cooper
2017-06-20  7:56             ` Jan Beulich
2017-06-20 13:36               ` Konrad Rzeszutek Wilk
2017-06-22  1:27 ` Is [PATCH for-4.9] Was:Re: " Konrad Rzeszutek Wilk

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=20170620133030.GE8119@char.us.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=julien.grall@arm.com \
    --cc=ross.lagerwall@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.