All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Ross Lagerwall <ross.lagerwall@citrix.com>
Cc: xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 3/5] xen/livepatch: do Xen build-id check earlier
Date: Thu, 26 Sep 2024 18:59:09 +0200	[thread overview]
Message-ID: <ZvWS3W9L_Zt_6ENJ@macbook.local> (raw)
In-Reply-To: <CAG7k0Eq=TO+fPULFqCwmbPQtGVmn9+8JNOSnXxOAux=CTakEow@mail.gmail.com>

On Thu, Sep 26, 2024 at 05:11:19PM +0100, Ross Lagerwall wrote:
> On Thu, Sep 26, 2024 at 11:21 AM Roger Pau Monne <roger.pau@citrix.com> wrote:
> >
> > The check against the expected Xen build ID should be done ahead of attempting
> > to apply the alternatives contained in the livepatch.
> >
> > If the CPUID in the alternatives patching data is out of the scope of the
> > running Xen featureset the BUG() in _apply_alternatives() will trigger thus
> > bringing the system down.  Note the layout of struct alt_instr could also
> > change between versions.  It's also possible for struct exception_table_entry
> > to have changed format, hence leading to other kind of errors if parsing of the
> > payload is done ahead of checking if the Xen build-id matches.
> >
> > Move the Xen build ID check as early as possible.  To do so introduce a new
> > check_xen_buildid() function that parses and checks the Xen build-id before
> > moving the payload.  Since the expected Xen build-id is used early to
> > detect whether the livepatch payload could be loaded, there's no reason to
> > store it in the payload struct, as a non-matching Xen build-id won't get the
> > payload populated in the first place.
> >
> > Note printing the expected Xen build ID has part of dumping the payload
> > information is no longer done: all loaded payloads would have Xen build IDs
> > matching the running Xen, otherwise they would have failed to load.
> >
> > Fixes: 879615f5db1d ('livepatch: Always check hypervisor build ID upon livepatch upload')
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> 
> Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
> 
> Should the ELF_LIVEPATCH_XEN_DEPENDS check also be dropped from
> check_special_sections() since it is no longer necessary?

It's dropped from check_special_sections() in this patch, just not
mentioned in the commit message I'm afraid.

Thanks, Roger.


  reply	other threads:[~2024-09-26 16:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-26 10:14 [PATCH v3 0/5] xen/livepatch: improvements to loading Roger Pau Monne
2024-09-26 10:14 ` [PATCH v3 1/5] xen/livepatch: drop load_addr Elf section field Roger Pau Monne
2024-09-26 11:04   ` Andrew Cooper
2024-09-26 11:27     ` Roger Pau Monné
2024-09-26 12:35   ` Michal Orzel
2024-09-26 15:35   ` Ross Lagerwall
2024-09-26 10:14 ` [PATCH v3 2/5] xen/livepatch: simplify and unify logic in prepare_payload() Roger Pau Monne
2024-09-26 15:52   ` Ross Lagerwall
2024-09-26 10:14 ` [PATCH v3 3/5] xen/livepatch: do Xen build-id check earlier Roger Pau Monne
2024-09-26 11:06   ` Andrew Cooper
2024-09-26 16:11   ` Ross Lagerwall
2024-09-26 16:59     ` Roger Pau Monné [this message]
2024-09-26 10:14 ` [PATCH v3 4/5] x86/alternatives: do not BUG during apply Roger Pau Monne
2024-09-26 11:09   ` Andrew Cooper
2024-09-26 11:28     ` Roger Pau Monné
2024-09-26 10:14 ` [PATCH v3 5/5] x86/alternative: build time check feature is in range Roger Pau Monne

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=ZvWS3W9L_Zt_6ENJ@macbook.local \
    --to=roger.pau@citrix.com \
    --cc=ross.lagerwall@citrix.com \
    --cc=xen-devel@lists.xenproject.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.