Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1438696
| Path | csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Petr Mladek <pmladek@suse.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 0/2] Fix issue with alternatives/paravirt patches |
| Date | Thu, 07 Jul 2016 18:00:02 +0200 |
| Message-ID | <rSjSy-vy-15@gated-at.bofh.it> (permalink) |
| References | <rRKUO-3fr-9@gated-at.bofh.it> |
| X-Original-To | Jessica Yu <jeyu@redhat.com> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.5.21 (2010-09-15) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 36 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Josh Poimboeuf <jpoimboe@redhat.com>, Miroslav Benes <mbenes@suse.cz>, Jiri Kosina <jikos@kernel.org>, Chris J Arges <chris.j.arges@canonical.com>, Eugene Shatokhin <eugene.shatokhin@rosalab.ru>, live-patching@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org |
| X-Original-Date | Thu, 7 Jul 2016 17:56:33 +0200 |
| X-Original-Message-ID | <20160707155633.GC3556@pathway.suse.cz> |
| X-Original-References | <1467772500-26092-1-git-send-email-jeyu@redhat.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1438696 |
Show key headers only | View raw
On Tue 2016-07-05 22:34:58, Jessica Yu wrote:
> Hi,
>
> A few months ago, Chris Arges reported a bug involving alternatives/paravirt
> patching that was discussed here [1] and here [2]. To briefly summarize the
> bug, patch modules that contained .altinstructions or .parainstructions
> sections would break because these alternative/paravirt patches would be
> applied first by the module loader (see x86 module_finalize()), then
> livepatch would later clobber these patches when applying per-object
> relocations. This lead to crashes and unpredictable behavior.
>
> One conclusion we reached from our last discussion was that we will
> need to introduce some arch-specific code to address this problem.
> This patchset presents a possible fix for the bug by adding a new
> arch-specific arch_klp_init_object_loaded() function that by default
> does nothing but can be overridden by different arches.
>
> To fix this issue for x86, since we can access a patch module's Elf
> sections through mod->klp_info, we can simply delay the calls to
> apply_paravirt() and apply_alternatives() to arch_klp_init_object_loaded(),
> which is called after relocations have been written for an object.
> In addition, for patch modules, .parainstructions and .altinstructions are
> prefixed by ".klp.arch.${objname}" so that the module loader ignores them
> and livepatch can apply them manually.
The solution looks correct to me. The fun will be how to generate
the sections. If I get this correctly, it is not enough to rename
the existing ones. Instead, we need to split .parainstructions
and .altinstructions sections into per-object ones.
I wonder if there is a plan for this. Especially I am interested
into the patches created from sources ;-) I wonder if we could add
a tag somewhere and improve the build infrastructure.
Best Regards,
Petr
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/2] Fix issue with alternatives/paravirt patches Jessica Yu <jeyu@redhat.com> - 2016-07-06 04:40 +0200
[PATCH 2/2] livepatch/x86: apply alternatives and paravirt patches after relocations Jessica Yu <jeyu@redhat.com> - 2016-07-06 04:40 +0200
Re: [PATCH 2/2] livepatch/x86: apply alternatives and paravirt patches after relocations Josh Poimboeuf <jpoimboe@redhat.com> - 2016-07-08 17:50 +0200
[PATCH 1/2] livepatch: use arch_klp_init_object_loaded() to finish arch-specific tasks Jessica Yu <jeyu@redhat.com> - 2016-07-06 04:40 +0200
Re: [PATCH 0/2] Fix issue with alternatives/paravirt patches Petr Mladek <pmladek@suse.com> - 2016-07-07 18:00 +0200
Re: [PATCH 0/2] Fix issue with alternatives/paravirt patches Josh Poimboeuf <jpoimboe@redhat.com> - 2016-07-08 01:00 +0200
Re: Fix issue with alternatives/paravirt patches Jessica Yu <jeyu@redhat.com> - 2016-07-08 02:00 +0200
Re: [PATCH 0/2] Fix issue with alternatives/paravirt patches Christopher Arges <chris.j.arges@canonical.com> - 2016-07-08 07:30 +0200
Re: Fix issue with alternatives/paravirt patches Jessica Yu <jeyu@redhat.com> - 2016-07-08 19:00 +0200
csiph-web