From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: "Christopher M. Riedl" <cmr@informatik.wtf>,
linuxppc-dev@lists.ozlabs.org,
kernel-hardening@lists.openwall.com
Subject: Re: [PATCH 4/5] powerpc/lib: Add LKDTM accessor for patching addr
Date: Wed, 3 Jun 2020 09:14:49 +0200 [thread overview]
Message-ID: <a458667c-fb8d-a01f-130b-0fef733dd001@csgroup.eu> (raw)
In-Reply-To: <20200603051912.23296-5-cmr@informatik.wtf>
Le 03/06/2020 à 07:19, Christopher M. Riedl a écrit :
> When live patching a STRICT_RWX kernel, a mapping is installed at a
> "patching address" with temporary write permissions. Provide a
> LKDTM-only accessor function for this address in preparation for a LKDTM
> test which attempts to "hijack" this mapping by writing to it from
> another CPU.
>
> Signed-off-by: Christopher M. Riedl <cmr@informatik.wtf>
> ---
> arch/powerpc/lib/code-patching.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c
> index df0765845204..c23453049116 100644
> --- a/arch/powerpc/lib/code-patching.c
> +++ b/arch/powerpc/lib/code-patching.c
> @@ -52,6 +52,13 @@ int raw_patch_instruction(struct ppc_inst *addr, struct ppc_inst instr)
> static struct mm_struct *patching_mm __ro_after_init;
> static unsigned long patching_addr __ro_after_init;
>
> +#ifdef CONFIG_LKDTM
> +unsigned long read_cpu_patching_addr(unsigned int cpu)
If this fonction is not static, it means it is intended to be used from
some other C file, so it should be declared in a .h too.
Christophe
> +{
> + return patching_addr;
> +}
> +#endif
> +
> void __init poking_init(void)
> {
> spinlock_t *ptl; /* for protecting pte table */
>
next prev parent reply other threads:[~2020-06-03 10:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-03 5:19 [PATCH 0/5] Use per-CPU temporary mappings for patching Christopher M. Riedl
2020-06-03 5:19 ` [PATCH 1/5] powerpc/mm: Introduce temporary mm Christopher M. Riedl
2020-06-03 6:58 ` Christophe Leroy
2020-06-11 3:34 ` Christopher M. Riedl
2020-06-03 5:19 ` [PATCH 2/5] powerpc/lib: Initialize a temporary mm for code patching Christopher M. Riedl
2020-06-03 7:01 ` Christophe Leroy
2020-06-11 3:29 ` Christopher M. Riedl
2020-06-03 5:19 ` [PATCH 3/5] powerpc/lib: Use " Christopher M. Riedl
2020-06-03 7:12 ` Christophe Leroy
2020-06-11 3:31 ` Christopher M. Riedl
2020-06-03 5:19 ` [PATCH 4/5] powerpc/lib: Add LKDTM accessor for patching addr Christopher M. Riedl
2020-06-03 7:14 ` Christophe Leroy [this message]
2020-06-09 4:40 ` Christopher M. Riedl
2020-06-03 5:19 ` [PATCH 5/5] powerpc: Add LKDTM test to hijack a patch mapping Christopher M. Riedl
2020-06-03 7:20 ` Christophe Leroy
2020-06-09 4:48 ` Christopher M. Riedl
2020-06-15 6:37 ` Christophe Leroy
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=a458667c-fb8d-a01f-130b-0fef733dd001@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=cmr@informatik.wtf \
--cc=kernel-hardening@lists.openwall.com \
--cc=linuxppc-dev@lists.ozlabs.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;
as well as URLs for NNTP newsgroup(s).