linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/2] arm64: mm: purge lazily unmapped vm regions before changing permissions
Date: Tue, 6 Nov 2018 22:04:03 +0000	[thread overview]
Message-ID: <20181106220359.GA32210@brain-police> (raw)
In-Reply-To: <20181106214404.2497-2-ard.biesheuvel@linaro.org>

On Tue, Nov 06, 2018 at 10:44:03PM +0100, Ard Biesheuvel wrote:
> Call vm_unmap_aliases() every time we apply any changes to permission
> attributes of mappings in the vmalloc region. This avoids any potential
> issues resulting from lingering writable or executable aliases of
> mappings that should be read-only or non-executable, respectively.
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  arch/arm64/mm/pageattr.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c
> index a56359373d8b..f8cf5bc1d1f8 100644
> --- a/arch/arm64/mm/pageattr.c
> +++ b/arch/arm64/mm/pageattr.c
> @@ -93,6 +93,12 @@ static int change_memory_common(unsigned long addr, int numpages,
>  	if (!numpages)
>  		return 0;
>  
> +	/*
> +	 * Get rid of potentially aliasing lazily unmapped vm areas that may
> +	 * have permissions set that deviate from the ones we are setting here.
> +	 */
> +	vm_unmap_aliases();

So this might_sleep(), which I don't think is currently the case for our
set_memory_XX() functions. However, a quick look at the existing callsites
indicates that's ok and matches the x86 implementation, so:

Acked-by: Will Deacon <will.deacon@arm.com>

Will

  reply	other threads:[~2018-11-06 22:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 21:44 [PATCH v3 0/2]get rid of writable linear aliases of read-only vmalloc mappings Ard Biesheuvel
2018-11-06 21:44 ` [PATCH v3 1/2] arm64: mm: purge lazily unmapped vm regions before changing permissions Ard Biesheuvel
2018-11-06 22:04   ` Will Deacon [this message]
2018-11-06 21:44 ` [PATCH v3 2/2] arm64: mm: apply r/o permissions of VM areas to its linear alias as well Ard Biesheuvel
2018-11-06 21:54   ` Will Deacon
2018-11-07  7:51     ` Ard Biesheuvel

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=20181106220359.GA32210@brain-police \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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).