All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com,
	will@kernel.org
Subject: Re: [PATCH] arm64: kprobes: Drop ID map text from kprobes blacklist
Date: Sun, 5 Feb 2023 11:37:24 -0700	[thread overview]
Message-ID: <Y9/3ZPxfpcZ+JFnf@dev-arch.thelio-3990X> (raw)
In-Reply-To: <20230204101807.2862321-1-ardb@kernel.org>

On Sat, Feb 04, 2023 at 11:18:07AM +0100, Ard Biesheuvel wrote:
> The ID mapped text region is never accessed via the normal kernel
> mapping of text, and so it was moved into .rodata instead. This means it
> is no longer considered as a suitable place for kprobes by default, and
> the explicit blacklist is unnecessary, and actually results in an error
> message at boot:
> 
>   kprobes: Failed to populate blacklist (error -22), kprobes not restricted, be careful using them!
> 
> So stop blacklisting the ID map text explicitly.
> 
> Fixes: af7249b317e4d0b3d ("arm64: kernel: move identity map out of .text mapping")
> Reported-by: Nathan Chancellor <nathan@kernel.org>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

Thank you for the quick fix!

Tested-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  arch/arm64/kernel/probes/kprobes.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
> index f35d059a9a366fa6..70b91a8c6bb3f358 100644
> --- a/arch/arm64/kernel/probes/kprobes.c
> +++ b/arch/arm64/kernel/probes/kprobes.c
> @@ -387,10 +387,6 @@ int __init arch_populate_kprobe_blacklist(void)
>  					(unsigned long)__irqentry_text_end);
>  	if (ret)
>  		return ret;
> -	ret = kprobe_add_area_blacklist((unsigned long)__idmap_text_start,
> -					(unsigned long)__idmap_text_end);
> -	if (ret)
> -		return ret;
>  	ret = kprobe_add_area_blacklist((unsigned long)__hyp_text_start,
>  					(unsigned long)__hyp_text_end);
>  	if (ret || is_kernel_in_hyp_mode())
> -- 
> 2.39.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-02-05 18:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-04 10:18 [PATCH] arm64: kprobes: Drop ID map text from kprobes blacklist Ard Biesheuvel
2023-02-05 18:37 ` Nathan Chancellor [this message]
2023-02-07 10:15 ` Mark Rutland
2023-02-07 18:54 ` Catalin Marinas

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=Y9/3ZPxfpcZ+JFnf@dev-arch.thelio-3990X \
    --to=nathan@kernel.org \
    --cc=ardb@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=will@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 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.