From: "Julian Pidancet" <julian.pidancet@oracle.com>
To: "Borislav Petkov" <bp@alien8.de>
Cc: "Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@redhat.com>,
"Dave Hansen" <dave.hansen@linux.intel.com>,
<linux-kernel@vger.kernel.org>, <x86@kernel.org>
Subject: Re: [PATCH] x86/alternative: Consistently patch SMP locks in vmlinux and modules
Date: Thu, 27 Oct 2022 11:42:51 +0200 [thread overview]
Message-ID: <CNWLW5AZPIFG.15HUZ3CU0R36S@orcldev> (raw)
In-Reply-To: <Y1l3lqPTNAcqwtRT@zn.tnic>
[-- Attachment #1: Type: text/plain, Size: 2343 bytes --]
On Wed Oct 26, 2022 at 20:08, Borislav Petkov wrote:
> On Tue, Aug 30, 2022 at 09:42:37AM +0200, Julian Pidancet wrote:
> > The alternatives_smp_module_add() function restricts patching of SMP
> > lock prefixes to the text address range passed as an argument.
> >
> > For vmlinux, patching all the instructions located between the _text and
> > _etext symbols is allowed. That includes the .text section but also
> > other sections such as .text.hot and .text.unlikely.
> >
> > As per the comment inside the 'struct smp_alt_module' definition, the
> > original purpose of this restriction is to avoid patching the init code
> > which may have been deallocated when the alternatives code run.
> >
> > For modules, the current code only allows patching instructions located
> > inside the .text segment, excluding other sections such as .text.hot or
> > .text.unlikely, which may need patching.
>
> Is this something you noticed by inspection or is there a real failure
> behind it?
>
We do live patching of the kernel code at Ksplice. Before applying a
binary patch we have a safety step that compares the running code with
the code that the binary patch is expected to modify and abort if they
differ.
This problem was picked up by the tools that we developped for this
purpose. We have a workaround for this internally, yet the inconsistency
lies in the kernel, so we thought it best fixed there directly.
> > This change aims to make patching of the kernel core and modules more
>
> Avoid having "This patch" or "This commit" and so on, in the commit
> message. It is tautologically useless.
>
> Also, do
>
> $ git grep 'This patch' Documentation/process
>
> for more details.
>
> > consistent, by allowing all text sections of modules except .init.text
> > to be patched in module_finalize().
> >
> > For that we use mod->core_layout.base/mod->core_layout.text_size as the
>
> Please use passive voice in your commit message: no "we" or "I", etc,
> and describe your changes in imperative mood.
>
> Bottom line is: personal pronouns are ambiguous in text, especially with
> so many parties/companies/etc developing the kernel so let's avoid them
> please.
>
Thanks for your time looking at this. I'll reword the commit description
and submit a v2 shortly.
Regards,
--
Julian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 265 bytes --]
next prev parent reply other threads:[~2022-10-27 9:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-30 7:42 Julian Pidancet
2022-10-05 8:38 ` Julian Pidancet
2022-10-26 18:08 ` Borislav Petkov
2022-10-27 9:42 ` Julian Pidancet [this message]
2022-10-27 6:55 ` Peter Zijlstra
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=CNWLW5AZPIFG.15HUZ3CU0R36S@orcldev \
--to=julian.pidancet@oracle.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®